-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Description
Issue Type: Bug
When I open a large file (tried on .php
and .html
) and emmet.triggerExpansionOnTab
option is enabled, then each pressing on TAB key (even on blank line) make my computer hung for about 1-2 seconds (depends on file size) with high CPU load.
This is true with current 1.33 version of VS CODE, with or without extensions (tried with code --disable-extensions
), with or without project open. I also tried to download 1.34 insiders build and the behavior is still the same.
Steps to Reproduce:
-
Download a fresh 1.34 insiders build (or use 1.33 current).
-
Create new HTML file
tmp.html
with any content. Make sure it is 2000+ lines. Better 5000+ - the hang is more obvious when the file is more large. I attached an example file here. -
Set cursor on any line and press TAB. You can press it many times in a row or press and hold - all should be fine.
-
Open
preferences
and enableEmmet: Trigger Expansion on Tab
option (emmet.triggerExpansionOnTab
). -
Return to opened file and try to press TAB again. You should see a very notable delay between pressing the key and moving the cursor (you can enable
Toggle render whitespace
option to see this better).If you press and hold the TAB key for about 5 seconds, then you should see no spaces/tabs characters entered (but notice high CPU load), you then can move cursor to anoter place in the editor, and after another 10-30 seconds have been passed (all that time with high CPU load), the delayed space characters will appear at the current cursor position (not where the cursor been when you actually pressed the TAB key).
So here is two problems:
- A high CPU load and delay between pressing TAB key and appearing of spaces/tab characters.
- The space/tab characters appears after the delay not where the cursor was when TAB key was pressed, but at the current position of the cursor.
I notice this problem only recently. I'm not sure with which build this comes in (not used VS Code recently), but 1-2 month ago there were no this problem.
VS Code version: Code - Insiders 1.34.0-insider (56f1b47, 2019-04-09T05:19:45.294Z)
OS version: Windows_NT x64 6.1.7601
System Info
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz (4 x 3400) |
GPU Status | 2d_canvas: enabled checker_imaging: disabled_off flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software rasterization: enabled surface_synchronization: enabled_on video_decode: enabled webgl: enabled webgl2: enabled |
Load (avg) | undefined |
Memory (System) | 23.93GB (1.39GB free) |
Process Argv | |
Screen Reader | no |
VM | 0% |