#22: Custom LSP integration for the Monaco editor (Python & QASM) - #156
Merged
Conversation
…nd prevent BeanCreationException
…anguages and language servers is a deployment decision not the responsibility of core.
…tore it on changes
- add global and per-user process limits - terminate LSP process trees reliably - clean up sessions on crashes and application shutdown - dispose LSP clients when leaving a project
Jooshua
reviewed
Jun 22, 2026
|
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
Adds full Language Server Protocol support to the monaco-react code editor from suren-atoyan.
Python and QASM files now get real IDE features (completion, hover,
diagnostics, ...) backed by embedded
pylsp/qasmlspbinaries, bridgedto the browser over WebSockets.
JsonRpcTransport,LSPClient,LSPClientManager) wires Monaco's language providers to these sessions,with debounced open/change/close lifecycle and reconnect handling.
CI updated accordingly.
Backend (
edu.kit.quak.*.lsp)core.lsp: domain model (LspLanguageId,LspServerDefinition,LspSessionId)application.lsp:LspSessionServiceorchestrates session lifecycle via ports (incoming ports:LspSessionServicePort; outgoing ports:LspSessionFactoryPort,LspSessionPort,LspServerRegistryPort,LspClientConnectionPort)infrastructure.lsp.out.process:ProcessLspSessionAdapter: one process per session, stdio JSON-RPC viaStdioJsonRpcBridge, isolated per-session workspace directory;DefaultLspServerRegistryinfrastructure.lsp.in.websocket:LspWebSocketHandlerroutes/lsp/{language}traffic to/from sessions;LspWebSocketExceptionHandler;WebSocketConfiginfrastructure.lsp.config:LspProperties(quak.lsp.*) andLspServerStartupValidator(logs whether each configured server binary is reachable on startup)Frontend
lsp/JsonRpcTransport.ts: WebSocket-based JSON-RPC transport with reconnect/idle handlinglsp/LSPClient.ts: per-language client; registers Monaco providers (completion, hover, diagnostics, ...) and manages document open/change/close with debounced change notificationslsp/LSPClientManager.ts: singleton managing oneLSPClientper language, tracks active documents per editor group, debounced hide/dispose, reconnect backoffhooks/editor/useLSPSetup.ts(new) and updates touseEditorModelManager.ts,useEditorLanguage.ts,QLPEditor.tsxwire the editor's model lifecycle into the LSP layerLifecycle & capacity management
quak.lsp.process.termination-timeout-ms(default 2000ms): Destroy/terminate lsp session - applied to the LSP process and any child processesquak.lsp.limits.max-processes(default 40) /max-processes-per-user(default 4): caps total and per-user concurrent LSP processes per backend instance (may be reset based on load tests and real world numbers)quak.lsp.websocket.session-idle-timeout-ms(default 15 min): idle WebSocket sessions are closed; the frontend automatically restores the connection on the next changeLanguages
pylsp(backend/lsp/servers/python)qasmlsp(backend/lsp/servers/qasm)backend/lsp/README.mdDeployment
backend/Dockerfilebuilds both language servers in dedicated stagesdocker-compose.dev.yaml/docker-compose.prod.yaml: production mounts an isolated tmp-filesystem for per-session workspacestest_and_build.yml) builds and bundles the LSP serversOut of scope / possible follow-ups