pub struct LanguageServer {
pub config: LanguageServerConfig,
pub process: Option<Child>,
pub root_path: PathBuf,
}Expand description
语言服务器实例
Fields§
§config: LanguageServerConfig配置
process: Option<Child>子进程
root_path: PathBuf根目录
Implementations§
Source§impl LanguageServer
impl LanguageServer
Sourcepub fn new(config: LanguageServerConfig, root_path: PathBuf) -> LspResult<Self>
pub fn new(config: LanguageServerConfig, root_path: PathBuf) -> LspResult<Self>
启动服务器
Sourcepub fn config(&self) -> &LanguageServerConfig
pub fn config(&self) -> &LanguageServerConfig
获取配置
Sourcepub fn stdin(&self) -> Option<&ChildStdin>
pub fn stdin(&self) -> Option<&ChildStdin>
获取进程 stdin
Sourcepub fn stdout(&self) -> Option<&ChildStdout>
pub fn stdout(&self) -> Option<&ChildStdout>
获取进程 stdout
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
检查服务器是否运行
Trait Implementations§
Source§impl Debug for LanguageServer
impl Debug for LanguageServer
Source§impl Drop for LanguageServer
impl Drop for LanguageServer
Auto Trait Implementations§
impl Freeze for LanguageServer
impl RefUnwindSafe for LanguageServer
impl Send for LanguageServer
impl Sync for LanguageServer
impl Unpin for LanguageServer
impl UnsafeUnpin for LanguageServer
impl UnwindSafe for LanguageServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more