Configurable LSP `workspace/configuration` and `didChangeConfiguration` Support in Copilot CLI
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### Describe the feature or problem you'd like to solve
Add support for configuring arbitrary Language Server Protocol (LSP) configuration payloads in Copilot CLI.
### Proposed solution
Currently, Copilot CLI can launch LSP servers, but there is no way to control what is sent through the following LSP methods:
* `workspace/didChangeConfiguration`
* `workspace/configuration`
This makes many language servers partially unusable because critical settings cannot be provided to the server.
## Problem
Many LSP servers rely heavily on runtime configuration delivered through LSP configuration requests instead of command-line arguments or environment variables.
For example, `intelephense` requires configuration for:
* excluded file patterns
* storage/indexing behavior
* diagnostics
* stubs
* file size limits
Without support for configuration payloads:
* large monorepos become slow or unusable
* excluded/vendor/generated files cannot be filtered
* indexing behavior cannot be tuned
* workspace-specific settings cannot be applied
At the moment, Copilot CLI appears to start the server successfully but provides no mechanism for forwarding user-defined configuration objects to the LSP server. The option `initializationOptions` does not solve this problem either because many LSP servers - including Intelephense - expect runtime settings to be delivered specifically through the standard LSP configuration flow (`workspace/didChangeConfiguration` and `workspace/configuration`).
## Proposed Solution
Allow arbitrary configuration blocks to be defined per language server and forwarded via:
* `workspace/didChangeConfiguration`
* responses to `workspace/configuration`
Example configuration:
```json
{
"php": {
"command": "intelephense",
"args": [
"--stdio"
],
"fileExtensions": {
".php": "php"
},
"configuration": {
"intelephense": {
"files": {
"exclude": [
"**/vendor/**",
"**/var/cache/**",
"**/node_modules/**"
]
},
"environment": {
"phpVersion": "8.5"
},
"diagnostics": {
"undefinedTypes": false
}
}
}
}
}
```
## Expected Behavior
Copilot CLI should:
1. Send the provided configuration object through `workspace/didChangeConfiguration`
2. Respond to `workspace/configuration` requests using the configured values
3. Support arbitrary nested JSON structures
### Example prompts or workflows
_No response_
### Additional context
_No response_
贡献指南
调研方向
该 issue 将 LSP 方法 workspace/didChangeConfiguration 和 workspace/configuration 确定为相关入口点;首先跟踪 Copilot CLI 如何启动 LSP 服务器并路由这些消息。完成的标准是每个语言服务器都能通过这两种方法接收任意嵌套的配置,包括示例中的 Intelephense 设置。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli, tooling
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100