source.organizeImports should not remove imports if file contains errors. #43051
Labels
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
Bug Report
When a user has
source.organizeImports
enabled on save/blur, the imports are mistakenly removed if the file contains errors. It also happens file contains an unclosed block comment/*
(for example, when the file got saved in the middle of writing a comment).🔎 Search Terms
🕗 Version & Regression Information
[email protected]
VSCode:
⏯ Playground Link
source.organizeImports
in a playground.💻 Code
An example of a broken file. This example contains JSX, hover, the point here if the file IS broken, then we should not remove imports.
File:
test.ts
(NOTtest.tsx
)🙁 Actual behavior
🙂 Expected behavior
The text was updated successfully, but these errors were encountered: