-
Notifications
You must be signed in to change notification settings - Fork 12.8k
source.organizeImports must not remove empty line between import #24324
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
Comments
looks like a duplicate of #22914 |
I believe #22914 tracks removing the newlines while this issue is about preserving the newlines and the import groups they define |
ah. sorry misread the issue. thanks. I do not think this is something we can easily accomplish, since the imports themselves move, and some even are completely removed with their contents merged into other imports; it is not clear how we can figure out what is a group and what is not in the midst of these transformations. |
Agreed. Given the work required, unless there are many users requesting this, this kind of more advanced sorting seems like a better fit for an extension |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
I have to disable |
No solution? |
We'd like to keep some packages on top of all imports and keep the rest are organised. For instance, "source-map-support/register", datadog tracer, etc must be stick to the top. But it is not possible with The issue is 6 year old, so I'm quite surprised there is no solution so far 😞 Am i missed something? 🤔 |
From @nikolay-borzov on May 22, 2018 12:37
Usually imports are organized in groups separated by empty line (e.g. node packages, services, components). I think that
organizeImports
should respect existing groups and perform organizing within each group.Steps to Reproduce:
.ts
filePress
Ctrl+S
Result:
Does this issue occur when all extensions are disabled?: Yes (Disabled TSLint and Prettier)
Copied from original issue: microsoft/vscode#50277
The text was updated successfully, but these errors were encountered: