Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind CSS IntelliSense max CPU load on macOS #1109

Open
ChristianAgren opened this issue Dec 13, 2024 · 2 comments
Open

Tailwind CSS IntelliSense max CPU load on macOS #1109

ChristianAgren opened this issue Dec 13, 2024 · 2 comments

Comments

@ChristianAgren
Copy link

What version of VS Code are you using?
v1.96.0

What version of Tailwind CSS IntelliSense are you using?
v.0.12.16, v0.12.15, v0.12.14

What operating system are you using?
macOS Ventura 13.6

VS Code settings

{
  "terminal.integrated.profiles.osx": {
    "bash": {
      "path": "bash",
      "args": ["-l"],
      "icon": "terminal-bash"
    },
    "zsh": {
      "path": "zsh",
      "args": ["-l"]
    },
    "rosetta": {
      "path": "arch",
      "args": ["-x86_64", "zsh", "-l"],
      "overrideName": true
    }
  },
  "terminal.integrated.defaultProfile.osx": "rosetta",
  "redhat.telemetry.enabled": false,
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "git.autofetch": true,
  "prettier.documentSelectors": ["**/*.astro"],
  "[astro]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[scss]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "diffEditor.ignoreTrimWhitespace": false,
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "git.confirmSync": false,
  "[css]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "javascript.updateImportsOnFileMove.enabled": "always",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "cSpell.language": "en,sv,sv-SE",
  "workbench.settings.openDefaultKeybindings": true,
  "[yaml]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html",
    "vue",
    "markdown",
    "json"
  ],
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html",
    "vue",
    "markdown"
    // "json",
    // "jsonc",
    // "json5"
  ],
  "eslint.useESLintClass": true,
  "githubPullRequests.createOnPublishBranch": "never",
  "githubPullRequests.pullBranch": "never",
  "mssql.objectExplorer.groupBySchema": false,
  "azureFunctions.showProjectWarning": false,
  "git.openRepositoryInParentFolders": "always",
  "[rust]": {
    "editor.defaultFormatter": "jinxdash.prettier-rust"
  },
  "git.suggestSmartCommit": false,
  "cSpell.userWords": [
    "actix",
    "artboard",
    "autoconfig",
    "autofetch",
  ],
  "eslint.codeActionsOnSave.rules": null,
  "git.terminalAuthentication": false,
  "nxConsole.showNodeVersionOnStartup": false,
  "bicep.enableSurveys": false,
  "gopls": {
    "ui.semanticTokens": true
  },
  "sonarlint.output.showVerboseLogs": true,
  "sonarlint.rules": {
    "typescript:S6747": {
      "level": "off"
    },
    "typescript:S6759": {
      "level": "off"
    },
    "typescript:S6479": {
      "level": "off"
    },
    "javascript:S4138": {
      "level": "off"
    }
  },
  "go.toolsManagement.autoUpdate": true,
  "dotnet.server.suppressLspErrorToasts": true,
  "sonarlint.focusOnNewCode": false,
  "react-native-tools.showUserTips": false,
  "update.mode": "none",
  "workbench.colorTheme": "Night Owl",
  "files.associations": {
    "*.css": "tailwindcss"
  },
}

Describe your issue
Starting the Tailwind CSS IntelliSense extension in VSCode (in a specific project) takes my CPU usage from ~2% to over 90%. This happens with the aforementioned extension versions. If I install an earlier version, my CPU usage is fine.

The project that I experienced the issues in does not use tailwind in itself. If I check Activity monitor, I can see that VSCode has started a bunch of processes called rg (related to file searching?)
image

Looking closer at these processes by running ps aux | grep <process id> in the terminal, they seem to refer to a bunch of other extensions (nrwl.angular-console, vscode-eslint, code-spell-checker, vscode-yaml) but I don't think they are the culprits as it's only when I start the tailwind extension that my CPU goes through the roof. One of the extensions that the processes are referring to is the json-language-features extension that comes prebundled with vscode, which I don't want to disable.

The temporary fix for me right now is disabling the tailwind extension or using v0.12.13

@luap2703
Copy link

luap2703 commented Dec 16, 2024

@ChristianAgren after playing some time around, I could solve the issue by adding

"tailwindCSS.experimental.configFile": "./apps/web/tailwind.config.ts" <- Your tailwind.config.ts path

to the settings.json.
It seems that tailwind is kind of stuck in locating server. We are using a large monorepo, perhaps it is scanning everything (incl. node_modules) which takes some time (just guessing). This solved it for us, now ramps up to 90% but instantly goes back to 5%. :)

Hope this helps!

@luizpcam
Copy link

up ... same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants