pub struct RequestMessage {
pub base_message: BaseMessage,
pub id: Value,
pub method: String,
pub params: Value,
}
Fields§
§base_message: BaseMessage
§id: Value
§method: String
§params: Value
Implementations§
Source§impl RequestMessage
impl RequestMessage
Sourcepub fn new_initialize(
id: u32,
process_id: u32,
root_uri: String,
client_name: String,
client_version: String,
workspace_folders: Vec<WorkspaceFolder>,
) -> Self
pub fn new_initialize( id: u32, process_id: u32, root_uri: String, client_name: String, client_version: String, workspace_folders: Vec<WorkspaceFolder>, ) -> Self
Helper function to create a new initialize
request message.
id - The ID of the request message.
process_id - The process ID of the client. (usually std::process::id()
)
root_uri - The root URI of the workspace. (e.g. file://path/to/code
)
client_name - The name of the client. (e.g. vim-go
)
workspace_folders - List of folders that the lsp needs context for.
TODO: This function is currently a bit opinionated towards textdefintion.
To have a custom initialize message, the workaround for now is to directly
create a RequestMessage
with desired capabilities.
Sourcepub fn new_get_definition(id: u32, uri: String, position: Position) -> Self
pub fn new_get_definition(id: u32, uri: String, position: Position) -> Self
Helper function to create a new textDocument/definition
request message.
id - The ID of the request message.
uri - The URI of the text document. (e.g. file://path/to/code/main.go
)
line - The line number of the cursor position.
character - The the cursor position of the character we want to get the definition of.