mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Use TryConv for conversion
This commit is contained in:
parent
79941a9e70
commit
be75e547ce
1 changed files with 1 additions and 2 deletions
|
@ -678,11 +678,10 @@ pub fn handle_document_highlight(
|
||||||
) -> Result<Option<Vec<DocumentHighlight>>> {
|
) -> Result<Option<Vec<DocumentHighlight>>> {
|
||||||
let file_id = params.text_document.try_conv_with(&world)?;
|
let file_id = params.text_document.try_conv_with(&world)?;
|
||||||
let line_index = world.analysis().file_line_index(file_id);
|
let line_index = world.analysis().file_line_index(file_id);
|
||||||
let offset = params.position.conv_with(&line_index);
|
|
||||||
|
|
||||||
let refs = world
|
let refs = world
|
||||||
.analysis()
|
.analysis()
|
||||||
.find_all_refs(FilePosition { file_id, offset })?;
|
.find_all_refs(params.try_conv_with(&world)?)?;
|
||||||
|
|
||||||
Ok(Some(
|
Ok(Some(
|
||||||
refs.into_iter()
|
refs.into_iter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue