From 85a6bf342490f2a8be34ea53af9eb8fcdcad2b38 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sun, 17 Feb 2019 13:38:32 +0200 Subject: Refactor find_all_refs to return ReferenceSearchResult --- crates/ra_ide_api/tests/test/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide_api/tests') diff --git a/crates/ra_ide_api/tests/test/main.rs b/crates/ra_ide_api/tests/test/main.rs index 0526f7584..a83fbe07b 100644 --- a/crates/ra_ide_api/tests/test/main.rs +++ b/crates/ra_ide_api/tests/test/main.rs @@ -1,7 +1,8 @@ use insta::assert_debug_snapshot_matches; use ra_ide_api::{ mock_analysis::{single_file, single_file_with_position, MockAnalysis}, - AnalysisChange, CrateGraph, Edition::Edition2018, FileId, Query, NavigationTarget + AnalysisChange, CrateGraph, Edition::Edition2018, Query, NavigationTarget, + ReferenceSearchResult, }; use ra_syntax::{TextRange, SmolStr}; @@ -44,9 +45,9 @@ fn test_resolve_crate_root() { assert_eq!(host.analysis().crate_for(mod_file).unwrap(), vec![crate_id]); } -fn get_all_refs(text: &str) -> Vec<(FileId, TextRange)> { +fn get_all_refs(text: &str) -> ReferenceSearchResult { let (analysis, position) = single_file_with_position(text); - analysis.find_all_refs(position).unwrap() + analysis.find_all_refs(position).unwrap().unwrap() } fn get_symbols_matching(text: &str, query: &str) -> Vec { -- cgit v1.2.3