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

Typescript "Organize Imports" action inserts loads of blank lines in import statements #41417

Closed
DanTup opened this issue Nov 5, 2020 · 1 comment · Fixed by #42630
Closed
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@DanTup
Copy link

DanTup commented Nov 5, 2020

TS Template added by @mjbvz

TypeScript Version: 4.2.0-dev.20201103

Search Terms

  • organize imports
  • alias

When running TypeScript's "Organize Imports" action on this file from the LSP client:

https://github.com/microsoft/vscode-languageserver-node/blob/05fa3b55538acaa87647111d528d39ddbd86caa2/client/src/common/client.ts

It makes a mess of the file, inserting lots of blank lines in between each class:

Nov-05-2020 14-23-21

I've disabled all other extensions but it still occurs. It shows TS 4.0.3 in the status bar if that's important.

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 5, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Nov 5, 2020

Minimal repo using 4.2.0-dev.20201103:

vars.ts:

export const a = 1
export const b = 1
export const c = 1

index.ts

import {
    a, b as B,
    c,
    c as C, b
} from './vars'

console.log(a, B, b, c, C)

Organize imports in index.ts adds a blank line:

import {
    a, b as B,

    b, c,
    c as C
} from './vars'

console.log(a, B, b, c, C)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
5 participants