Sync Lsp
Sync Lsp is a synchronous lsp implementation for language servers. These are the main features of this library:
-
Automation: Sync Lsp handles registration and unregistration aswell as capabilitie negotiations by itself. Ontop of that none of the lifecycle messages are exposed to users of this library.
-
Compatabilitie: Capabilitie handling is also done internally. This means that the user of this library does not have to worry about checking if a client supports a certain feature or not.
-
Error Handling: Almost all protocol related errors are proccessed internally. Therefore the api is very easy to use and does not require the user to implement their own error handling.
Example
use ;
use ;
// The state of the server, in this case it's empty,
// but it could be used to store information like
// syntax trees, diagnostics, etc.
;
// Configuring the server to use strings as the
// data attached to show message requests and
// using the default implementation for the rest
// by using a macro
Feature Flags
| Flag | Description |
|---|---|
mio |
The mio crate will be used to poll for messages and therefore enable request cancellation support. Without this flag the Connection::cancelled method is still available, but will always return false. |
dynamic-callbacks |
If this feature is disabled, there should be no calls to Server::on_* after Server::server is called, and the server's performance may improve. Note that this is mainly a performance feature and does not equate to the client's ability to register capabilities dynamically via the lsp. |