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

Organize Imports broken in 1.73.0 #165326

Closed
nfantone opened this issue Nov 3, 2022 · 29 comments
Closed

Organize Imports broken in 1.73.0 #165326

nfantone opened this issue Nov 3, 2022 · 29 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release

Comments

@nfantone
Copy link

nfantone commented Nov 3, 2022

Type: Bug

After upgrading VSCode to 1.73.0, the Organize Imports action hangs indefinitely, preventing the editor from closing gracefully. If using as part of "editor.codeActionsOnSave", files can no longer be saved. Additionally, import statement in source files look glitchy, constantly flickering and changing colors from the theme's to white. See screenshots below.

Reverting back to September's release fixes the issue for me.

VS Code version: Code 1.73.0 (Universal) (8fa188b, 2022-11-01T15:38:50.881Z)
OS version: Darwin arm64 22.1.0
Modes:
Sandboxed: No

Organize Imports prevents quitting

VSCode cannot exit gracefully

Graphical glitch on import statements

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
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) 3, 4, 4
Memory (System) 32.00GB (5.22GB free)
Process Argv .
Screen Reader no
VM 0%
Extensions (23)
Extension Author (truncated) Version
npm-intellisense chr 1.4.2
path-intellisense chr 2.8.1
vscode-markdownlint Dav 0.48.1
vscode-eslint dba 2.2.6
gitlens eam 13.0.3
EditorConfig Edi 0.16.4
prettier-vscode esb 9.9.0
file-icons fil 1.0.29
terraform has 2.24.3
search-node-modules jas 1.3.0
dotenv mik 1.0.1
vscode-docker ms- 1.22.2
vscode-typescript-next ms- 5.0.20221102
vscode-groovy-lint Nic 2.0.0
code-spell-checker str 2.10.1
sass-indented syl 1.8.22
sort-lines Tyr 1.9.1
intellicode-api-usage-examples Vis 0.2.6
vscodeintellicode Vis 1.2.29
volar Vue 1.0.9
vscode-typescript-vue-plugin Vue 1.0.9
vscode-todo-highlight way 1.0.5
better-align wwm 1.1.6

(1 theme extensions excluded)

@GauBen
Copy link

GauBen commented Nov 3, 2022

Same thing in Svelte files here

@RuneClaeys
Copy link

Same for me, also using Vue (Volar) extension.
Disabling organizeImports works as a temporary fix.

@Zertz
Copy link

Zertz commented Nov 3, 2022

It seems like the combination of these two settings causes to editor to save files in an endless loop:

"editor.codeActionsOnSave": ["source.organizeImports", "source.fixAll.eslint"],

@nfantone
Copy link
Author

nfantone commented Nov 3, 2022

@Zertz In my case, I have (or had before removing "source.organizeImports"):

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

@mjbvz
Copy link
Contributor

mjbvz commented Nov 3, 2022

Does this reproduce with all extensions disabled? Sounds like it's likely caused by an extension

@RMacfarlane
Copy link
Contributor

RMacfarlane commented Nov 3, 2022

No, it doesn't, but it still seems like a regression in VSCode 🤔 I'm using eslint like this person, i.e. also with "editor.codeActionsOnSave": ["source.organizeImports", "source.fixAll.eslint"],. vscode-eslint hasn't updated since July

In my case if I have an import statement like

import {
    makeStoreClosureEventId,
    parseStoreClosureEventId,
    StoreClosureEventIdType,
    validateStoreClosureEventId,
} from '@root/gql/types/StoreClosureEvent'

the organize imports step will remove the trailing comma and then eslint fixAll adds it back again. But instead of doing that just once, it now happens in a continuous loop

@TriStarGod
Copy link

Due to source.organizeImports not respecting trailing commas ( #98123 - unresolved), I also use source.fixAll.eslint to fix it. However, the latest release cycles repeatedly.

@nfantone
Copy link
Author

nfantone commented Nov 4, 2022

Sounds like it's likely caused by an extension

@mjbvz Even if that's the case, this doesn't happen on previous VSCode versions.

@douira
Copy link

douira commented Nov 6, 2022

This also happens for me. I haven't changed my extension setup since before the last VSCode update. Even if an extension is involved in this, merely updating VSCode shouldn't be causing this. It also happens if I disable ESLint in the save actions.

@yoannes
Copy link

yoannes commented Nov 6, 2022

Same here on react-native project, it crashes vscode

"editor.codeActionsOnSave": [
  "source.formatDocument",
  "source.organizeImports",
  "source.fixAll"
],

@migmit
Copy link

migmit commented Nov 6, 2022

Same here with the vshaxe extension. I only had source.organizeImports in my codeActionsOnSave.

@aamirbinabd
Copy link

Same issue using the Astro framework and its language support extension.

@tobil4sk
Copy link
Contributor

tobil4sk commented Nov 6, 2022

Perhaps this issue might have something to do with the recent changes here: #164035 ?

@mrcaidev
Copy link

mrcaidev commented Nov 7, 2022

Same issue with Astro

@isJx
Copy link

isJx commented Nov 7, 2022

After I turned off 'source.organizeImports' it was fine

@Patrick-clone
Copy link

Same issue here, infinite organize import loop with flickering of import statements. I downgraded to version 1.72.2 for now. Hopefully this can be fixed.

@letsgoawaydev
Copy link

If anyone is here still trying to fix, try do it under workspace settings instead of user settings, fixed the issue for me.

@letsgoawaydev
Copy link

"editor.codeActionsOnSave": {
			"source.sortImports": false
		}

@sergioadimedia
Copy link

For me it's still glitching with this config:

"editor.codeActionsOnSave": ["source.fixAll.format", "source.fixAll.eslint"]
"editor.defaultFormatter": "esbenp.prettier-vscode"

I had to downgrade to make it work again.

@jrieken
Copy link
Member

jrieken commented Nov 8, 2022

Couple of observations and ways to fix this

  • Save participation should be re-entrant - that's likely a bigger task for recovery (fyi @bpasero)
  • The code action save participant should apply any workspace edit with the "ignore auto save"-flag (which already exists)
  • We can revert the commit that introduced this (tho, that was done for a reason...)

@abdnafees
Copy link

I am still experiencing this problem for python files. What is the resolution?

Version: 1.73.0
Commit: 8fa188b
Date: 2022-11-01T15:38:50.881Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 21.6.0
Sandboxed: No

@jrieken
Copy link
Member

jrieken commented Nov 9, 2022

This will ship with 1.73.1

@WheelyWonka
Copy link

Thank you very much for the speeeeeedy action 🚀

kyoshino added a commit to videomark/videomark.webdino.org that referenced this issue Nov 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release
Projects
None yet
Development

No branches or pull requests