Skip to content

feat(lsp): Add support for source.organizeImports#31016

Merged
nayeemrmn merged 16 commits intodenoland:mainfrom
akimon658:feat/organize-imports
Oct 21, 2025
Merged

feat(lsp): Add support for source.organizeImports#31016
nayeemrmn merged 16 commits intodenoland:mainfrom
akimon658:feat/organize-imports

Conversation

@akimon658
Copy link
Copy Markdown
Contributor

The removal of unused imports is made conditional based on the presence of existing diagnostics (errors) in the file.
This approach is modeled after the behavior found in the typescript-language-server to prevent unwanted import removal when a file is in an unstable or error state.

Closes #30840

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 19, 2025

CLA assistant check
All committers have signed the CLA.

let mut client = context.new_lsp_command().build();
client.initialize_default();

let uri = "file:///a/file.ts";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use let file = temp_dir.source_file(), file.uri() etc.

See https://github.com/denoland/deno/pull/30989/files#diff-7727f0b2b730c9163774910ded5c83aaa587b4fe8531f9e8254e78384d245edf for an example

@akimon658 akimon658 requested a review from nayeemrmn October 21, 2025 05:41
Copy link
Copy Markdown
Contributor

@nayeemrmn nayeemrmn left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@nayeemrmn nayeemrmn merged commit 568e247 into denoland:main Oct 21, 2025
19 checks passed
@akimon658 akimon658 changed the title feat(lsp): Add support for source.oganizeImports feat(lsp): Add support for source.organizeImports Oct 21, 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.

LSP: Support organizeImports

3 participants