prevented organizeImports appending an extra new line to declarations when end of a file #58986
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
relates #48126
A visual of what this PR fixes:
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.