vscode: TypeScript support in VSCode become unresponsive
Issue Type: Bug
Nothing specific. Just working with TypeScript code and doing some refactoring. More ofter occurs when trying to rename symbol.
Processing arrows keep rolling forever:
Extensions log
[2020-03-12 16:48:36.952] [exthost] [error] [vscode.typescript-language-features] provider FAILED
[2020-03-12 16:48:36.952] [exthost] [error] Error: busy
at o._provideSemanticTokens (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:180337)
VS Code version: Code 1.43.0 (78a4c91400152c0f27ba4d363eb56d2835f9903a, 2020-03-09T19:34:44.548Z) OS version: Darwin x64 18.7.0
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i7-9750H CPU @ 2.60GHz (12 x 2600) |
GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off_ok webgl: enabled webgl2: enabled |
Load (avg) | 2, 2, 2 |
Memory (System) | 32.00GB (2.45GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 19 (8 by maintainers)
Commits related to this issue
- Throttle the number of semantic token requests #92583 — committed to microsoft/vscode by aeschli 4 years ago
@midnight-dev Yes, currently the whole document is looked at. The next step is to switch to range based semantic highlighting. We’ll try that first before making the delay configurable.
@aeschli Unfortunately, I’m still seeing a lot of busy throws. It’s definitely better than it was, but I’m finding myself trying to race the 300ms to prevent CPU spikes. Every missed keystroke or pause to let variable/function suggestions populate results in my laptop quickly becomes a toaster. I know this is in part the nature of various features like IntelliSense and the like, but I could have sworn developing on VSCode from a few months ago did not burn through as many CPU cycles.
A couple things come to mind. Would it be simple to make the delay configurable, with 300ms being the default? And does the semantic tokens provider scan through the entire document during every request (or response)? Or is it only the current line(s) with an active cursor? The performance could be very different if it only tests the current lines for semantic differences.
I pushed a change that will reduce the number of requests made to the TypeScript server:
Before replying with ‘busy’, wait for the document activity to stop. A new request will come in right after our response.
@alexdima Please have a look. Also, can you look at the error message printed to the ext host log ?