mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-18 18:25:00 +00:00
fix: source switch on primary node
This commit is contained in:
parent
efe07c7b4a
commit
f6d473f320
3 changed files with 61 additions and 8 deletions
|
@ -57,6 +57,24 @@ mod polymorphic {
|
|||
FoldingRange(FoldingRangeRequest),
|
||||
SelectionRange(SelectionRangeRequest),
|
||||
}
|
||||
impl CompilerQueryRequest {
|
||||
pub fn associated_path(&self) -> Option<&Path> {
|
||||
Some(match self {
|
||||
CompilerQueryRequest::OnSaveExport(req) => &req.path,
|
||||
CompilerQueryRequest::Hover(req) => &req.path,
|
||||
CompilerQueryRequest::GotoDefinition(req) => &req.path,
|
||||
CompilerQueryRequest::InlayHint(req) => &req.path,
|
||||
CompilerQueryRequest::Completion(req) => &req.path,
|
||||
CompilerQueryRequest::SignatureHelp(req) => &req.path,
|
||||
CompilerQueryRequest::DocumentSymbol(req) => &req.path,
|
||||
CompilerQueryRequest::Symbol(..) => return None,
|
||||
CompilerQueryRequest::SemanticTokensFull(req) => &req.path,
|
||||
CompilerQueryRequest::SemanticTokensDelta(req) => &req.path,
|
||||
CompilerQueryRequest::FoldingRange(req) => &req.path,
|
||||
CompilerQueryRequest::SelectionRange(req) => &req.path,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum CompilerQueryResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue