feat: Implement multi-LSP session support with deterministic auto-selection#97
Open
steffen-heil-secforge wants to merge 1 commit intoisaacphi:mainfrom
Open
Conversation
…ection Add complete multi-LSP infrastructure enabling simultaneous management of multiple language servers in single session. Three operational modes: - Single-MCP: Single LSP via --workspace/--lsp flags (original behavior) - Unbounded: Dynamic LSP start/stop via config file, all tools available - Session: Pre-configured LSPs from session file, limited tools Key changes: LSP Management (lsp_manager.go): - StartLSP now accepts duringStartup parameter for deterministic selection - Auto-select single LSP only when starting at runtime (after startup skipped) - Auto-select cleared when selected LSP is stopped - Support multiple instances per language via nested map structure Configuration (config.go): - Replace fragile composite string keys with proper nested maps - map[string]map[string]LSPConfig (language -> workspace -> config) - Eliminates string parsing bugs, handles colons in workspace paths Session Management (session.go): - Save/load LSP configurations to JSON session files - LoadSession combines session file with config defaults - Properly handles failures without stopping other LSPs Language Tools (lsp_tools.go): - Extended tools accept optional id parameter for LSP selection - lsp_start, lsp_stop, lsp_select, lsp_list, lsp_languages - lsp_save, lsp_load for session persistence Configuration File (config.json): - Define default LSP commands and arguments for each language - Optional per-language environment variables Testing: - Comprehensive test coverage for all three modes - Config validation and session file serialization - Auto-select behavior verified across different scenarios Documentation (MULTI-LSP.md): - Usage examples for each mode - Configuration file format and fields - Tool descriptions and parameters - MCP client configuration examples This implementation maintains backward compatibility with single-LSP deployments while enabling advanced multi-LSP workflows for development environments that need simultaneous LSP instances across different languages/workspaces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement complete multi-LSP (Language Server Protocol) infrastructure enabling simultaneous management of multiple language servers in a single session.
Three operational modes:
--workspace/--lspflags (original behavior)lsp_listandlsp_selectKey Changes
Session Management (
session.go)LoadSessioncombines session file with config defaultsLanguage Tools (
lsp_tools.go)idparameter for LSP selectionlsp_start,lsp_stop,lsp_select,lsp_list,lsp_languageslsp_save,lsp_loadfor configuration persistenceConfiguration File (
config.json)Testing
Documentation (
MULTI-LSP.md)