diff --git a/crates/ra_ide_api/src/references/rename.rs b/crates/ra_ide_api/src/references/rename.rs index c91dada464d..0e2e088e0a9 100644 --- a/crates/ra_ide_api/src/references/rename.rs +++ b/crates/ra_ide_api/src/references/rename.rs @@ -1,7 +1,7 @@ //! FIXME: write short doc here use hir::ModuleSource; -use ra_db::SourceDatabase; +use ra_db::{SourceDatabase, SourceDatabaseExt}; use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNode}; use relative_path::{RelativePath, RelativePathBuf}; diff --git a/crates/ra_ide_api/src/references/search_scope.rs b/crates/ra_ide_api/src/references/search_scope.rs index dfea18a196b..680988a214c 100644 --- a/crates/ra_ide_api/src/references/search_scope.rs +++ b/crates/ra_ide_api/src/references/search_scope.rs @@ -1,7 +1,7 @@ //! FIXME: write short doc here use hir::{DefWithBody, HasSource, ModuleSource}; -use ra_db::{FileId, SourceDatabase}; +use ra_db::{FileId, SourceDatabase, SourceDatabaseExt}; use ra_syntax::{AstNode, TextRange}; use crate::db::RootDatabase; diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index e08e0dbae51..3070828654b 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -751,6 +751,7 @@ pub fn handle_document_highlight( Ok(Some( refs.into_iter() + .filter(|r| r.file_id == file_id) .map(|r| DocumentHighlight { range: r.range.conv_with(&line_index), kind: None }) .collect(), ))