Swiftpack.co - ChimeHQ/LanguageServerProtocol as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ChimeHQ.
ChimeHQ/LanguageServerProtocol 0.7.7
Swift library for working with Language Server Protocol (LSP)
⭐️ 29
🕓 4 days ago
iOS macOS watchOS tvOS linux macOS iOS
.package(url: "https://github.com/ChimeHQ/LanguageServerProtocol.git", from: "0.7.7")

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

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

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.

GitHub

link
Stars: 29
Last commit: 4 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v0.7.7
4 days ago
  • SemanticTokensClient API

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics