mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Implement proposed CallHierarchy feature
See: https://github.com/microsoft/vscode-languageserver-node/blob/master/protocol/src/protocol.callHierarchy.proposed.ts
This commit is contained in:
parent
928ecd069a
commit
1b19a8aa5e
11 changed files with 502 additions and 15 deletions
|
@ -490,6 +490,24 @@ impl TryConvWith<&WorldSnapshot> for (FileId, RangeInfo<Vec<NavigationTarget>>)
|
|||
}
|
||||
}
|
||||
|
||||
pub fn to_call_hierarchy_item(
|
||||
file_id: FileId,
|
||||
range: TextRange,
|
||||
world: &WorldSnapshot,
|
||||
line_index: &LineIndex,
|
||||
nav: NavigationTarget,
|
||||
) -> Result<lsp_types::CallHierarchyItem> {
|
||||
Ok(lsp_types::CallHierarchyItem {
|
||||
name: nav.name().to_string(),
|
||||
kind: nav.kind().conv(),
|
||||
tags: None,
|
||||
detail: nav.description().map(|it| it.to_string()),
|
||||
uri: file_id.try_conv_with(&world)?,
|
||||
range: nav.range().conv_with(&line_index),
|
||||
selection_range: range.conv_with(&line_index),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn to_location(
|
||||
file_id: FileId,
|
||||
range: TextRange,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue