Skip to main content

LspServer

Struct LspServer 

Source
pub struct LspServer<R: BufRead, W: Write> {
    reader: R,
    writer: W,
    documents: HashMap<String, String>,
    shutdown: bool,
}
Expand description

The LSP server state.

Fields§

§reader: R§writer: W§documents: HashMap<String, String>§shutdown: bool

Implementations§

Source§

impl<R: BufRead, W: Write> LspServer<R, W>

Source

pub fn new(reader: R, writer: W) -> Self

Creates a new instance.

Source

pub fn run(&mut self) -> Result<()>

Run the server loop.

Source

fn send_response(&mut self, response: Value) -> Result<()>

Source

fn send_notification(&mut self, method: &str, params: Value) -> Result<()>

Source

fn handle_message(&mut self, msg: Value) -> Result<()>

Source

fn completion_context(&self, params: Option<&Value>) -> (String, usize, usize)

Source

fn publish_diagnostics(&mut self, uri: &str) -> Result<()>

Auto Trait Implementations§

§

impl<R, W> Freeze for LspServer<R, W>
where R: Freeze, W: Freeze,

§

impl<R, W> RefUnwindSafe for LspServer<R, W>

§

impl<R, W> Send for LspServer<R, W>
where R: Send, W: Send,

§

impl<R, W> Sync for LspServer<R, W>
where R: Sync, W: Sync,

§

impl<R, W> Unpin for LspServer<R, W>
where R: Unpin, W: Unpin,

§

impl<R, W> UnsafeUnpin for LspServer<R, W>
where R: UnsafeUnpin, W: UnsafeUnpin,

§

impl<R, W> UnwindSafe for LspServer<R, W>
where R: UnwindSafe, W: UnwindSafe,

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,