Skip to content
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

Infinite Loop on organizing imports on save #2080

Closed
sschneider-ihre-pvs opened this issue Oct 31, 2022 · 8 comments
Closed

Infinite Loop on organizing imports on save #2080

sschneider-ihre-pvs opened this issue Oct 31, 2022 · 8 comments
Labels

Comments

@sschneider-ihre-pvs
Copy link

sschneider-ihre-pvs commented Oct 31, 2022

Type: Bug

When codeActionsOnSave -> "source.organizeImports": true, it can lead to an infinite loop of reloading imports and rearranging them to the same position, preventing saveing or changing the file.

Extension version: 1.0.9
VS Code version: Code - Insiders 1.73.0-insider (3544aabd5a2b0da2cd3a6f3fa3f00759aa9d9709, 2022-10-27T21:34:51.585Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 2904)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.75GB (3.38GB free)
Process Argv --log-net-log=netlog.json --ignore-certificate-error --crash-reporter-id 5f9e326c-2a01-458b-95a4-f411641d6f56
Screen Reader no
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vscaat:30438846
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pylantcb52:30590116
pyind367:30587847
vscccc:30564267
pyindex848cf:30577859
nodejswelcome1:30587009
gswce2:30598411
j6j51389:30596843

@sschneider-ihre-pvs
Copy link
Author

high3

@PixsaOJ
Copy link

PixsaOJ commented Nov 3, 2022

Oh my god, I was debugging for hours.
Auto save settings don't matter. Typescript settings don't matter. Other formatters enabled does not matter.

@jd-solanki
Copy link
Contributor

@johnsoncodehk

Sorry for the ping but this issue making volar useless. I am also facing this and I think it is critical.

@Eterion
Copy link

Eterion commented Nov 4, 2022

For temporary workaround

Disable organize imports

{
  "editor.codeActionsOnSave": {
    "source.fixAll": true,
    "source.organizeImports": false
  },
}

And run organize imports manually, default shortcut Shift + Alt + O

@PixsaOJ
Copy link

PixsaOJ commented Nov 4, 2022

Additional info:
If one import is below other and the first import is indented with 1 TAB, second import will jump to the edge. if you move this second import line below (so 1 blank line between), issue disappears.

We can see in @sschneider-ihre-pvs GIF example, that first import is not affected.

@CatchZeng
Copy link

CatchZeng commented Nov 8, 2022

I solved the problem by downgrading VSCode to 1.72.2.

Version: 1.72.2
Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075
Date: 2022-10-12T22:16:30.254Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 22.1.0
Sandboxed: No

@johnsoncodehk
Copy link
Member

This is VSCode's regression, please track microsoft/vscode#165326.

@jd-solanki
Copy link
Contributor

This is solved, we can close this @sschneider-ihre-pvs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants