LSP library built on GLib. Designed for both editors and servers.
Design ideas:
- Hide JSON-RPC protocol as much as possible from the user
- protocol functions are fully typed
- protocol functions throw errors instead of explicitly sending error messages to client
- Fully asynchronous API
- Use GVariant serialization for data types with
to_variant()/from_variant()functions - Make C API ergonomic and limit memory requirements:
- Avoid GObject as much as possible
- Flatten LSP data structures where it makes sense to avoid excess pointer chasing
- No use of
libgee. Prefer built-in GLib data structures
Installed packages can be used directly with
dependency('lsp-glib-3.0'). For a subproject fallback, map the package to
the dependency matching the consumer language. C projects use:
[provide]
lsp-glib-3.0 = lsp_glib_depVala projects use:
[provide]
lsp-glib-3.0 = lsp_glib_vala_depThe Vala dependency also carries generated VAPIs required by transitive subprojects.
-
$/cancelRequest(server)
-
initialize -
initialized -
client/registerCapability -
client/unregisterCapability -
$/setTrace -
$/logTrace -
shutdown -
exit
-
textDocument/didOpen -
textDocument/didChange -
textDocument/willSave(client capability only) -
textDocument/willSaveWaitUntil -
textDocument/didSave -
textDocument/didClose -
textDocument/didRename
-
textDocument/completion -
completionItem/resolve -
textDocument/hover -
textDocument/signatureHelp -
textDocument/codeAction -
codeAction/resolve -
textDocument/publishDiagnostics -
textDocument/pullDiagnostics -
textDocument/declaration -
textDocument/definition -
textDocument/typeDefinition(capability field only) -
textDocument/implementation -
textDocument/references -
textDocument/documentHighlight -
textDocument/documentSymbol -
textDocument/codeLens -
codeLens/resolve -
textDocument/foldingRange -
textDocument/selectionRange -
textDocument/documentLink(types only) -
documentLink/resolve -
textDocument/documentColor -
textDocument/colorPresentation -
textDocument/formatting -
textDocument/rangeFormatting -
textDocument/onTypeFormatting(types only) -
textDocument/rename -
textDocument/prepareRename -
textDocument/semanticTokens -
textDocument/moniker -
textDocument/inlineValue -
textDocument/inlayHint -
inlayHint/resolve -
textDocument/prepareCallHierarchy -
callHierarchy/incomingCalls -
callHierarchy/outgoingCalls -
textDocument/prepareTypeHierarchy -
typeHierarchy/supertypes -
typeHierarchy/subtypes -
textDocument/linkedEditingRange
-
workspace/symbol -
workspace/executeCommand -
workspace/applyEdit -
workspace/didChangeConfiguration -
workspace/didChangeWatchedFiles -
workspace/didChangeWorkspaceFolders -
workspace/willCreateFiles -
workspace/didCreateFiles -
workspace/willRenameFiles -
workspace/didRenameFiles -
workspace/willDeleteFiles -
workspace/didDeleteFiles -
workspace/didChangeConfiguration -
workspace/textDocumentContent
-
window/showMessage -
window/showMessageRequest -
window/logMessage -
window/showDocument
-
telemetry/event
Install Uncrustify and enable the tracked Git hooks for this checkout:
git config core.hooksPath .githooksThe pre-commit hook checks staged Vala files against .uncrustify.cfg. It
reports files that need formatting without modifying the working tree or the
index. GitHub Actions runs the same check for Vala files changed by each pull
request.
The latest API documentation is published at vala-lang.github.io/lsp-glib, with separate references for GObject Introspection and Vala.
Build the same combined site locally with:
meson setup build
meson compile -C build pagesThe generated site is located in build/doc/pages.
Run all available tests with meson test -C build. Tests can also be run by
language:
meson test -C build --suite vala
meson test -C build --suite c
meson test -C build --suite python
meson test -C build --suite js