Expand description
§styx-lsp-ext
Protocol types for Styx LSP extensions. Defines the RPC interface between the language server and editor extensions.
§Sponsors
Thanks to all individual sponsors:
…along with corporate sponsors:
…without whom this work could not exist.
§License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option. Protocol types for Styx LSP extensions.
This crate defines the Roam service traits and types used for communication between the Styx LSP and external extensions that provide domain-specific intelligence (completions, hover, diagnostics, etc.).
§Architecture
┌─────────────┐ ┌─────────────────┐
│ Styx LSP │◄────── Roam ────────►│ Extension │
│ │ │ (e.g. dibs) │
│ implements │ │ implements │
│ StyxLspHost │ │ StyxLspExtension│
└─────────────┘ └─────────────────┘The LSP calls methods on StyxLspExtension to request completions, hover, etc.
The extension can call back to StyxLspHost to request additional context.
§Generated Types
The #[roam::service] macro generates:
StyxLspExtensionClient- Call extension methods from the LSPStyxLspExtensionDispatcher- Dispatch incoming calls on the extension sideStyxLspHostClient- Call LSP methods from the extensionStyxLspHostDispatcher- Dispatch incoming calls on the LSP side
Re-exports§
pub use roam;
Modules§
- styx_
lsp_ extension_ method_ id - Method IDs for the service (computed lazily at runtime).
- styx_
lsp_ host_ method_ id - Method IDs for the service (computed lazily at runtime).
Structs§
- Code
Action - A code action (quick fix, refactoring, etc.).
- Code
Action Params - Parameters for a code actions request.
- Completion
Item - A completion item.
- Completion
Params - Parameters for a completion request.
- Cursor
- Cursor position with both line/character and byte offset.
- Definition
Params - Parameters for a go-to-definition request.
- Diagnostic
- A diagnostic (error, warning, etc.).
- Diagnostic
Params - Parameters for a diagnostics request.
- Document
Edit - Edits to a single document.
- GetDocument
Params - Parameters for get_document.
- GetSchema
Params - Parameters for get_schema.
- GetSource
Params - Parameters for get_source.
- GetSubtree
Params - Parameters for get_subtree.
- Hover
Params - Parameters for a hover request.
- Hover
Result - Result of a hover request.
- Initialize
Params - Parameters for extension initialization.
- Initialize
Result - Result of extension initialization.
- Inlay
Hint - An inlay hint.
- Inlay
Hint Params - Parameters for an inlay hints request.
- Location
- A location in a document (URI + range).
- Offset
ToPosition Params - Parameters for offset_to_position.
- Position
- A position in a document (0-indexed line and character).
- Position
ToOffset Params - Parameters for position_to_offset.
- Range
- A range in a document.
- Schema
Info - Information about the schema.
- Styx
LspExtension Client - Client for StyxLspExtension service.
- Styx
LspExtension Dispatcher - Dispatcher for this service.
- Styx
LspHost Client - Client for StyxLspHost service.
- Styx
LspHost Dispatcher - Dispatcher for this service.
- Text
Edit - A text edit (replace a range with new text).
- Workspace
Edit - A workspace edit (changes to one or more documents).
Enums§
- Capability
- Capabilities an extension can support.
- Code
Action Kind - Kind of code action.
- Completion
Kind - Kind of completion item.
- Diagnostic
Severity - Severity of a diagnostic.
- Inlay
Hint Kind - Kind of inlay hint.
Traits§
- Styx
LspExtension - Service implemented by LSP extensions.
- Styx
LspHost - Service implemented by the Styx LSP for extension callbacks.
Functions§
- styx_
lsp_ extension_ service_ detail - Returns the service detail for codegen.
- styx_
lsp_ host_ service_ detail - Returns the service detail for codegen.