mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
fix highlighting
This commit is contained in:
parent
328be5721a
commit
93c179531b
3 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
|
||||||
use hir::ModuleSource;
|
use hir::ModuleSource;
|
||||||
use ra_db::SourceDatabase;
|
use ra_db::{SourceDatabase, SourceDatabaseExt};
|
||||||
use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNode};
|
use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNode};
|
||||||
use relative_path::{RelativePath, RelativePathBuf};
|
use relative_path::{RelativePath, RelativePathBuf};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! FIXME: write short doc here
|
//! FIXME: write short doc here
|
||||||
|
|
||||||
use hir::{DefWithBody, HasSource, ModuleSource};
|
use hir::{DefWithBody, HasSource, ModuleSource};
|
||||||
use ra_db::{FileId, SourceDatabase};
|
use ra_db::{FileId, SourceDatabase, SourceDatabaseExt};
|
||||||
use ra_syntax::{AstNode, TextRange};
|
use ra_syntax::{AstNode, TextRange};
|
||||||
|
|
||||||
use crate::db::RootDatabase;
|
use crate::db::RootDatabase;
|
||||||
|
|
|
@ -751,6 +751,7 @@ pub fn handle_document_highlight(
|
||||||
|
|
||||||
Ok(Some(
|
Ok(Some(
|
||||||
refs.into_iter()
|
refs.into_iter()
|
||||||
|
.filter(|r| r.file_id == file_id)
|
||||||
.map(|r| DocumentHighlight { range: r.range.conv_with(&line_index), kind: None })
|
.map(|r| DocumentHighlight { range: r.range.conv_with(&line_index), kind: None })
|
||||||
.collect(),
|
.collect(),
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue