pub struct LanguageServerManager {
pub servers: Arc<Mutex<HashMap<String, LanguageServer>>>,
/* private fields */
}Expand description
语言服务器管理器
Fields§
§servers: Arc<Mutex<HashMap<String, LanguageServer>>>已启动的服务器
Implementations§
Source§impl LanguageServerManager
impl LanguageServerManager
Sourcepub fn get_language_from_extension(ext: &str) -> Option<&'static str>
pub fn get_language_from_extension(ext: &str) -> Option<&'static str>
根据文件扩展名获取语言名称
Sourcepub fn get_config(&self, language: &str) -> Option<&LanguageServerConfig>
pub fn get_config(&self, language: &str) -> Option<&LanguageServerConfig>
获取服务器配置
Sourcepub async fn get_server(&self, language: &str) -> Option<LanguageServerHandle>
pub async fn get_server(&self, language: &str) -> Option<LanguageServerHandle>
获取服务器
Sourcepub async fn stop_server(&self, language: &str) -> LspResult<()>
pub async fn stop_server(&self, language: &str) -> LspResult<()>
停止服务器
Sourcepub async fn is_running(&self, language: &str) -> bool
pub async fn is_running(&self, language: &str) -> bool
检查服务器是否运行
Sourcepub fn add_custom_config(
&mut self,
language: String,
config: LanguageServerConfig,
)
pub fn add_custom_config( &mut self, language: String, config: LanguageServerConfig, )
添加自定义服务器配置
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LanguageServerManager
impl !UnwindSafe for LanguageServerManager
impl Freeze for LanguageServerManager
impl Send for LanguageServerManager
impl Sync for LanguageServerManager
impl Unpin for LanguageServerManager
impl UnsafeUnpin for LanguageServerManager
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