mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
introduce separate goto_defenition
This commit is contained in:
parent
ad2a5da259
commit
4551155073
2 changed files with 9 additions and 3 deletions
|
@ -207,12 +207,11 @@ pub fn handle_goto_definition(
|
|||
params: req::TextDocumentPositionParams,
|
||||
) -> Result<Option<req::GotoDefinitionResponse>> {
|
||||
let position = params.try_conv_with(&world)?;
|
||||
let rr = match world.analysis().approximately_resolve_symbol(position)? {
|
||||
let navs = match world.analysis().goto_defenition(position)? {
|
||||
None => return Ok(None),
|
||||
Some(it) => it,
|
||||
};
|
||||
let res = rr
|
||||
.resolves_to
|
||||
let res = navs
|
||||
.into_iter()
|
||||
.map(|nav| nav.try_conv_with(&world))
|
||||
.collect::<Result<Vec<_>>>()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue