feat: add label view (#570)

* feat: add label view

* fix: typo

* fix: snapshot

* chore: final tune
This commit is contained in:
Myriad-Dreamin 2024-08-27 19:31:57 +08:00 committed by GitHub
parent a7951b3832
commit b8d933615d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 315 additions and 6 deletions

View file

@ -36,6 +36,8 @@ mod document_highlight;
pub use document_highlight::*;
mod document_symbol;
pub use document_symbol::*;
mod workspace_label;
pub use workspace_label::*;
mod document_metrics;
pub use document_metrics::*;
mod folding_range;
@ -259,6 +261,7 @@ mod polymorphic {
OnEnter(OnEnterRequest),
DocumentMetrics(DocumentMetricsRequest),
WorkspaceLabel(WorkspaceLabelRequest),
ServerInfo(ServerInfoRequest),
}
@ -282,6 +285,7 @@ mod polymorphic {
Self::Rename(..) => Mergeable,
Self::PrepareRename(..) => Mergeable,
Self::DocumentSymbol(..) => ContextFreeUnique,
Self::WorkspaceLabel(..) => Mergeable,
Self::Symbol(..) => Mergeable,
Self::SemanticTokensFull(..) => ContextFreeUnique,
Self::SemanticTokensDelta(..) => ContextFreeUnique,
@ -316,6 +320,7 @@ mod polymorphic {
Self::PrepareRename(req) => &req.path,
Self::DocumentSymbol(req) => &req.path,
Self::Symbol(..) => return None,
Self::WorkspaceLabel(..) => return None,
Self::SemanticTokensFull(req) => &req.path,
Self::SemanticTokensDelta(req) => &req.path,
Self::Formatting(req) => &req.path,
@ -350,6 +355,7 @@ mod polymorphic {
Rename(Option<WorkspaceEdit>),
DocumentSymbol(Option<DocumentSymbolResponse>),
Symbol(Option<Vec<SymbolInformation>>),
WorkspaceLabel(Option<Vec<SymbolInformation>>),
SemanticTokensFull(Option<SemanticTokensResult>),
SemanticTokensDelta(Option<SemanticTokensFullDeltaResult>),
Formatting(Option<Vec<TextEdit>>),
@ -383,6 +389,7 @@ mod polymorphic {
Self::Rename(res) => serde_json::to_value(res),
Self::DocumentSymbol(res) => serde_json::to_value(res),
Self::Symbol(res) => serde_json::to_value(res),
Self::WorkspaceLabel(res) => serde_json::to_value(res),
Self::SemanticTokensFull(res) => serde_json::to_value(res),
Self::SemanticTokensDelta(res) => serde_json::to_value(res),
Self::Formatting(res) => serde_json::to_value(res),