Skip to content

Conversation

@craig-jennings
Copy link
Contributor

This is more to get the ball rolling as I'm sure I missed something. This updates the organizeImports function to use the mode parameter rather than the deprecated skipDestructiveCodeActions one. It also adds a test to ensure that unused imports are removed while maintaining the order of the imports.

Fixes #2838

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

🦋 Changeset detected

Latest commit: 5ed0114

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-language-server Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@jasonlyu123 jasonlyu123 left a comment

Choose a reason for hiding this comment

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

We still need to register the source action kind in the LSP server capability here

codeActionKinds: [
CodeActionKind.QuickFix,
CodeActionKind.SourceOrganizeImports,
SORT_IMPORT_CODE_ACTION_KIND,
ADD_MISSING_IMPORTS_CODE_ACTION_KIND,

We also need a changeset for this. You can run pnpx @changesets/cli in the repo root and follow the prompt.

@jasonlyu123 jasonlyu123 merged commit 1e01c99 into sveltejs:master Oct 30, 2025
3 checks passed
@github-actions github-actions bot mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VSCode] Support source.removeUnusedImports option

2 participants