Struct RequestMessage

Source
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

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for RequestMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RequestMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RequestMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,