aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-24 12:17:03 +0100
committerGitHub <[email protected]>2019-10-24 12:17:03 +0100
commit95cf5c86fae3adf3bb38521905bf357450125709 (patch)
treedf21a3aec7f580d4c6a768ceee7a7d1f9351838e /crates/ra_lsp_server/src
parent29a31a663914ef0bfe36e7ff45a58762c9313086 (diff)
parent4529da906db7f18aaf384c079332e4ea12c82d55 (diff)
Merge #2059
2059: for highlighting, search only the current file r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index e65f075a6..a29971d10 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -9,7 +9,9 @@ use lsp_types::{
9 Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, 9 Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse,
10 Range, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit, 10 Range, RenameParams, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit,
11}; 11};
12use ra_ide_api::{AssistId, FileId, FilePosition, FileRange, Query, Runnable, RunnableKind}; 12use ra_ide_api::{
13 AssistId, FileId, FilePosition, FileRange, Query, Runnable, RunnableKind, SearchScope,
14};
13use ra_prof::profile; 15use ra_prof::profile;
14use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit}; 16use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit};
15use rustc_hash::FxHashMap; 17use rustc_hash::FxHashMap;
@@ -485,7 +487,7 @@ pub fn handle_references(
485 let _p = profile("handle_references"); 487 let _p = profile("handle_references");
486 let position = params.text_document_position.try_conv_with(&world)?; 488 let position = params.text_document_position.try_conv_with(&world)?;
487 489
488 let refs = match world.analysis().find_all_refs(position)? { 490 let refs = match world.analysis().find_all_refs(position, None)? {
489 None => return Ok(None), 491 None => return Ok(None),
490 Some(refs) => refs, 492 Some(refs) => refs,
491 }; 493 };
@@ -748,7 +750,10 @@ pub fn handle_document_highlight(
748 let file_id = params.text_document.try_conv_with(&world)?; 750 let file_id = params.text_document.try_conv_with(&world)?;
749 let line_index = world.analysis().file_line_index(file_id)?; 751 let line_index = world.analysis().file_line_index(file_id)?;
750 752
751 let refs = match world.analysis().find_all_refs(params.try_conv_with(&world)?)? { 753 let refs = match world
754 .analysis()
755 .find_all_refs(params.try_conv_with(&world)?, Some(SearchScope::single_file(file_id)))?
756 {
752 None => return Ok(None), 757 None => return Ok(None),
753 Some(refs) => refs, 758 Some(refs) => refs,
754 }; 759 };