Skip to content

fix(lsp): don't provide organizeImports action when client provides it - #31530

Merged
nayeemrmn merged 1 commit into
denoland:mainfrom
nayeemrmn:lsp-client-provided-organize-imports
Dec 8, 2025
Merged

nayeemrmn merged 1 commit into
denoland:mainfrom
nayeemrmn:lsp-client-provided-organize-imports

Conversation

@nayeemrmn

@nayeemrmn nayeemrmn commented Dec 8, 2025 •

Copy link
Copy Markdown
Contributor

@coderabbitai

coderabbitai Bot commented Dec 8, 2025 •

Copy link
Copy Markdown

Walkthrough

This change introduces support for client-provided organize imports capability in the LSP implementation. A new configuration method detects whether a client supports organizing imports natively. The language server refactors its organize-imports logic to skip this operation when the client indicates it can handle imports itself, delegating the responsibility to the client. Corresponding test utilities are updated to enable this capability flag, and a new integration test validates the behavior when clients provide this functionality. The changes maintain backward compatibility by defaulting to the server's organize-imports when the capability is absent.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing organizeImports action provision when the client provides it.
Description check ✅ Passed The PR description directly addresses the changeset - it references a specific GitHub issue and links to related client-side work that the changes implement.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nayeemrmn
nayeemrmn merged commit 642f2a4 into denoland:main Dec 8, 2025
@nayeemrmn
nayeemrmn deleted the lsp-client-provided-organize-imports branch December 8, 2025 12:31
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.

Duplicate organizeImports actions

2 participants