Generic LSP Proxy for VS CodeA flexible Language Server Protocol (LSP) proxy extension for VS Code that dynamically forwards requests to any LSP server based on configuration files. No more installing separate extensions for each language! 🌟 Features
📦 InstallationFrom VS Code Marketplace
From Source
🚀 Quick Start1. Initialize ConfigurationOption A: Use the Init Command (Recommended)
Option B: Create Manually
2. Install Language Server
3. Open a FileOpen any file matching your configured extensions. The LSP will start automatically! 📋 ConfigurationConfiguration File LocationsFor every workspace folder the extension loads, in order:
It then always also loads a global config file shared across all open folders:
|
| Setting | Type | Default | Description |
|---|---|---|---|
genericLspProxy.configPath |
string | .vscode/lsp-proxy.json |
Path to configuration file. Workspace-scoped values must stay inside the folder; user/profile-scoped values may be absolute. See configPath scope and trust. |
genericLspProxy.enableDebugLogging |
boolean | false |
Enable detailed logging |
📟 Commands
Access commands via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
- LSP Proxy: Initialize LSP Configuration - Create a new LSP configuration with guided setup
- LSP Proxy: Restart LSP Server - Restart the server for the current file
- LSP Proxy: Show Active LSP Servers - Display and manage running servers
- LSP Proxy: Reload LSP Configuration - Reload config and restart servers
- LSP Proxy: Show Disabled Servers - View and re-enable servers that failed to start
🔧 Development
This project uses Task for development workflows.
Prerequisites
# Install Task
brew install go-task/tap/go-task # macOS
# or see https://taskfile.dev/installation/
# Install dependencies
task install
Common Tasks
task # Show all available tasks
task dev # Start development mode
task test # Run all tests
task lint # Run linter
task build # Build the extension
task package # Create VSIX file
Project Structure
vscode-generic-lsp-proxy/
├── src/
│ ├── extension.ts # Extension entry point
│ ├── lspProxyManager.ts # LSP client lifecycle management
│ ├── configurationManager.ts # Configuration loading and validation
│ ├── logger.ts # Logging utilities
│ └── test/ # Test suites
├── examples/ # Example configurations
├── package.json # Extension manifest
├── Taskfile.yml # Task runner configuration
└── README.md # This file
Testing
# Run all tests
task test
# Run with coverage
task test:coverage
# Run specific test suite
npm test -- --grep "ConfigurationManager"
Code Quality
# Run all checks
task check
# Auto-fix issues
task fix
# Format code
task format
🐛 Troubleshooting
Server Not Starting
Check Output Panel: View → Output → "Generic LSP Proxy"
Verify Installation:
which <command>should return the pathTest Manually: Run
<command> --versionin terminalCheck Configuration: Ensure JSON is valid and paths are correct
Use the server entry point, not the CLI: many packages ship a command-line checker and a language server under different names. The checker runs once, prints a report and exits — it never speaks LSP. Examples:
Package CLI (wrong) Language server (right) pyrightpyrightpyright-langserver --stdiobasedpyrightbasedpyrightbasedpyright-langserver --stdioruffruff checkruff servertypescript-language-servertsctypescript-language-server --stdioPass
--stdioyourself:argsare handed to the server verbatim (nothing is injected), so a server that needs a--stdioflag must list it inargs.
A server that exits during the handshake is not restarted; the output panel shows
exited before finishing initialization together with whatever the process printed to stderr.
Fix the command/args, then run LSP Proxy: Reload LSP Configuration (or reopen the file).
Windows
Servers installed with npm install -g are .cmd shims. The extension spawns through the shell, so
the bare name (basedpyright-langserver) resolves via PATH; if you use an absolute path instead,
escape backslashes in JSON ("C:\\Users\\me\\AppData\\Roaming\\npm\\basedpyright-langserver").
No IntelliSense/Completions
- File Extension: Verify file extension matches configuration
- Language Server Features: Not all servers support all features
- Initialization: Check
initializationOptionsin config - Debug Logging: Enable in settings to see LSP communication
Performance Issues
- Reduce File Watchers: Limit
filePatternsscope - Server Performance: Some servers are resource-intensive
- Check Output: Look for errors in the output panel
Common Error Messages
| Error | Solution |
|---|---|
| "Command not found" | Install the language server or check PATH |
| "Connection refused" | For TCP, ensure server is running on specified port |
| "Invalid configuration" | Check JSON syntax and required fields |
| "Server stopped" | Check server logs and restart manually |
| "exited before finishing initialization" / "Pending response rejected since connection got disposed" / "Server process exited with code 1" | The process died during the LSP handshake. Almost always the wrong binary (a CLI checker such as basedpyright instead of basedpyright-langserver) or a missing --stdio in args — see Server Not Starting. |
| "Invalid configPath … escapes workspace folder" | A workspace-scoped configPath must stay inside the folder. To use an absolute path, set genericLspProxy.configPath in your User settings instead of workspace settings — see configPath scope and trust. |
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run checks:
task ready - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
Development Guidelines
- Write tests for new features
- Follow existing code style
- Update documentation
- Add example configurations
- Run
task checkbefore committing
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with vscode-languageclient
- Inspired by the need for a unified LSP experience
- Thanks to all contributors and users
🔗 Links
Made with ❤️ for the VS Code community