Skip to content

LSP experiments - #20

Draft
ggodlewski wants to merge 34 commits into
mainfrom
lsp-experiments
Draft

LSP experiments#20
ggodlewski wants to merge 34 commits into
mainfrom
lsp-experiments

Conversation

@ggodlewski

Copy link
Copy Markdown
Collaborator

No description provided.

@ggodlewski
ggodlewski marked this pull request as draft October 11, 2025 13:43
- Add Content-Length header support for standard LSP protocol
- Implement "awesome mode" detection for headerless JSON-RPC
- Add message buffering to handle fragmented WebSocket frames
- Fix LSP handshake to send initialize on connection
- Add isInitialized state tracking separate from connection
- Display LSP server messages as toast notifications in editor UI
- Support both Blob and ArrayBuffer WebSocket message types
- Default to standard mode, auto-detect and switch to awesome mode

Transport layer now properly handles both LSP protocol modes:
standard (with Content-Length headers) and "awesome" (raw JSON).
Client starts in standard mode to ensure handshake succeeds, then
adapts to server preference based on first response format.

UI enhancements include color-coded toast notifications for LSP
window/logMessage events with auto-fade after 3 seconds.
…sions

When joining a YJS collaborative room from a new browser, ensure didOpen
is sent with the actual synchronized document content instead of empty text.

Changes:
- Wait for content to arrive before opening LSP file
- Check content length on 'changed' events
- Add 1-second timeout fallback for edge cases
- Prevent duplicate initialize requests when already connected

This ensures LSP features (diagnostics, completions) work correctly when
joining existing collaborative sessions.
@horner

horner commented Nov 18, 2025

Copy link
Copy Markdown
Member

@ggodlewski work with Drew to get back on my calendar. I fixed it. Also you can run against https://lsp-toy.opensource.mieweb.org in the demo. It is running and will detect websocket and work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants