microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.42k stars 28.95k forks source link

Injecting and opening multiply file for unknown reason #52795

Closed Akumzy closed 6 years ago

Akumzy commented 6 years ago

I was just coding the next time I noticed is multiply opened tabs An injection unnecessary code messing up my code base. It did same thing a day or two ago with over 200 files opened

screenshot from 2018-06-25 13-13-03 screenshot from 2018-06-25 11-49-45

Issue Type: Bug

Install a Visual Studio Code insiders The start coding with it...

VS Code version: Code - Insiders 1.25.0-insider (d5ad3572c4782f34d3ea3a5e4c8e2384222f9467, 2018-06-25T05:18:17.418Z) OS version: Linux x64 4.15.0-23-generic

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-2348M CPU @ 2.30GHz (4 x 1041)| |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: disabled_software
video_decode: unavailable_software
video_encode: unavailable_software
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|7.69GB (0.12GB free)| |Process Argv|/usr/share/code-insiders/code-insiders --unity-launch| |Screen Reader|no| |VM|0%|
Extensions (26) Extension|Author (truncated)|Version ---|---|--- npm-intellisense|chr|1.3.0 path-intellisense|chr|1.4.2 bracket-pair-colorizer|Coe|1.0.58 vue-peek|dar|1.0.2 vscode-eslint|dba|1.4.12 githistory|don|0.4.1 gitlens|eam|8.4.1 vscode-npm-script|eg2|0.3.4 vsc-material-theme|Equ|2.1.0 prettier-vscode|esb|1.5.0 auto-close-tag|for|0.5.6 auto-rename-tag|for|0.0.15 vue-snippets|hol|0.1.8 vue|liu|0.1.5 dotenv|mik|1.0.1 vscode-extension-auto-import|mop|1.3.3 Go|ms-|0.6.83 js-atom-grammar|ms-|0.1.14 sublime-keybindings|ms-|4.0.0 vuejs-extension-pack|mub|1.1.2 vetur|oct|0.12.5 LiveServer|rit|5.1.1 vue-vscode-snippets|sdr|1.3.0 autoimport|ste|1.5.3 vscode-status-bar-format-toggle|tom|1.4.0 JavaScriptSnippets|xab|1.7.0 (1 theme extensions excluded)
chrmarti commented 6 years ago

What did you do at the time this happened? Could it be that you ran a refactoring (like renaming a type) on one of the Vue.js types?

octref commented 6 years ago

@Akumzy Yeah, please describe what you are doing. Like what keys do you press exactly. Mostly it's probably you run F12 jump to definition on one of the Vue API, so it goes to the type definition files.

Akumzy commented 6 years ago

I can't remember pressing F12 button (fn + F12) Cause I don't know exact time it happened.

My system was hanging for few seconds the next time I noticed was some random imported modules and multiple files that was opened.

I later noticed it was consuming about 3gb worth of ram space with two different windows opened

octref commented 6 years ago

3gb worth of ram space

That's TypeScript's problem. @mjbvz Any ideas?

F12 jumps to definition, so this is really working as expected.

mjbvz commented 6 years ago

@Akumzy Can you please run code-insiders --status to see which process is using the resources

Akumzy commented 6 years ago

Sorry I've to uninstall it and switch back to normal code. insiders almost ruined my entire day. Thank you Guys for the wonderful editor.

polco commented 6 years ago

this happens to me every time i rename a typescript file. I'm using vscode stable on macos. It opens a bunch of typescript declaration files and update them. i disabled all my extension and the problem is still here. After disabling the 'auto update import' (typescript.updateImportsOnFileMove.enabled = "never") feature in the settings, renaming files does not trigger this error anymore. So it's definitely a problem with that feature.

I'm using the latest version of Typescript: 2.9.2.

Nimelrian commented 6 years ago

Can confirm, this has been happening to me since yesterday. When I move a ts file with typescript.updateImportsOnFileMove.enabled = "always" VS Code suddenly opens up more than 800 files from my node_modules directory and starts changing imports in there (from what I could tell, it was simply normalizing import paths), leading the VS Code window to crash. The only way to fix this is trying to hit the "close all editors" button in the explorer view and telling VS Code not to save the changes. VS Code also spawns hundreds of new processes hugging my CPU at 100% during the whole ordeal.

Edit: If I set typescript.updateImportsOnFileMove.enabled = "prompt" the issue still appears once I approve the import update.

Install info: Version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:51:32.889Z) OS Version: Windows_NT x64 10.0.15063 Typescript version: 2.9.2

octref commented 6 years ago

@mjbvz FYI, I also encountered the problem after setting updateImportsOnFileMove. I can try to get you a repro.

Nimelrian commented 6 years ago

Maybe this is a regression of Typescript? I can't remember having this issue while running TS 2.9.1, even when updateImportsOnFileMove was set to "always"

octref commented 6 years ago

This is easily reproducible:

mjbvz commented 6 years ago

Duplicate of #52977