ChimeHQ / Swiftlspclient
Licence: bsd-3-clause
A Swift library for interacting with Language Server Protocol implementations
Stars: ✭ 84
Programming Languages
swift
15916 projects
Labels
Projects that are alternatives of or similar to Swiftlspclient
Powershelleditorservices
A common platform for PowerShell development support in any editor or application!
Stars: ✭ 394 (+369.05%)
Mutual labels: language-server-protocol
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (+847.62%)
Mutual labels: language-server-protocol
Protocol Buffers Language Server
[WIP] Protocol Buffers Language Server
Stars: ✭ 44 (-47.62%)
Mutual labels: language-server-protocol
Typescript Language Server
TypeScript & JavaScript Language Server
Stars: ✭ 462 (+450%)
Mutual labels: language-server-protocol
Python Language Server
Microsoft Language Server for Python
Stars: ✭ 778 (+826.19%)
Mutual labels: language-server-protocol
Kakoune Languageclient
Small implementation of a language client for kakoune.
Stars: ✭ 9 (-89.29%)
Mutual labels: language-server-protocol
Pylance Release
Documentation and issues for Pylance
Stars: ✭ 782 (+830.95%)
Mutual labels: language-server-protocol
Php Language Server
PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
Stars: ✭ 1,019 (+1113.1%)
Mutual labels: language-server-protocol
Vim Lsc
A vim plugin for communicating with a language server
Stars: ✭ 545 (+548.81%)
Mutual labels: language-server-protocol
Spyder
Official repository for Spyder - The Scientific Python Development Environment
Stars: ✭ 6,712 (+7890.48%)
Mutual labels: language-server-protocol
Vscode Intelephense
PHP intellisense for Visual Studio Code
Stars: ✭ 872 (+938.1%)
Mutual labels: language-server-protocol
Monaco Languageclient
NPM module to connect Monaco editor with language servers
Stars: ✭ 419 (+398.81%)
Mutual labels: language-server-protocol
Rubberduck
Better code navigation on GitHub: Usages, Definitions and Files Tree on code pages and pull requests
Stars: ✭ 50 (-40.48%)
Mutual labels: language-server-protocol
Atom Languageclient
Language Server Protocol support for Atom (the basis of Atom-IDE)
Stars: ✭ 385 (+358.33%)
Mutual labels: language-server-protocol
Vista.vim
🌵 Viewer & Finder for LSP symbols and tags
Stars: ✭ 1,218 (+1350%)
Mutual labels: language-server-protocol
Glsl Language Server
Language server implementation for GLSL
Stars: ✭ 53 (-36.9%)
Mutual labels: language-server-protocol
Lsp
Client implementation of the Language Server Protocol for Sublime Text
Stars: ✭ 1,018 (+1111.9%)
Mutual labels: language-server-protocol
SwiftLSPClient
This is a Swift library for interacting with Language Server Protocol implementations.
An LSP server provides rich information about source code. An LSP client consumes this information. This library is all about the client side.
Example
import SwiftLSPClient
let executablePath = "path/to/your/lsp-server-executable"
let host = LanguageServerProcessHost(path: executablePath, arguments: [],
environment: [/* the environment your lsp server requires e.g. PATH */])
host.start { (server) in
guard let server = server else {
Swift.print("unable to launch server")
return
}
// Set-up notificationResponder to see log/error messages from LSP server
server.notificationResponder = <object conforming to NotificationResponder>
let processId = Int(ProcessInfo.processInfo.processIdentifier)
let capabilities = ClientCapabilities(workspace: nil, textDocument: nil, experimental: nil)
let params = InitializeParams(processId: processId,
rootPath: nil,
rootURI: nil,
initializationOptions: nil,
capabilities: capabilities,
trace: Tracing.off,
workspaceFolders: nil)
server.initialize(params: params, block: { (result) in
switch result {
case .failure(let error):
Swift.print("unable to initialize \(error)")
case .success(let value):
Swift.print("initialized \(value)")
}
})
}
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.
Feature | Supported |
---|---|
window/showMessage | ✅ |
window/showMessageRequest | ✅ |
window/logMessage | ✅ |
window/workDoneProgress/create | - |
window/workDoneProgress/cancel | - |
telemetry/event | - |
client/registerCapability | - |
client/unregisterCapability | - |
workspace/workspaceFolders | - |
workspace/didChangeWorkspaceFolders | - |
workspace/didChangeConfiguration | - |
workspace/configuration | - |
workspace/didChangeWatchedFiles | - |
workspace/symbol | - |
workspace/executeCommand | - |
workspace/applyEdit | - |
textDocument/didOpen | ✅ |
textDocument/didChange | ✅ |
textDocument/willSave | ✅ |
textDocument/willSaveWaitUntil | ✅ |
textDocument/didSave | ✅ |
textDocument/didClose | ✅ |
textDocument/publishDiagnostics | ✅ |
textDocument/completion | ✅ |
completionItem/resolve | - |
textDocument/hover | ✅ |
textDocument/signatureHelp | ✅ |
textDocument/declaration | ✅ |
textDocument/definition | ✅ |
textDocument/typeDefinition | ✅ |
textDocument/implementation | ✅ |
textDocument/references | ✅ |
textDocument/documentHighlight | - |
textDocument/documentSymbol | ✅ |
textDocument/codeAction | ✅ |
textDocument/codeLens | - |
codeLens/resolve | - |
textDocument/documentLink | - |
documentLink/resolve | - |
textDocument/documentColor | - |
textDocument/colorPresentation | - |
textDocument/formatting | ✅ |
textDocument/rangeFormatting | ✅ |
textDocument/onTypeFormatting | ✅ |
textDocument/rename | - |
textDocument/prepareRename | - |
textDocument/foldingRange | ✅ |
textDocument/selectionRange | - |
Integration
Swift Package Manager
dependencies: [
.package(url: "https://github.com/ChimeHQ/SwiftLSPClient.git")
]
Carthage
github "ChimeHQ/SwiftLSPClient"
CocoaPods
pod 'SwiftLSPClient'
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.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].