tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.88k stars 194 forks source link

The Code Helper process constantly uses 100%-200% CPU #1056

Open mockaroo opened 2 months ago

mockaroo commented 2 months ago

What version of VS Code are you using?

Version: 1.93.1 (Universal) Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40 Date: 2024-09-11T17:20:05.685Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Darwin arm64 23.6.0

What version of Tailwind CSS IntelliSense are you using?

v0.12.10

What version of Tailwind CSS are you using?

3.3.3

What package manager are you using?

yarn

What operating system are you using?

macOS

Tailwind config

const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
  darkMode: 'class',
  theme: {
    extend: {
      fontFamily: {
        sans: ['Inter', ...defaultTheme.fontFamily.sans],
      },
      keyframes: {
        fadeIn: {
          '0%': { opacity: '0' },
          '100%': { opacity: '1' },
        },
        pulsate: {
          '0%, 100%': {
            'box-shadow': '0 0 4px rgba(0, 123, 255, 0), 0 0 6px rgba(0, 123, 255, 0), 0 0 8px rgba(0, 123, 255, 0.3), 0 0 10px rgba(0, 123, 255, 0)',
          },
          '50%': {
            'box-shadow':
              '0 0 6px rgba(0, 123, 255, 1), 0 0 10px rgba(0, 123, 255, 0.7), 0 0 12px rgba(0, 123, 255, 0.5), 0 0 14px rgba(0, 123, 255, 0.3)',
          },
        },
      },
      animation: {
        fadeIn: 'fadeIn 0.5s ease-in-out',
        pulsate: 'pulsate 1s infinite linear',
      },
    },
  },
  content: ['./app/views/**/*.html.erb', './app/helpers/**/*.rb', './app/assets/stylesheets/**/*.css', './app/javascript/**/*.{js,jsx}'],
}

VS Code settings

{
  "security.workspace.trust.untrustedFiles": "open",
  "editor.fontSize": 13,
  "editor.tabSize": 2,
  "editor.formatOnSave": true,
  "editor.formatOnPaste": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "files.autoSave": "onFocusChange",
  "explorer.confirmDelete": false,
  "[xml]": {
    "editor.defaultFormatter": "DotJoshJohnson.xml"
  },
  "terminal.explorerKind": "external",
  "svelte.enable-ts-plugin": true,
  "github.copilot.advanced": {},
  "editor.minimap.enabled": false,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "[svelte]": {
    "editor.defaultFormatter": "svelte.svelte-vscode"
  },
  "[erb]": {
    "editor.defaultFormatter": "elia.erb-formatter"
  },
  "github.copilot.enable": {
    "*": true,
    "plaintext": false,
    "markdown": true,
    "scminput": false
  },
  "explorer.confirmDragAndDrop": false,
  "explorer.fileNesting.patterns": {
    "*.ts": "${capture}.js",
    "*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
    "*.jsx": "${capture}.js",
    "*.tsx": "${capture}.ts",
    "tsconfig.json": "tsconfig.*.json",
    "package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb",
    "*.sqlite": "${capture}.${extname}-*",
    "*.db": "${capture}.${extname}-*",
    "*.sqlite3": "${capture}.${extname}-*",
    "*.db3": "${capture}.${extname}-*",
    "*.sdb": "${capture}.${extname}-*",
    "*.s3db": "${capture}.${extname}-*"
  },
  "editor.accessibilitySupport": "off",
  "git.enableSmartCommit": true,
  "git.confirmSync": false,
  "[rust]": {
    "editor.defaultFormatter": "rust-lang.rust-analyzer"
  },
  "tailwindcss-intellisense.trace.server": "verbose",
  "tailwindCSS.validate": false
}

Describe your issue

The Code Helper process associated with this extension constantly uses 100%-200% CPU:

$ ps aux | grep vscode-tailwindcss
user      77738 191.5  6.4 1596731728 1076320   ??  R    10:50AM   5:48.36 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/markbrocato/.vscode/extensions/bradlc.vscode-tailwindcss-0.12.10/dist/tailwindServer.js --node-ipc --clientProcessId=76805
user      77852   0.0  0.0 410732240   1408 s004  S+   10:53AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox vscode-tailwindcss
henrybenso commented 2 months ago

having a similar issue with very high cpu usage

baelter commented 2 months ago

Same, on ubuntu

baelter commented 2 months ago

Output is

 Locating server…
Booting server...
Checking if /home/xxxx/main.css may be Tailwind-related…
Setting up server…
Listening for messages…
Searching for Tailwind CSS projects in the workspace's folders.
temrb commented 1 month ago

in honesty, this has been an issue for almost 2 years. I remember reporting a similar issue (exactly the same: #593) they closed it and haven't worked on it since. They refer to #444 and close that as well-- made 3 years ago.

I am having similar issue with a higher end pc-- disabling / removing the plugin brought down cpu usage from 50% to 3% lol.

best option here is to remove the plugin as it drastically decreases performance of other VSCode features.

They understand this has been an ongoing issue for years though simply will not work on it.

thecrypticace commented 1 month ago

This is incredibly bizarre. I'm not sure why our LSP would be using that much CPU. Feels like its stuck in an infinite loop or something.

Is there a possibility you (or anyone) can provide the project that is causing this to happen? I don't see this at all ever on our own projects and the nature of an LSP means it is incredibly difficult to debug things like this because they're so environment and project dependent.

baelter commented 1 month ago

I think it happens when I'm not in a tailwind projects, so maybe it's stuck looking for a config file or something, that it will never find. Just guessing :)