els

Struct Server

Source
pub struct Server<Checker: BuildRunnable = PackageBuilder, Parser: Parsable = SimpleParser> {
    pub flags: Flags,
    /* private fields */
}
Expand description

A Language Server, which can be used any object implementing BuildRunnable internally by passing it as a generic parameter.

Fields§

§flags: Flags

Implementations§

Source§

impl<Checker: BuildRunnable, Parser: Parsable> Server<Checker, Parser>

Source

pub fn start_client_health_checker(&self, receiver: Receiver<WorkerMessage<()>>)

Send an empty workspace/configuration request periodically. If there is no response to the request within a certain period of time, terminate the server.

Source§

impl<Checker: BuildRunnable, Parser: Parsable> Server<Checker, Parser>

Source

pub fn dependencies_of(&self, uri: &NormalizedUrl) -> Vec<NormalizedUrl>

self is included. if self is not in the graph, return empty vec

Source

pub fn dependents_of(&self, uri: &NormalizedUrl) -> Vec<NormalizedUrl>

self is not included

Source§

impl Server

Source§

impl<Checker: BuildRunnable, Parser: Parsable> Server<Checker, Parser>

Source

pub fn new(cfg: ErgConfig, stdout_redirect: Option<Sender<Value>>) -> Self

Source

pub fn run(self)

Source

pub const fn mode(&self) -> &str

Source

pub fn dispatch(&mut self, msg: Value) -> ELSResult<()>

Source

pub fn get_file_cache(&self) -> &FileCache

Source

pub fn remove_module_entry( &mut self, uri: &NormalizedUrl, ) -> Option<ModuleEntry>

Source

pub fn insert_module_entry(&mut self, uri: NormalizedUrl, entry: ModuleEntry)

Source

pub fn get_hir( &self, uri: &NormalizedUrl, ) -> Option<MappedRwLockReadGuard<'_, HIR>>

Source

pub fn steal_entry(&self, uri: &NormalizedUrl) -> Option<ModuleEntry>

Source

pub fn restore_entry(&self, uri: NormalizedUrl, entry: ModuleEntry)

Source

pub fn get_ast( &self, uri: &NormalizedUrl, ) -> Option<MappedRwLockReadGuard<'_, Module>>

Source

pub fn get_warns(&self, uri: &NormalizedUrl) -> Option<Vec<&CompileWarning>>

Trait Implementations§

Source§

impl<C: BuildRunnable, P: Parsable> Clone for Server<C, P>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Checker: Debug + BuildRunnable, Parser: Debug + Parsable> Debug for Server<Checker, Parser>

Source§

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

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

impl LangServer for Server

Source§

fn dispatch(&mut self, msg: impl Into<Value>) -> Result<(), Box<dyn Error>>

Receive and process a message from the client. Output should be returned to the channel.
Source§

impl<C: BuildRunnable, P: Parsable> RedirectableStdout for Server<C, P>

Source§

fn sender(&self) -> Option<&Sender<Value>>

Source§

fn send_stdout<T>(&self, message: &T) -> Result<(), Box<dyn Error>>
where T: Serialize + ?Sized,

Source§

fn send_log<S>(&self, msg: S) -> Result<(), Box<dyn Error>>
where S: Into<String>,

Source§

fn send_info<S>(&self, msg: S) -> Result<(), Box<dyn Error>>
where S: Into<String>,

Source§

fn send_error_info<S>(&self, msg: S) -> Result<(), Box<dyn Error>>
where S: Into<String>,

Source§

fn send_error<S>( &self, id: Option<i64>, code: i64, msg: S, ) -> Result<(), Box<dyn Error>>
where S: Into<String>,

Source§

fn send_invalid_req_error(&self) -> Result<(), Box<dyn Error>>

Auto Trait Implementations§

§

impl<Checker, Parser> Freeze for Server<Checker, Parser>

§

impl<Checker = GenericPackageBuilder, Parser = SimpleParser> !RefUnwindSafe for Server<Checker, Parser>

§

impl<Checker, Parser> Send for Server<Checker, Parser>

§

impl<Checker, Parser> Sync for Server<Checker, Parser>

§

impl<Checker, Parser> Unpin for Server<Checker, Parser>

§

impl<Checker = GenericPackageBuilder, Parser = SimpleParser> !UnwindSafe for Server<Checker, Parser>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T