Repository navigation
Add experimental LSP support for code intelligence - #1401
Merged
Merged
Conversation
yiliang114
marked this pull request as draft
January 5, 2026 02:41
…eration fixes - Fix iteration over Map and Set collections by using Array.from() to avoid potential modification during iteration issues - Add proper type casting for test mocks to ensure type safety - Add null checks and type guards for LSP reference and symbol processing - Improve type annotations for LSP server status and configuration objects - Update path validation to use workspace root instead of config.cwd These changes improve the robustness and type safety of the LSP service implementation.
- 创建统一的LSP工具,整合了之前的多个分散LSP工具 - 增加对更多LSP操作的支持,包括hover、documentSymbol、goToImplementation等 - 扩展LSP类型定义,支持Call Hierarchy等高级功能 - 更新配置和测试文件以适配新的LSP工具架构 - 保持向后兼容性,同时引入新工具名称映射 Co-authored-by: Qwen-Coder <[email protected]> 此更改是LSP工具重构计划的一部分,旨在提供更统一和功能完备的LSP集成体验。
Co-authored-by: Qwen-Coder <[email protected]>
…nfiguration loading mechanism - remove configuration options such as lsp.enabled, lsp.allowed, lsp.excluded, etc. from settings.json schema - Delete lspSettingsSchema.ts files and associated JSON schema definitions - Removed VS Code settings loading function, no longer merge. vscode/settings.json configuration - Updated LSP documentation to reflect new configurations and experimental flags -remove allow/exclude parameters in NativeLspService constructor - Create new LspConfigLoader classes to handle LSP configuration loading and merging - Updated debug guide to match the new configuration mechanism - Simplify loadCliConfig functions, remove startLsp options - Reconstruct the configuration loading process to remove duplicate configuration merge logic - Add LspConfigLoader classes to implement configuration parsing and merging functions
…rchitecture - Extract NativeLspClient from NativeLspService for better separation of concerns - Simplify LspConfigLoader by removing built-in configuration options - Remove LSP_DEBUGGING_GUIDE.md as it's no longer needed - Clean up unused LSP constants - Remove deprecated LSP configuration from config.ts
- Add comprehensive LSP tool guidance in the Tool Usage section - Document all LSP operations with their required parameters - Clarify that workspaceSymbol only requires query, not filePath/line/character - Emphasize using LSP directly instead of grep for code intelligence queries
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
yiliang114
marked this pull request as ready for review
January 25, 2026 16:04
yiliang114
requested review from
DennisYu07,
LaZzyMan,
Mingholy,
gwinthis,
pomelo-nwu and
tanzhenxin
as code owners
January 25, 2026 16:05
tanzhenxin
approved these changes
Jan 28, 2026
tanzhenxin
left a comment
Collaborator
There was a problem hiding this comment.
Great feature! Can't wait to try it out!
Contributor
|
Hello |
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
Add experimental LSP support for code intelligence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces native Language Server Protocol (LSP) support to Qwen Code, enabling advanced code intelligence features. The implementation allows the AI agent to understand code semantically rather than relying solely on text-based search.
Key Features
Unified LSP Tool: A single
lsptool supporting 12 operations:goToDefinition- Navigate to symbol definitionsfindReferences- Find all references to a symbolhover- Get type information and documentationdocumentSymbol- List all symbols in a fileworkspaceSymbol- Search symbols across the workspacegoToImplementation- Find interface/abstract method implementationsprepareCallHierarchy/incomingCalls/outgoingCalls- Analyze call relationshipsdiagnostics/workspaceDiagnostics- Get errors and warningscodeActions- Access quick fixes and refactoringsFlexible Configuration: Support for
.lsp.jsonconfiguration file compatible with Claude Code plugin formatAuto-detection: Automatic language server detection for common languages (TypeScript, Python, Go, Rust)
Architecture
Usage
Enable LSP with the experimental flag:
Create a
.lsp.jsonconfiguration file in your project root:{ "typescript-language-server": { "command": "typescript-language-server", "args": ["--stdio"], "languages": [ "typescript", "javascript", "typescriptreact", "javascriptreact" ], "transport": "stdio", "extensionToLanguage": { ".ts": "typescript", ".tsx": "typescriptreact", ".js": "javascript", ".jsx": "javascriptreact" } } }Example queries that will use LSP:
Configclass defined?"handleRequest"authenticate?"Test Plan
packages/core/src/tools/lsp.test.ts)packages/cli/src/services/lsp/NativeLspService.test.ts)packages/cli/src/services/lsp/NativeLspService.integration.test.ts)Documentation
docs/users/features/lsp.mddocs/users/configuration/settings.mdBreaking Changes
None. This is an opt-in experimental feature.
File Change Statistics
New Files
packages/core/src/tools/lsp.tspackages/core/src/tools/lsp.test.tspackages/core/src/lsp/types.tspackages/cli/src/services/lsp/NativeLspService.tspackages/cli/src/services/lsp/LspServerManager.tspackages/cli/src/services/lsp/LspResponseNormalizer.tspackages/cli/src/services/lsp/NativeLspService.integration.test.tspackages/cli/src/services/lsp/LspConfigLoader.tspackages/cli/src/services/lsp/LspConnectionFactory.tspackages/cli/src/services/lsp/NativeLspClient.tspackages/cli/src/services/lsp/LspLanguageDetector.tspackages/cli/src/services/lsp/LspTypes.tspackages/cli/src/services/lsp/NativeLspService.test.tspackages/cli/src/services/lsp/constants.tsdocs/users/features/lsp.mdModified Files
packages/core/src/core/prompts.tspackages/core/src/tools/tool-names.tspackages/core/src/config/config.tspackages/core/src/index.tspackages/cli/src/config/config.tspackages/cli/src/config/config.test.tsdocs/users/configuration/settings.md