Skip to content

ChimeHQ/LanguageServerProtocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9293fd8 · Jan 11, 2023
Feb 19, 2022
Sep 27, 2022
Jan 11, 2023
Jan 11, 2023
Sep 27, 2022
Sep 6, 2022
Oct 22, 2021
Jan 11, 2023
Jan 11, 2023
Jan 8, 2023

Repository files navigation

Build Status License Platforms

LanguageServerProtocol

This is a Swift library for interacting with Language Server Protocol. It contains type definitions and utilities useful for both server- and client-side projects.

This project was derived from SwiftLSPClient. That library mixes both the underlying protocol handling with a client-level abstraction. It is no longer officially supported.

If you are looking for a way to interact with servers, you probably want to use the higher-level LanguageClient.

Typing Approach

Where possible, this library matches the LSP spec. However, there are some additional types present in this library that aren't in the spec. This is caused by the use of anonymous structures.

This library models these cases using nested structures and/or the TwoTypeOption and ThreeTypeOption types.

Integration

dependencies: [
    .package(url: "https://github.com/ChimeHQ/LanguageServerProtocol")
]

Extra Features

For the most part, this library strives to be a straightforward version of the spec in Swift. There are a few places, however, where it just makes sense to pull in some extra functionality.

  • Snippet: makes it easier to interpret the contents of completion results
  • SemanticTokensClient: helps to consume Semantic Token information

Supported Features

The LSP specification is large, and this library currently does not implement it all. The intention is to support the 3.x specification, but be as backwards-compatible as possible with pre-3.0 servers.

Message Supported
$/cancelRequest
$/logTrace
$/progress
$/setTrace
callHierarchy/incomingCalls
callHierarchy/outgoingCalls
client/registerCapability
client/unregisterCapability
codeAction/resolve -
codeLens/resolve
completionItem/resolve
documentLink/resolve
exit
initialize
initialized
inlayHint/resolve -
notebookDocument/didChange
notebookDocument/didClose
notebookDocument/didOpen
notebookDocument/didSave
server-defined
shutdown
telemetry/event
textDocument/codeAction
textDocument/codeLens
textDocument/colorPresentation
textDocument/completion
textDocument/declaration
textDocument/definition
textDocument/diagnostic
textDocument/didChange
textDocument/didClose
textDocument/didOpen
textDocument/didSave
textDocument/documentColor
textDocument/documentHighlight
textDocument/documentLink
textDocument/documentSymbol
textDocument/foldingRange
textDocument/formatting
textDocument/hover
textDocument/implementation
textDocument/inlayHint -
textDocument/inlineValue -
textDocument/linkedEditingRange -
textDocument/moniker -
textDocument/onTypeFormatting
textDocument/prepareCallHierarchy
textDocument/prepareRename
textDocument/prepareTypeHierarchy -
textDocument/publishDiagnostics
textDocument/rangeFormatting
textDocument/references
textDocument/rename
textDocument/selectionRange
textDocument/semanticTokens/full
textDocument/semanticTokens/full/delta
textDocument/semanticTokens/range
textDocument/signatureHelp
textDocument/typeDefinition
textDocument/willSave
textDocument/willSaveWaitUntil
typeHierarchy/subtypes -
typeHierarchy/supertypes -
window/logMessage
window/showDocument
window/showMessage
window/showMessageRequest
window/workDoneProgress/cancel
window/workDoneProgress/create
workspace/applyEdit
workspace/codeLens/refresh
workspace/configuration
workspace/diagnostic
workspace/diagnostic/refresh
workspace/didChangeConfiguration
workspace/didChangeWatchedFiles
workspace/didChangeWorkspaceFolders
workspace/didCreateFiles
workspace/didDeleteFiles
workspace/didRenameFiles
workspace/executeCommand
workspace/inlayHint/refresh -
workspace/inlineValue/refresh -
workspace/semanticTokens/refresh
workspace/symbol
workspace/willCreateFiles
workspace/willDeleteFiles
workspace/willRenameFiles
workspace/workspaceFolders
workspaceSymbol/resolve

Suggestions or Feedback

We'd love to hear from you! Get in touch via twitter, an issue, or a pull request.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.