-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
organizeImports needs to be called twice to be stable #57030
Comments
I've investigated, and this behavior existed pre-5.3, and seems to be because
to your editor settings |
For me using it even twice does not usually fix the issue where VS code sometimes starts to using case insensitive sorting. I had to set typescript to version 4.9.5 to get stable sort. With that version this problem does not occur. So eagerly waiting for fix for this before I need to update Typescript version in my project. |
@rubiesonthesky could you provide some more details about the cases you experience this on? I would like to make sure the issues are fixed with #57267 |
@iisaduan I will try to check if I can replicate it and have some minimal reproduction. |
@rubiesonthesky If you've been unable to get a minimal repro, can you test this version in your repository? #57267 (comment) |
@iisaduan My biggest problem is usually imports like these which I would like to sort case in-sensitive way. It seems that I have lost the correct config for that, because it was not needed with TS 4.9.5. I'll try to dig it up and test later. import {BehaviorSubject, Observable, forkJoin, of} from 'rxjs'; Found the config... Will test drive it few days to see if the problem is still there. "typescript.unstable": {
"organizeImportsIgnoreCase": true,
}, |
@rubiesonthesky To clarify, is that config the setting you already had? And how are you invoking
(also, with this case in particular, it is already sorted in a case-sensitive way so Thank you for testing! |
π Search Terms
organizeImports
π Version & Regression Information
β― Playground Link
No response
π» Code
π Actual behavior
This needs to be organized twice in order to be stable. The first time we get
import {I, M, R} from 'a';
import {abc, Abc} from 'b';
and the second time we get
import {I, M, R} from 'a';
import {Abc, abc} from 'b';
π Expected behavior
I'd expect
import {I, M, R} from 'a';
import {Abc, abc} from 'b';
the first time around
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: