Linggen VS Code Extension
Overview
This VS Code extension integrates Linggen into your editor so you can:
- Visualize your codebase as a graph
- Jump from VS Code into Linggen for deeper architecture exploration
- Wire Linggen into Cursor via
msp.json
- Start and control the local Linggen backend from inside VS Code
Current Features
Commands
The extension exposes these core commands in the VS Code Command Palette:
Additional Ideas for This Extension
These are potential / planned capabilities that fit naturally into this extension:
Per-file "Architecture Lens"
- Side panel showing, for the active file:
- Incoming and outgoing dependencies.
- Linked design notes and specs from Linggen.
- Known "owners" or responsible components.
Neighborhood navigation
- Commands to:
- "Show dependency neighborhood in Linggen" for the current file.
- "Show what might break if I edit this file" based on the graph.
Design doc integration
- Quick links to:
- Open the design note / spec for the current file or component in Linggen.
- Create a new design note that is auto-linked to the active file.
Indexing and health controls
- Commands to:
- Trigger a re-index of the current workspace in Linggen.
- Show indexing status (in progress, complete, last updated).
LLM workflow helpers
- From VS Code, generate an LLM-ready brief for the current task:
- "Generate implementation brief in Linggen for this file/folder."
- "Open spec + graph context in Linggen, then copy a ready-to-use prompt into the clipboard."
LSP-enhanced graph updates
- When you right–click "Open in Linggen" on a file or symbol, the extension can:
- Query the language server (LSP) for definitions, references, symbols, etc.
- Send these dynamic edges to Linggen to augment the static Tree-sitter graph for that view.
- The Linggen graph can then show both:
- Static edges (from static analysis / indexing).
- Dynamic LSP edges (session-specific overlays), visually distinguished in the UI.
Multi-root workspace support
- Map each folder in a VS Code multi-root workspace to the appropriate Linggen source.
- Quickly switch which source / subproject Linggen is showing.
Getting Started
Installation
- Install the extension in VS Code (from VSIX or marketplace when published)
- Install Linggen by running the command
Linggen: Install Linggen from the Command Palette (Cmd/Ctrl+Shift+P)
- Start Linggen using
Linggen: Start Linggen command
- Index your project with
Linggen: Index Current Project
Configuration
The extension can be configured via VS Code settings (Preferences: Open Settings (JSON)):
{
"linggen.backend.mode": "http", // "cli" or "http"
"linggen.backend.cliPath": "linggen", // Path to Linggen binary
"linggen.backend.httpUrl": "http://localhost:8787", // Linggen server URL
"linggen.backend.mcpUrl": "http://localhost:8787/mcp/sse", // Linggen MCP SSE endpoint
"linggen.installUrl": "https://linggen.dev" // Installation page URL
}
Note: Both the main API and MCP endpoints run on port 8787.
Usage
- Start Linggen: The extension will automatically start Linggen when needed, or you can run
Linggen: Start Linggen from the Command Palette
- Index your project: Run
Linggen: Index Current Project to build the dependency graph (auto-starts Linggen if not running)
- Open files in Linggen: Right-click any file or folder in the Explorer and select
Linggen: Open in Linggen (auto-starts Linggen if not running)
- Configure Cursor integration: Run
Linggen: Configure Cursor msp.json to automatically create the configuration file
Cursor Integration
To integrate Linggen with Cursor:
- Run
Linggen: Configure Cursor mcp.json command
- The extension will automatically create or update
.cursor/mcp.json in your workspace
- Restart Cursor to apply the changes
The command will:
- Create
.cursor/mcp.json if it doesn't exist
- Update the existing file if it already exists (preserving other MCP servers)
- Add the Linggen MCP server configuration
Example mcp.json configuration that will be created:
{
"mcpServers": {
"linggen": {
"url": "http://localhost:8787/mcp/sse"
}
}
}
Note: The MCP endpoint uses Server-Sent Events (SSE) and runs on port 8787 by default. If your Linggen MCP server runs on a different port, update the linggen.backend.mcpUrl setting before running the configure command.
Development
Building from source
npm install
npm run compile
Running the extension
- Open this folder in VS Code
- Press F5 to open a new window with the extension loaded
- Run commands from the Command Palette
Testing
npm test
Architecture
- Extension layer: TypeScript VS Code extension using the
vscode API
- Backend communication: Communicates with Linggen via CLI commands or HTTP API (configurable)
- Commands: All commands are registered in
package.json and implemented in src/extension.ts
- Logging: Dedicated "Linggen" output channel for debugging and status messages
License
MIT