Skip to content

Repository files navigation

lsp-glib

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

Protocol Support

Base Protocol

  • $/cancelRequest (server)

Lifecycle Messages

  • initialize
  • initialized
  • client/registerCapability
  • client/unregisterCapability
  • $/setTrace
  • $/logTrace
  • shutdown
  • exit

Document Synchronization

  • textDocument/didOpen
  • textDocument/didChange
  • textDocument/willSave (client capability only)
  • textDocument/willSaveWaitUntil
  • textDocument/didSave
  • textDocument/didClose
  • textDocument/didRename

Language Features

  • textDocument/completion
  • completionItem/resolve
  • textDocument/hover
  • textDocument/signatureHelp
  • textDocument/codeAction
  • codeAction/resolve
  • textDocument/publishDiagnostics
  • textDocument/pullDiagnostics
  • textDocument/declaration (capability field only)
  • textDocument/definition (capability field only)
  • textDocument/typeDefinition (capability field only)
  • textDocument/implementation (capability field only)
  • textDocument/references (capability field only)
  • textDocument/documentHighlight (capability field only)
  • textDocument/documentSymbol (capability field only)
  • textDocument/codeLens (types only)
  • codeLens/resolve
  • textDocument/foldingRange
  • textDocument/selectionRange
  • textDocument/documentLink (types only)
  • documentLink/resolve
  • textDocument/documentColor
  • textDocument/colorPresentation
  • textDocument/formatting (capability field only)
  • textDocument/rangeFormatting (capability field only)
  • textDocument/onTypeFormatting (types only)
  • textDocument/rename (types only)
  • textDocument/prepareRename
  • textDocument/semanticTokens
  • textDocument/moniker
  • textDocument/inlineValue
  • textDocument/inlayHint
  • textDocument/prepareCallHierarchy
  • textDocument/prepareTypeHierarchy
  • textDocument/linkedEditingRange

Workspace Features

  • workspace/symbol (capability field only)
  • 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 Features

  • window/showMessage
  • window/showMessageRequest
  • window/logMessage
  • window/showDocument

Telemetry

  • telemetry/event

Workflow

Install Uncrustify and enable the tracked Git hooks for this checkout:

git config core.hooksPath .githooks

The 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.

Docs

Run meson build && meson compile -C build. Docs will be located in build/src/Lsp-3.0.

Tests

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

About

LSP library built on GLib (WIP)

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages