Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>LSP for CopilotNew to Visual Studio Code? Get it now.
LSP for Copilot

LSP for Copilot

DJ Extensions

|
1 install
| (0) | Free
Exposes LSP semantic capabilities (go-to-definition, references, hover, symbols, call/type hierarchies) as Chat Tools for GitHub Copilot
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

LSP for Copilot

Give GitHub Copilot the same code-intelligence superpowers your editor already has.

LSP for Copilot bridges VS Code's Language Server Protocol engine with GitHub Copilot Chat, exposing 13 semantic code-navigation tools that Copilot can call on its own — or that you can invoke explicitly with #tool references.

Instead of relying on text search or guesswork, Copilot can now jump to definitions, trace call hierarchies, inspect types, find implementations, and more — using the same language servers that power your editor's Go to Definition, Find References, and hover tooltips.


✨ Why?

Out of the box, Copilot Chat reads files and searches text. That works — until it doesn't:

  • It guesses where a symbol is defined instead of knowing.
  • It can't trace call chains, type hierarchies, or implementations.
  • It misses inferred types, parameter names, and diagnostics the language server already computed.

This extension fixes all of that. Every tool wraps a real LSP request, so the answers are precise, up-to-date, and language-aware.


📦 Installation

From the VS Code Marketplace

Search for "LSP for Copilot" in the Extensions view (Ctrl+Shift+X) and click Install.

From a .vsix file

code --install-extension lsp-for-copilot-1.0.0.vsix

Requirements

  • VS Code ≥ 1.100.0
  • GitHub Copilot Chat extension installed and signed in
  • A language server for the language you're working in (e.g. TypeScript, Rust Analyzer, Pylance, clangd, etc.)

🛠️ Tools

The extension registers 13 Chat Tools that Copilot can use automatically, or that you can reference directly in chat with #toolName.

Navigation

Tool Chat ref Description
Go to Definition #definition Jump to where a symbol is defined
Go to Declaration #declaration Jump to the declared type contract (.d.ts, header file, etc.)
Go to Type Definition #typeDef Jump to where a variable's type is defined
Find Implementations #impl Find all implementations of an interface or abstract symbol

Search & Discovery

Tool Chat ref Description
Find References #references Find every usage of a symbol across the workspace
Document Symbols #symbols List all symbols (functions, classes, variables…) in a file
Workspace Symbols #wsSymbols Search for symbols by name across the entire project
Find Symbol by Name #findSym Locate a symbol by name, then optionally chain an LSP action

Inspection

Tool Chat ref Description
Hover Information #hover Get type signatures, docs, and parameter info
Inlay Hints #inlayHints Reveal inferred types, parameter labels, and return types
Diagnostics #diagnostics Get errors, warnings, and lint results for a file

Hierarchies

Tool Chat ref Description
Call Hierarchy #callHierarchy Show who calls a function (incoming) or what it calls (outgoing)
Type Hierarchy #typeHierarchy Show supertypes and subtypes of a class or interface

🚀 Usage

Automatic (just chat)

Copilot will discover and call these tools on its own when it needs code intelligence. Just ask naturally:

"Where is the DatabaseConnection class defined?"

"What calls the processPayment function?"

"Show me all implementations of the Logger interface."

"Are there any type errors in server.ts?"

Explicit #tool references

You can also force a specific tool by referencing it in chat:

#findSym Find the "handleRequest" function in src/server.ts and show its references

#symbols List everything in src/models/user.ts

#callHierarchy Who calls authenticate() in src/auth.ts?

#diagnostics Check src/index.ts for errors

The power tool: #findSym

#findSym is the most versatile tool — it resolves a symbol by name (no need to know exact line numbers), then chains any follow-up action:

#findSym symbolName="UserService" action="implementation"        → find all implementations
#findSym symbolName="fetchData"   action="references"            → find all call sites
#findSym symbolName="Config"      action="hover"                 → get type info & docs
#findSym symbolName="parse"       action="callHierarchy_incoming"→ who calls parse()?

🌐 Language Support

This extension works with any language that has a VS Code language server. That includes, but is not limited to:

Language Language Server
TypeScript / JavaScript Built-in TS server
Python Pylance / Pyright
Rust rust-analyzer
C / C++ clangd / C/C++ extension
Go gopls
Java Eclipse JDT.LS
C# OmniSharp / C# Dev Kit
And many more… Any LSP-compliant server

Note: The quality of results depends on the language server. Some servers support all LSP features; others support a subset.


🔧 Development

git clone https://github.com/your-org/lsp-for-copilot.git
cd lsp-for-copilot
npm install

Scripts

Script Description
npm run build Production build (minified, tree-shaken via esbuild)
npm run watch Dev build with file watching
npm run typecheck TypeScript type checking
npm run lint ESLint
npm run test Run integration tests
npm run package Package as .vsix

Debug

Press F5 in VS Code to launch the Extension Development Host with the extension loaded.

Architecture

src/
├── extension.ts          # Activation entry point — registers all 13 tools
├── types.ts              # Shared TypeScript interfaces
├── tools/
│   ├── index.ts          # Tool registration hub
│   ├── findSymbol.ts     # ⭐ Composite name→position→action tool
│   ├── goToDefinition.ts # LSP textDocument/definition
│   ├── findReferences.ts # LSP textDocument/references
│   ├── hover.ts          # LSP textDocument/hover
│   ├── declaration.ts    # LSP textDocument/declaration
│   ├── typeDefinition.ts # LSP textDocument/typeDefinition
│   ├── implementation.ts # LSP textDocument/implementation
│   ├── documentSymbols.ts# LSP textDocument/documentSymbol
│   ├── workspaceSymbols.ts# LSP workspace/symbol
│   ├── callHierarchy.ts  # LSP callHierarchy/*
│   ├── typeHierarchy.ts  # LSP typeHierarchy/*
│   ├── diagnostics.ts    # VS Code diagnostics collection
│   └── inlayHints.ts     # LSP textDocument/inlayHint
└── utils/
    └── lsp.ts            # Shared LSP helpers (retries, formatting, snippets)

📄 License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft