-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Slow "Getting code actions from ..." revisited #21485
Comments
@janosh Does disabling Additionally, you could try mypy extension which uses |
I had I just installed the
But having the extension also makes no difference. |
I get this same error except it lasts indefinitely instead of 10 to 30 seconds to save a file. |
Can you share your settings? Do you have Code Actions on save turned on? |
@karthiknadig Yes to both: "source.fixAll",
"source.organizeImports"
],
"editor.formatOnSave": true,
"notebook.formatOnSave.enabled": true, Full settings{
"workbench.colorCustomizations": {
"editorRuler.foreground": "#9c9c9c13"
},
"[javascript][html][typescript][css][markdown][yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[latex]": {
"editor.defaultFormatter": "James-Yu.latex-workshop",
"editor.detectIndentation": false,
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.tabSize": 2
},
"[python]": {
"editor.rulers": [88, 100, 120],
"editor.tabSize": 4,
"rewrap.reformat": true,
"rewrap.wrappingColumn": 88,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnType": true
// "editor.formatOnType": true
// if pylance fails to resolve local editable install of a package, try installing it with
// pip install -e . --config-settings editable_mode=compat
// https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "yzhang.markdown-all-in-one",
"editor.quickSuggestions": {
"comments": "on",
"strings": "on",
"other": "on"
}
},
"emmet.excludeLanguages": [],
"emmet.includeLanguages": {
"markdown": "html"
},
"emmet.triggerExpansionOnTab": true,
"cSpell.customDictionaries": {
"cSpell_dict": {
"addWords": true,
"name": "cSpell_dict",
"path": "~/dev/macos-setup/dotfiles/cSpell_dict.txt"
}
},
"cSpell.enableFiletypes": [
"css",
"git-commit",
"git-rebase",
"html",
"json",
"latex",
"markdown",
"plaintext",
"yaml",
"yml"
],
"cSpell.blockCheckingWhenLineLengthGreaterThan": 10000,
"cSpell.blockCheckingWhenTextChunkSizeGreaterThan": 2000,
"cSpell.checkLimit": 5000,
"cSpell.language": "de,en",
"debug.console.fontSize": 14,
"debug.toolBarLocation": "docked",
"diffEditor.wordWrap": "on",
"editor.codeActionsOnSave": [
"source.fixAll",
"source.organizeImports"
],
"editor.fontSize": 14,
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"editor.scrollBeyondLastLine": false,
"editor.suggestSelection": "first",
"editor.tabSize": 2,
// "eslint.validate": ["javascript", "svelte", "html", "typescript"],
"editor.wordWrap": "on",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"explorer.incrementalNaming": "smart",
"files.associations": {
"*.bib": "latex",
"*.cls": "latex",
"*.pyx": "python",
"*.mdx": "markdown",
"*.svx": "markdown"
},
"files.defaultLanguage": "{activeEditorLanguage}",
"files.exclude": {
"**/.git": true,
"**/.ipynb_checkpoints": true,
"**/.pytest_cache": true,
"**/.vscode": true,
"**/__pycache__": true,
"**/.coverage": true, // pytest coverage
"**/.mypy_cache": true,
"**/.ruff_cache": true
},
"files.trimTrailingWhitespace": true,
"git.autofetch": true,
"gitlens.codeLens.enabled": false,
"gitlens.currentLine.enabled": false,
"gitlens.hovers.currentLine.over": "line",
"gitlens.hovers.enabled": false,
"gitlens.views.commits.pullRequests.enabled": false,
"gitlens.views.commits.pullRequests.showForBranches": false,
"gitlens.views.commits.showBranchComparison": false,
"gitlens.views.repositories.files.layout": "tree",
"html.hover.references": false,
"javascript.updateImportsOnFileMove.enabled": "never",
"jupyter.askForKernelRestart": false,
"jupyter.runStartupCommands": ["%load_ext autoreload", "%autoreload 2"],
"notebook.cellToolbarVisibility": "hover",
"liveshare.featureSet": "insiders",
"markdown.extension.toc.levels": "2..6",
"markdown.extension.toc.orderedList": true,
"markdown.extension.toc.updateOnSave": false,
"markdownlint.config": {
"MD029": false,
"MD033": false,
"MD041": false,
"MD053": false
},
"markdown.extension.orderedList.marker": "one",
"problems.showCurrentInStatus": true,
"python.formatting.provider": "none",
"python.languageServer": "Pylance",
"python.terminal.activateEnvironment": false,
"python.defaultInterpreterPath": "~/.venv/py311/bin/python",
"python.analysis.autoImportCompletions": true,
"python.linting.mypyEnabled": false,
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.fontSize": 14,
"terminal.integrated.lineHeight": 1.3,
"window.newWindowDimensions": "fullscreen",
"window.restoreFullscreen": true,
"workbench.editor.highlightModifiedTabs": true,
"workbench.iconTheme": "material-icon-theme",
"workbench.settings.editor": "json",
"workbench.settings.openDefaultKeybindings": true,
"workbench.settings.useSplitJSON": true,
"workbench.startupEditor": "none",
"workbench.editorAssociations": {
"*.ipynb": "jupyter-notebook",
"git-rebase-todo": "default"
},
"debug.javascript.autoAttachFilter": "disabled",
"security.workspace.trust.untrustedFiles": "open",
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"security.workspace.trust.enabled": false,
"files.insertFinalNewline": true,
"svelte.enable-ts-plugin": true,
"svgPreview.autoOpen": false,
"git.confirmSync": false,
"editor.inlineSuggest.enabled": true,
"terminal.explorerKind": "external",
"redhat.telemetry.enabled": false,
"extensions.ignoreRecommendations": true,
"git.suggestSmartCommit": false,
"diffEditor.maxComputationTime": 3000,
"diffEditor.maxFileSize": 20,
"jupyter.widgetScriptSources": ["jsdelivr.com", "unpkg.com"],
"github.copilot.enable": {
"*": true,
"yaml": true,
"plaintext": false,
"markdown": true,
"python": true
},
"css.lint.duplicateProperties": "error",
"css.hover.references": false,
"css.lint.boxModel": "warning",
"css.lint.propertyIgnoredDueToDisplay": "error",
"css.lint.universalSelector": "warning",
"css.lint.zeroUnits": "error",
"notebook.lineNumbers": "on",
"liveshare.notebooks.allowGuestExecuteCells": true,
"editor.guides.bracketPairsHorizontal": true,
"jupyter.debugJustMyCode": false,
"terminal.integrated.enableMultiLinePasteWarning": false,
"git.autoRepositoryDetection": "subFolders",
"editor.unicodeHighlight.invisibleCharacters": false,
"editor.unicodeHighlight.ambiguousCharacters": false,
"jupyter.logging.level": "verbose",
"markdown.validate.enabled": true,
"css.lint.validProperties": [
"dominant-baseline",
"cx",
"cy",
"r",
"container-type"
],
"svelte.ask-to-enable-ts-plugin": false,
"editor.accessibilitySupport": "off",
"ruff.showNotifications": "onWarning",
"jupyter.interactiveWindow.creationMode": "perFile",
"jupyter.interactiveWindow.textEditor.executeSelection": true,
"jupyter.interactiveWindow.textEditor.magicCommandsAsComments": true,
"jupyter.interactiveWindow.textEditor.autoMoveToNextCell": false,
"jupyter.interactiveWindow.textEditor.autoAddNewCell": false,
"jupyter.interactiveWindow.codeLens.commands": "jupyter.runcell, jupyter.runallcellsabove, jupyter.runcellandallbelow, jupyter.debugcell",
"githubPullRequests.pullBranch": "never",
"notebook.formatOnSave.enabled": true,
"githubPullRequests.terminalLinksHandler": "github",
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// "evenBetterToml.formatter.reorderKeys": true,
"evenBetterToml.formatter.reorderArrays": true,
"grammarly.files.include": ["**/*.{md,tx,tex,rst,svx,html}"],
"gitlens.gitCommands.skipConfirmations": [
"fetch:command",
"switch:command",
"stash-push:command"
],
"diffEditor.ignoreTrimWhitespace": false,
"window.zoomLevel": 1
} |
I tried both. Quit and restarted VS Code after each change. Didn't notice any difference in the time to save. In case it helps, the repo with the longest delay is https://github.com/materialsproject/pymatgen. It's also the largest one I work on. |
Not yet sure if this fixes the problem completely but when I ran |
For me I notice that this problem is triggered if I modify and save a isort is the only extension on the list. I disabled Jupyter and other extensions as mentioned by others above. Why does the |
I see this all the time too. In the Extension Host output window, there's this when it happens:
So without knowing anything about the code, there's a timer that runs and that fails with a Python error, and then that saving thing just fails because it waits for that timer to complete? (Perhaps there would be some way to propagate the failure?) |
@sliedes Thanks for sharing the stack that helps with diagnosing this one. |
it looks like some package installation failure can also cause errors like this, when i uninstalled the notebook everyting back to normal. hope this can be useful. |
Follow up to #19808 (which I can't comment on since locked).
I see the popup
"Getting code actions from 'Python','Jupyter', 'Ruff'"
all the time in large code bases, leading me to believe the slowness has something to do with scanning large numbers of files. The project I notice it most in has 527 Python files. It can take anywhere from 10 to 30+ seconds to save a file.I tried disabling
jupyter
andblack
formatting and the issue persists. I was seeing it long before I started usingruff
so prob not the culprit.The Python extension logs look like
mypy
is running on every save. Maybe that explains the slowness?mypy
scales poorly with project size in my experience.The text was updated successfully, but these errors were encountered: