This is a Swift library for abstracting and interacting with language servers that implement the Language Server Protocol. It is built on top of the LanguageServerProtocol library.
dependencies: [
.package(url: "https://github.com/ChimeHQ/LanguageClient")
]
This class manages a locally-running LSP process.
let params = Process.ExecutionParameters(path: "/path/to/server-executable",
arguments: [],
environment: [])
let processServer = LocalProcessServer(executionParameters: params)
processServer.terminationHandler = { print("server exited") }
// and if you want to observe communications
processServer.logMessages = true
Setting correct environment variables could be critical for your server. Your program may not have the same environment as your shell. Capturing shell environment variables is tricky business. If you need help here, check out ProcessEnv.
Server
wrapper that provides automatic initialization.
Server
wrapper that provides both transparent server-side state restoration should the underlying process crash.
A protocol useful for translating between NSRange
and LSP's line-relative positioning system.
A utility class that uses FS events and glob patterns to handle DidChangeWatchedFiles
.
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.