github / github/copilot-cli

Configurable LSP `workspace/configuration` and `didChangeConfiguration` Support in Copilot CLI

Đang mở
#3,402 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:configuration area:tools
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue xác định các phương thức LSP workspace/didChangeConfiguration và workspace/configuration là các điểm vào liên quan; hãy bắt đầu bằng cách lần theo cách Copilot CLI khởi chạy các máy chủ LSP và định tuyến các thông báo này. Công việc được hoàn tất khi mỗi máy chủ ngôn ngữ có thể nhận cấu hình lồng nhau bất kỳ thông qua cả hai phương thức, bao gồm các thiết lập Intelephense trong ví dụ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli, tooling
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.