Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 82 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,24 @@ GitHub Copilot CLI supports Language Server Protocol (LSP) for enhanced code int

### Installing Language Servers

Copilot CLI does not bundle LSP servers. You need to install them separately. For example, to set up TypeScript support:
Copilot CLI does not bundle LSP servers. You need to install them separately:

**TypeScript/JavaScript:**
```bash
npm install -g typescript-language-server
npm install -g typescript typescript-language-server
```

**Java** (requires JDK 17+):
```bash
# macOS (Homebrew)
brew install jdtls

# Or download from https://github.com/eclipse-jdtls/eclipse.jdt.ls
```

**Python:**
```bash
pip install python-lsp-server
```

For other languages, install the corresponding LSP server and configure it following the same pattern shown below.
Expand All @@ -159,7 +173,58 @@ Edit `~/.copilot/lsp-config.json`
**Repository-level configuration** (applies to specific project):
Create `.github/lsp.json` in your repository root

Example configuration:
#### TypeScript

```json
{
"lspServers": {
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"],
"fileExtensions": {
".ts": "typescript",
".tsx": "typescript"
}
}
}
}
```

#### Java

```json
{
"lspServers": {
"java": {
"command": "jdtls",
"args": [],
"fileExtensions": {
".java": "java"
}
}
}
}
```

#### Python

```json
{
"lspServers": {
"python": {
"command": "pylsp",
"args": [],
"fileExtensions": {
".py": "python"
}
}
}
}
```

#### Multiple languages

Combine configurations to support multiple languages in one file:

```json
{
Expand All @@ -171,6 +236,20 @@ Example configuration:
".ts": "typescript",
".tsx": "typescript"
}
},
"java": {
"command": "jdtls",
"args": ["-data", "/path/to/java-workspace"],
"fileExtensions": {
".java": "java"
}
},
"python": {
"command": "pylsp",
"args": [],
"fileExtensions": {
".py": "python"
}
}
}
}
Expand Down