TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

prevented organizeImports appending an extra new line to declarations when end of a file

Open pflannery opened this issue 1 year ago • 3 comments

relates #48126

A visual of what this PR fixes:

organizeImportBug

I've updated existing tests that were forced to add an extra line due to this bug and added three new harness fourslash tests. The new organizeImports 24-26 tests in this PR prove that no extra EOLs are being appended by the server.

There is still one additional issue left after this fix is applied. It occurs when having an EOL after an export declaration and executing the organizeImport command in vscode causes another EOL to be appended. (double EOL as visualized in #48126)

I couldn't recreate this additional issue using the harness fourslash test engine. I can only recreate the double blank EOL when attaching to a vscode instance so my guess is that there is a bug in the vscode extension which is appending these other extra EOLs.

pflannery avatar Jun 24 '24 01:06 pflannery