LSP Configuration for GitHub Copilot CLI
This repository is configured with Language Server Protocol (LSP) servers for TypeScript, Python, Go, and C#. These servers provide GitHub Copilot CLI with precise code intelligence, enabling accurate code navigation and refactoring across your projects.
What are LSP Servers?
LSP servers provide language-specific features such as:
- Go to Definition: Jump to where a symbol is defined
- Find References: Locate all uses of a symbol
- Rename: Safely rename symbols across your entire project
- Hover Information: See type information and documentation
- Document Symbols: List all symbols in a file
- Workspace Search: Search for symbols by name
These capabilities allow Copilot skills to work with code more accurately and safely.
Configuration
The repository includes a project-level LSP configuration file: .github/lsp.json
This configuration defines LSP servers for the following languages:
TypeScript / JavaScript
{
"name": "typescript",
"languages": ["typescript", "javascript", "typescriptreact", "javascriptreact"],
"command": "node",
"args": ["--require", "typescript-language-server/lib/cli", "--stdio"]
}Python
{
"name": "python",
"languages": ["python"],
"command": "pylsp"
}Go
{
"name": "go",
"languages": ["go"],
"command": "gopls"
}C#
{
"name": "csharp",
"languages": ["csharp"],
"command": "omnisharp",
"args": ["-lsp"]
}How Copilot CLI Loads LSP Servers
When you start a Copilot CLI session, servers are loaded with this priority:
- Project Config (
.github/lsp.json) — highest priority - Plugin Configs — from installed Copilot plugins
- User Config (
~/.copilot/lsp-config.json) — lowest priority
This repository's .github/lsp.json takes precedence, ensuring all contributors use the same configuration.
Installation
To enable LSP features, install the language servers for the languages you use:
TypeScript / JavaScript
npm install -g typescript-language-server typescriptPython
pip install python-lsp-server
# or for Pyright:
pip install pyrightGo
go install github.com/golang/tools/gopls@latestC#
Download from OmniSharp releases
Automatic Startup
Once installed, LSP servers are automatically started by Copilot CLI when you:
- Use a skill in a project with the relevant language
- Trust the project directory
No additional configuration or commands are needed.
Benefits for Skills
LSP servers enhance Copilot skills by:
- Accuracy: Operations use the language's compiler/analyzer, not text matching
- Token Efficiency: Structured results are compact instead of requiring full file reads
- Safe Refactoring: Reliable renaming and code modifications across the entire project
- Speed: Background indexing provides near-instant responses
Example Use Cases
When you run an Angular skill in a TypeScript project:
- Copilot can accurately find component definitions
- Type information helps with precise code generation
- Refactoring suggestions are based on actual type analysis
When you run a Python skill:
- Go-to-definition works accurately even with complex imports
- Copilot understands the actual type information
- Renaming operations update all references reliably
Verification
To verify LSP servers are installed:
# TypeScript
typescript-language-server --version
# Python
pylsp --version
# Go
gopls version
# C#
omnisharp --helpTo check if Copilot CLI recognizes them, run inside the repository:
# List loaded LSP servers
copilot /contextTroubleshooting
LSP Server Not Starting
- Verify installation: Run the verification commands above
- Check PATH: Ensure the server is in your PATH
- Check logs: Look in
~/.copilot/logs/for error messages - Restart CLI: Sometimes restarting Copilot CLI helps
Server Command Not Found
If Copilot CLI says a server command is not found:
- Install the server (see Installation section above)
- Restart your terminal
- Restart Copilot CLI
Configuration Issues
To reload LSP configuration:
# Clear LSP cache and reindex
copilot /chronicle reindexSee Also
- Prerequisites — System requirements and setup
- GitHub Copilot CLI LSP Documentation
- Language Server Protocol