volar-plugins
volar-plugins copied to clipboard
When opening a huge d.ts file, there will be long periods of high CPU usage.
When I use https://github.com/alex8088/electron-vite to create an Electron Vue project, (pnpm create @quick-start/electron). Whenever I open electron.d.ts, I observe that volar ls has a long 100% CPU usage, during which ls does not respond to other operations.
CPU-20231031T215046.cpuprofile
I am not very familiar with vscode, ts, lsp. I observed using the Chrome performance panel and found that it occupies a lot of time here.
https://github.com/volarjs/services/blob/v0.0.16/packages/typescript/src/features/codeAction.ts#L102
It was introduced in https://github.com/volarjs/services/pull/29
I looked up the implementation of the vscode ts plugin and found that it does not invoke getEditsForRefactor in provideCodeActions. (I am not very familiar with vscode) https://github.com/microsoft/vscode/blob/1.83.1/extensions/typescript-language-features/src/languageFeatures/refactor.ts#L487
At the same time, I also found that if I use version 5.1.6 of Typescript, there is no such issue (VSCode will not display the light bulb icon).
-
5.1.6
-
5.2.2
In volar 2.0, there shouldn't be this issue.