Skip to content

Fix organize imports#874

Merged
machty merged 4 commits intomainfrom
fix-organize-imports
Apr 1, 2025
Merged

Fix organize imports#874
machty merged 4 commits intomainfrom
fix-organize-imports

Conversation

@machty
Copy link
Copy Markdown
Contributor

@machty machty commented Apr 1, 2025

The hacks we were using to trick TS into considering .gts/.gjs to be valid implicit extensions (when omitted from import module specifiers) were causing issues with Organize Imports, due to the fact that the hacky fake imports were detected as "unused" and hence removed by Organize Imports in a manner that caused havok when the changes were reverse-source-mapped by Volar.

After some tinkering I landed on a solution that uses await import() which doesn't seem to get touched by Organize Imports.

Closes #867

Copy link
Copy Markdown
Contributor

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems ok

@machty machty merged commit 90f1ddd into main Apr 1, 2025
2 checks passed
@machty machty deleted the fix-organize-imports branch April 1, 2025 18:44
@github-actions github-actions Bot mentioned this pull request Apr 1, 2025
@NullVoxPopuli NullVoxPopuli added the enhancement New feature or request label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organize Imports removes all imports

2 participants