-
-
Notifications
You must be signed in to change notification settings - Fork 203
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 extension slowing down IntelliSense #2464
Comments
Please check out some existing performance discussions
perf
|
It is very similar to #2329 and I did some more testing and found that the issue resolves when I disable the "Enable-TS-plugin" setting. |
Does the performance problem happen in a SvelteKit route file? |
Disabling It only happens in the Windows environment, regardless1 of the file extension. It does not occur in macOS with an identical setup and project. The following issue also had a similar conclusion: no performance issue on M1 Pro Mac. Svelte trace logs nothing special, it is just faster on my MacBook Pro 16.
Footnotes
|
Let me clarify a bit. What I want to ask is actually if the performance problem ONLY exists in SvelteKit route ts/js files. I have an idea of what might be the problem but it should only happen to SvelteKit route files. And it shouldn't have anything to do with OS. It probably isn't something to do with the performance difference between the machines either, they're both quite modern devices so there shouldn't be a night and day difference. I am wondering if the difference you see is actually non-routes ts/js files and svelte files vs routes ts/js files. |
This is the performance issue I am experiencing on my Windows laptop: 2024-09-19.230918.mp4Simply disabling the Svelte extension greatly improves the This behavior is reproducible in an Windows on Arm device as well. (Surface Pro 9 5G) |
Can you provide the dependencies and devDependencies in your package.json and tsconfig.json? Weird that it also seems to happen in a svelte file as well. I am wondering if it has something to do with #2244 (comment) but because you only import the package in a svelte file. Also, can you the svelte file again with the svelte.language-server.debug config and turn off |
Am I supposed to re-record the
Requested files: // package.json
{
"dependencies": {
"@hyunbinseo/tools": "^0.3.2",
"better-sqlite3": "^11.2.1",
"drizzle-kit": "^0.24.2",
"drizzle-orm": "^0.33.0",
"ulid": "^2.3.0",
"valibot": "^0.41.0"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.2.4",
"@sveltejs/kit": "^2.5.26",
"@sveltejs/vite-plugin-svelte": "4.0.0-next.6",
"@tailwindcss/forms": "^0.5.8",
"@types/better-sqlite3": "^7.6.11",
"@types/eslint": "^9.6.1",
"@types/node": "^22.5.4",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.43.0",
"globals": "^15.9.0",
"jose": "^5.9.2",
"new-request": "^0.0.17",
"postcss": "^8.4.45",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.6",
"svelte": "5.0.0-next.243",
"svelte-check": "^4.0.1",
"svelte-form-enhanced": "^0.1.0",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4",
"typescript-eslint": "^8.4.0",
"vite": "^5.4.3"
},
"engines": {
"node": ">=22"
},
"type": "module",
"packageManager": "[email protected]+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
} // tsconfig.json
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"allowImportingTsExtensions": true,
// Node.js 22 supports all ES2023 APIs.
// Reference https://node.green/#ES2023
"lib": ["ES2023", "DOM", "DOM.Iterable"]
},
"include": [
"./.svelte-kit/ambient.d.ts",
"./.svelte-kit/non-ambient.d.ts",
"./.svelte-kit/types/**/$types.d.ts",
"./vite.config.js",
"./vite.config.ts",
"./src/**/*.js",
"./src/**/*.ts",
"./src/**/*.svelte",
"./tests/**/*.js",
"./tests/**/*.ts",
"./tests/**/*.svelte",
// Added
"./database/**/*.js",
"./database/**/*.ts"
]
} |
You can also copy the log. There should be some with the [ts] prefix. |
This is the debug log from typing
|
Thanks. It's indeed something to auto-import. I'll take a deeper look later. |
The problem in svelte files only appears the first time completion is triggered. TS Server doesn't have it because some auto-import is calculated and cached a bit earlier. And it only affects auto-import that has never been imported before so I'll probably not change this part. The problem in SvelteKit routes files should be what I think it is. Feel free to comment and provide more info if the problem doesn't improve after we release a fix for this. |
#2464 getPackageJsonsVisibleToFile and getGlobalTypingsCacheLocation are singleton so this should definitely be fine. The proxy language service has the exact list of entry files and the auto-typing also doesn't add any export so it should be fine to just proxy these methods.
Describe the bug
The VS Code IntelliSense is very slow when the Svelte extension is enabled.
Reproduction
Press Ctrl + Space.
Expected behaviour
The IntelliSense loads quickly.
System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
I disabled all extensions and enabled them individually until I found that Svelte was causing the slow IntelliSense.
The text was updated successfully, but these errors were encountered: