pub struct LspServer {
pub state: ServerState,
pub document_manager: Arc<DocumentManager>,
pub config: ServerConfig,
pub status: ServerStatus,
pub schema_provider: Arc<SchemaProvider>,
pub toml_analyzer: Arc<TomlAnalyzer>,
pub macro_analyzer: Arc<MacroAnalyzer>,
pub route_navigator: Arc<RouteNavigator>,
pub completion_engine: Arc<CompletionEngine>,
pub diagnostic_engine: Arc<DiagnosticEngine>,
pub index_manager: Arc<IndexManager>,
/* private fields */
}Expand description
LSP 服务器
Fields§
§state: ServerState服务器状态
document_manager: Arc<DocumentManager>文档管理器
config: ServerConfig服务器配置
status: ServerStatus服务器状态跟踪器
schema_provider: Arc<SchemaProvider>Schema 提供者
toml_analyzer: Arc<TomlAnalyzer>TOML 分析器
macro_analyzer: Arc<MacroAnalyzer>宏分析器
路由导航器
completion_engine: Arc<CompletionEngine>补全引擎
diagnostic_engine: Arc<DiagnosticEngine>诊断引擎
index_manager: Arc<IndexManager>索引管理器
Implementations§
Source§impl LspServer
impl LspServer
Sourcepub fn new_for_test() -> Result<Self>
pub fn new_for_test() -> Result<Self>
为测试创建 LSP 服务器(不使用 stdio 连接)
Sourcepub fn handle_did_open(
&mut self,
params: DidOpenTextDocumentParams,
) -> Result<()>
pub fn handle_did_open( &mut self, params: DidOpenTextDocumentParams, ) -> Result<()>
处理文档打开通知
Sourcepub fn handle_did_change(
&mut self,
params: DidChangeTextDocumentParams,
) -> Result<()>
pub fn handle_did_change( &mut self, params: DidChangeTextDocumentParams, ) -> Result<()>
处理文档修改通知
Sourcepub fn handle_did_close(
&mut self,
params: DidCloseTextDocumentParams,
) -> Result<()>
pub fn handle_did_close( &mut self, params: DidCloseTextDocumentParams, ) -> Result<()>
处理文档关闭通知
Sourcepub fn handle_initialize(
&mut self,
params: InitializeParams,
) -> Result<InitializeResult>
pub fn handle_initialize( &mut self, params: InitializeParams, ) -> Result<InitializeResult>
处理初始化请求
声明服务器支持的所有能力,包括:
- 文档同步(增量更新)
- 智能补全(TOML 配置、宏参数、环境变量)
- 悬停提示(配置文档、宏展开、路由信息)
- 诊断(配置验证、路由验证、依赖注入验证)
- 定义跳转(路由导航)
- 文档符号(路由列表)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LspServer
impl !RefUnwindSafe for LspServer
impl Send for LspServer
impl Sync for LspServer
impl Unpin for LspServer
impl !UnwindSafe for LspServer
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