mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-03 06:00:49 +00:00
feat(cli): add experimental LSP support with --experimental-lsp flag
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
d075574030
commit
01a906d6ea
7 changed files with 39 additions and 20 deletions
|
|
@ -121,6 +121,7 @@ export interface CliArgs {
|
|||
acp: boolean | undefined;
|
||||
experimentalAcp: boolean | undefined;
|
||||
experimentalSkills: boolean | undefined;
|
||||
experimentalLsp: boolean | undefined;
|
||||
extensions: string[] | undefined;
|
||||
listExtensions: boolean | undefined;
|
||||
openaiLogging: boolean | undefined;
|
||||
|
|
@ -480,6 +481,12 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||
return settings.experimental?.skills ?? legacySkills ?? false;
|
||||
})(),
|
||||
})
|
||||
.option('experimental-lsp', {
|
||||
type: 'boolean',
|
||||
description:
|
||||
'Enable experimental LSP (Language Server Protocol) feature for code intelligence',
|
||||
default: false,
|
||||
})
|
||||
.option('channel', {
|
||||
type: 'string',
|
||||
choices: ['VSCode', 'ACP', 'SDK', 'CI'],
|
||||
|
|
@ -902,8 +909,8 @@ export async function loadCliConfig(
|
|||
|
||||
let mcpServers = mergeMcpServers(settings, activeExtensions);
|
||||
|
||||
// LSP configuration derived from settings; defaults to disabled for safety.
|
||||
const lspEnabled = settings.lsp?.enabled ?? false;
|
||||
// LSP configuration: enabled only via --experimental-lsp flag
|
||||
const lspEnabled = argv.experimentalLsp === true;
|
||||
const lspAllowed = settings.lsp?.allowed ?? settings.mcp?.allowed;
|
||||
const lspExcluded = settings.lsp?.excluded ?? settings.mcp?.excluded;
|
||||
const lspLanguageServers = settings.lsp?.languageServers;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ export const lspSettingsSchema: JSONSchema7 = {
|
|||
properties: {
|
||||
'lsp.enabled': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: '启用 LSP 语言服务器协议支持'
|
||||
default: false,
|
||||
description:
|
||||
'启用 LSP 语言服务器协议支持(实验性功能)。必须通过 --experimental-lsp 命令行参数显式开启。'
|
||||
},
|
||||
'lsp.allowed': {
|
||||
type: 'array',
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,7 @@ const SETTINGS_SCHEMA = {
|
|||
requiresRestart: true,
|
||||
default: {},
|
||||
description:
|
||||
'Settings for the native Language Server Protocol integration.',
|
||||
'Settings for the native Language Server Protocol integration. Enable with --experimental-lsp flag.',
|
||||
showInDialog: false,
|
||||
properties: {
|
||||
enabled: {
|
||||
|
|
@ -1049,7 +1049,7 @@ const SETTINGS_SCHEMA = {
|
|||
requiresRestart: true,
|
||||
default: false,
|
||||
description:
|
||||
'Enable the native LSP client to connect to language servers discovered in the workspace.',
|
||||
'Enable the native LSP client. Prefer using --experimental-lsp command line flag instead.',
|
||||
showInDialog: false,
|
||||
},
|
||||
allowed: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue