Skip to main content

LspServerManager

Trait LspServerManager 

Source
pub trait LspServerManager: Send + Sync {
    // Required methods
    fn start_server<'life0, 'async_trait>(
        &'life0 self,
        language: String,
        root_path: PathBuf,
    ) -> Pin<Box<dyn Future<Output = Layer3Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stop_server<'life0, 'life1, 'async_trait>(
        &'life0 self,
        server_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_client(&self, server_id: &str) -> Option<&dyn LspClient>;
    fn list_servers(&self) -> Vec<(String, String)>;
}
Expand description

LSP 服务器管理器 trait

Required Methods§

Source

fn start_server<'life0, 'async_trait>( &'life0 self, language: String, root_path: PathBuf, ) -> Pin<Box<dyn Future<Output = Layer3Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

启动指定语言的 LSP 服务器

Source

fn stop_server<'life0, 'life1, 'async_trait>( &'life0 self, server_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

停止 LSP 服务器

Source

fn get_client(&self, server_id: &str) -> Option<&dyn LspClient>

获取服务器的客户端

Source

fn list_servers(&self) -> Vec<(String, String)>

列出活跃服务器

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§