lsps
lsps copied to clipboard
Use Language Servers with in-browser editors. Monorepo of editor agnostic packages and CodeMirror client.
LSPs
Monorepo of packages related to LSP.
Packages
@qualified/vscode-jsonrpc-ws- Create VSCode JSON RPC
MessageConnectionover WebSocket
- Create VSCode JSON RPC
@qualified/vscode-jsonrpc-ww- Create VSCode JSON RPC
MessageConnectionto Web Worker
- Create VSCode JSON RPC
@qualified/lsp-connection- VSCode JSON RPC
MessageConnectionwrapper for LSP messages
- VSCode JSON RPC
@qualified/codemirror-workspace- Provides intelligence to CodeMirror editors
Demo
Example with Rust Analyzer:

The styling definitely needs work, but the above shows:
- Realtime diagnostics
- Completion with items from the server
- Fuzzy matching (e.g.,
prltoprintln!) - Completion items with Markdown docs
- Completion items with icons for each kind
- Hover information with Markdown docs
Simple snippets are supported as well:

See examples/rust-analyzer to run this locally.
See examples/rust-analyzer-sync to run this locally with an ability to save the changes to disk.
See examples/web-worker for an example with simple JSON Language Server running in Web Worker. A live demo is also available at https://qualified.github.io/lsps/.
See examples/html-css-ts for a simple demo project with TypeScript + CSS + HTML editors.
Tools
lsp-ws-proxy: WebSocketify any Language Server.lsp-ws-proxy -- langserver --stdio
Capabilities
Text Document
synchronizationdidOpendidChange- Full text change
- Incremental text change
- Full text change
willSavewillSaveWaitUntildidSavedidClose
completioninsertTextadditionalTextEditstextEditInsertTextFormat.Snippetdocumentationcommandtags
hoversignatureHelp- Goto
declarationdefinitiontypeDefinitionimplementation
referencesdocumentHighlightdocumentSymbolcodeActioncodeLensdocumentLinkcolorProvider- Formatting
formattingrangeFormattingonTypeFormatting
renamefoldingRangeselectionRangepublishDiagnosticscallHierarchy
Workspace
applyEditworkspaceEditdidChangeConfigurationdidChangeWatchedFilessymbolexecuteCommand
Window
workDoneProgress
License
MIT