-
Notifications
You must be signed in to change notification settings - Fork 196
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
VSCode Hangs indefinitely while Formatting on save since version 0.9.8 #755
Comments
I've had this issue as well, and after disabling |
also have this issue on windows OS in my nrwl/nx monorepo. recent occurrence. about 10-30 min in my project becomes unusable and im forced to constantly enable/disable this extension or shut down/start up vscode entirely |
yep, also observing this. can i simply downgrade until this is fixed? |
Do you all have the prettier extension installed? If so, if you downgrade to v0.2.5 do you still see this issue? |
@thecrypticace Do you mean this one? https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode |
That is the one I'm talking about yes. There've been reports of slowness regarding the tailwindcss prettier plugin inside VSCode which I'm investigating. I'm not certain yet if they're related. Just gathering data currently. |
I use that extension as well, but not the tailwind plugin for prettier. So I'm not sure that's related. |
Ah that's good to know! Thanks! |
Also running into this. At first i thought it was the custom regex rules but happens with vanilla settings too. It is def always Tailwind + Prettier when it hangs but removing tailwind extension fixes it up |
Can we do something to help? This is driving me nuts. |
For those that are experiencing this, is your codebase a Vue app? Do you have the Volar extension installed? I first blamed the Tailwind plugin but removing it did not fix this issue. When viewing the locked up VS Code Extension Host process it has a call chain starting with volar -> prettier -> tailwind. In the Volar issues they have been reporting this bug as well and supposedly it's fixed in the most recent pre-release. 🤞 |
Hey all. I'm more than happy to take a look into this issue but it's going to be incredibly difficult without some more information. If somebody could share the following that would be a great help:
It would also be interesting to know what everyone is actually seeing when this is happening. Is everyone seeing the code actions message? And does it ever only have Tailwind CSS IntelliSense listed? Or are there always other extensions mentioned? @glekner, does the issue go away for you if you downgrade to |
@bradlc I managed to reproduce the issue with |
@bradlc I am experiencing this issue as well in a NextJS 13 and TypeScript codebase. I did see the code actions message too, both Tailwind CSS IntelliSense and ESLint were listed but will take screenshots next time. VS Code extensions
VS Code user settings
{
"explorer.confirmDelete": false,
"files.autoSave": "onFocusChange",
"editor.renderWhitespace": "none",
"editor.autoClosingBrackets": "always",
"editor.autoClosingQuotes": "always",
"window.restoreWindows": "all",
"eslint.packageManager": "yarn",
"npm.packageManager": "yarn",
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDragAndDrop": false,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll.eslint": false
},
"workbench.colorTheme": "Material Theme Palenight High Contrast",
"workbench.iconTheme": "material-icon-theme",
"workbench.colorCustomizations": {},
"editor.fontSize": 13,
"git.autofetch": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
"editor.defaultFormatter": "ms-python.python",
"editor.formatOnType": true
},
"versionlens.npm.caching.duration": 1,
"versionlens.suggestions.showOnStartup": true,
"[svelte]": {},
"go.autocompleteUnimportedPackages": true,
"go.useLanguageServer": true,
"[go]": {
"editor.defaultFormatter": "golang.go"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.tree.indent": 16,
"workbench.tree.renderIndentGuides": "always",
"files.autoSaveDelay": 5000,
"prettier.tabWidth": 4,
"prettier.singleQuote": true,
"prettier.printWidth": 120,
"prettier.jsxSingleQuote": true,
"prettier.arrowParens": "avoid",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.trailingComma": "all",
"files.associations": {
"*.rmd": "markdown"
},
"workbench.editorAssociations": {
"*.ipynb": "default"
},
"workbench.startupEditor": "newUntitledFile",
"[c]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"todo-tree.general.tags": ["BUG", "HACK", "FIXME", "TODO", "XXX", "[ ]", "[x]"],
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)",
"go.toolsManagement.autoUpdate": true,
"workbench.panel.defaultLocation": "right",
"editor.linkedEditing": true,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.defaultInterpreterPath": "/opt/homebrew/bin/python3",
"git.allowForcePush": true,
"python.formatting.provider": "black",
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[dockercompose]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
},
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"diffEditor.ignoreTrimWhitespace": false,
"python.analysis.typeCheckingMode": "basic",
"prettier.useTabs": true,
"git.confirmSync": false,
"emmet.excludeLanguages": ["markdown", "javascriptreact", "typescriptreact"],
"breadcrumbs.enabled": false,
"editor.minimap.enabled": false,
"eslint.codeActionsOnSave.rules": null,
"deno.inlayHints.parameterNames.enabled": "none",
"deno.inlayHints.parameterTypes.enabled": false,
"deno.inlayHints.enumMemberValues.enabled": false,
"deno.inlayHints.functionLikeReturnTypes.enabled": false,
"deno.inlayHints.variableTypes.enabled": false,
"terminal.integrated.env.osx": {},
"editor.wordWrap": "on",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"settingsSync.ignoredSettings": []
}
|
Another guess: I think the problem occurs when I have the tailwind prettier plugin and intelli sense running. |
Maybe, but it's not the only cause, if it is indeed related. But maybe there's a common dominator with the eslint extension, since I am using that. |
I turned off the tailwind prettier plugin (removed .prettierrc and npm remove plugin) and no more problems since then. |
☝️ removing the tailwind prettier plugin from |
me and @bengry don't have tailwind prettier plugin installed, we still face the issue. |
As @glekner mentioned, we don't use https://github.com/tailwindlabs/prettier-plugin-tailwindcss, but we do use https://github.com/francoismassart/eslint-plugin-tailwindcss, and have the |
@bengry, if you disable/remove |
Sorry for the delayed response, had a bunch of things come up and I haven't had the time to check this. |
This issue seems to go away when I force downgrade VSCode to 1.76.2. Not saying that is a viable long-term solution, but it at least got me moving again. |
I've been butting my head against this. Even without this extension installed, saving would hang, specifically being stuck on the prettier formatting phase. For me, removing the prettier-plugin-tailwind resolved the issue. I'm not sure why that is the case though - perhaps a race condition of some sort? |
Everytime mine hangs I see this in the Extension host, perhaps unrelated.
But I also noticed it being slow mainly when Copilot is involved. microsoft/vscode#178799 Edit: I downgraded to VSCode 1.76 and no more issues |
Any updates on how to fix this? |
I had this issue with |
I'm not 100% certain but it is possible this is related to microsoft/vscode#184926 The fix for this has been merged in but I don't expect it'll be available until the next minor release of VSCode. |
I sure hope thats it. |
microsoft/vscode#184926 (comment):
I've tried the Insiders build (https://code.visualstudio.com/insiders/) and it's working as expected 👍 |
+1 on this, seems to be working smoothly with this release! |
Oh this is fantastic news! 🎉 🎉 If anyone here can give VSCode 1.80 a try (it's been out for several days now) and report back. I expect the issues are likely gone as some have experienced. |
Same behavior here: How can I disable it? Because it takes a long time (almost 10s) to save my files with that. This is my
Windows 10 + WSL2 (Ubuntu). In a monorepo turborepo/nuxt/vue/typescript |
Made a change couple of days ago and it seems like the issue is gone.
Since adding it to the Files exclude property i'm not experiencing the issue anymore @bradlc can you share your thoughts here? and why does the extension even parse these files? |
Hey @glekner. The extension does not parse Are you certain that the improvement you're seeing is because of the configuration change, or could it be because you have upgraded VS Code to |
@bradlc I have this configuration
could it be related to code actions? |
@bradlc Is there a way to point this plugin at an exclusion file (such as .prettierignore or .eslintignore)? There's lots of discussion on the prettier / eslint github issues on centralising exclusions. The typical way is to point the addons via the package.json at an exclude file in the .gitignore format |
@glekner, are you still able to reproduce the issue on the latest version of VS Code (currently |
Issue is gone @bradlc , but i'm not sure its related to VSCode version.
could it be related to code actions? |
@glekner If you set |
Still causes major issues for me both in monorepos running nextjs13, nextjs12, nestjs and some using containers for local dev others no containers. Seems like for me the |
@localpath do you mean it would take around 30s for it to provide completions? The intellisense extension does not run as part of the nextjs build process (I guess unless you're running the language server yourself during the build). |
I've done some perf testing of diagnostics and don't seem to be able to reproduce perf issues here in the latest version of VSCode. Because this issue has had very little activity in the last couple of months and not enough info available to reliably reproduce — I'm going to go ahead and close it. If this issue pops up again, please leave a comment with details on your VSCode setup (version, config, all installed extensions), a repository that can be cloned to reproduce this issue, and information about how you're using Intellisense (for instance — is it in a Remote workspace over SSH) and I will take a look again. |
I have literally done all of the suggested solutions. Non worked for me! |
@thecrypticace sorry for the late response. It would cause the Nextjs dev server to hang or become unfunctional after a few minutes. I think it was just some weird interaction with WSL 2, Docker shared volumes, HMR, and VSCode sort of bottlenecking or causing things trying to access the filesystem to hang. Doesn't seem to happen anymore so not sure if Nextjs or VSCode did something that fixed it. |
Mentioned behaviors may be caused by other VS Code plugins that analyze files onSave. Disabling the "Auto Import - ES6, TS, JSX, TSX" plugin solved the issue in my case. |
Remove the rm yarn.lock
yarn install |
@glekner You saved my time a lot. Also, I removed auto import extension, too. Check your |
What version of Tailwind CSS IntelliSense are you using?
v0.9.8+
What version of Tailwind CSS are you using?
v3.2.7
What package manager are you using?
yarn
What operating system are you using?
macOS
Tailwind config
VS Code settings
Reproduction URL
no need
Describe your issue
VSCode Hangs indefinitely while Formatting on save since version 0.9.8 and above.
This can start happening between 10-30 min after starting a coding session.
Disabling this extension solves the Issue, can you please take a look?
The text was updated successfully, but these errors were encountered: