feat: implements experimental/onEnter (#328)

* feat: implements `experimental/onEnter`

* docs: update readme

* dev: update snapshot

* dev: allow configuration
This commit is contained in:
Myriad-Dreamin 2024-06-16 17:33:46 +08:00 committed by GitHub
parent 8d753d8c56
commit 95a68d2559
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 373 additions and 3 deletions

View file

@ -65,6 +65,8 @@ pub(crate) mod signature_help;
pub use signature_help::*;
pub(crate) mod symbol;
pub use symbol::*;
pub(crate) mod on_enter;
pub use on_enter::*;
pub(crate) mod prepare_rename;
pub use prepare_rename::*;
pub(crate) mod references;
@ -222,6 +224,8 @@ mod polymorphic {
SelectionRange(SelectionRangeRequest),
InteractCodeContext(InteractCodeContextRequest),
OnEnter(OnEnterRequest),
DocumentMetrics(DocumentMetricsRequest),
ServerInfo(ServerInfoRequest),
}
@ -255,6 +259,8 @@ mod polymorphic {
CompilerQueryRequest::SelectionRange(..) => ContextFreeUnique,
CompilerQueryRequest::InteractCodeContext(..) => PinnedFirst,
CompilerQueryRequest::OnEnter(..) => ContextFreeUnique,
CompilerQueryRequest::DocumentMetrics(..) => PinnedFirst,
CompilerQueryRequest::ServerInfo(..) => Mergeable,
}
@ -286,6 +292,7 @@ mod polymorphic {
CompilerQueryRequest::FoldingRange(req) => &req.path,
CompilerQueryRequest::SelectionRange(req) => &req.path,
CompilerQueryRequest::InteractCodeContext(req) => &req.path,
CompilerQueryRequest::OnEnter(req) => &req.path,
CompilerQueryRequest::DocumentMetrics(req) => &req.path,
CompilerQueryRequest::ServerInfo(..) => return None,
@ -320,6 +327,8 @@ mod polymorphic {
SelectionRange(Option<Vec<SelectionRange>>),
InteractCodeContext(Option<Vec<InteractCodeContextResponse>>),
OnEnter(Option<Vec<TextEdit>>),
DocumentMetrics(Option<DocumentMetricsResponse>),
ServerInfo(Option<HashMap<String, ServerInfoResponse>>),
}