From e4a6343e47a7dc87192b762b3b2ebd100240d194 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 8 Feb 2019 14:09:57 +0300 Subject: move index_resolve to symbol index --- crates/ra_ide_api/src/call_info.rs | 2 +- crates/ra_ide_api/src/goto_definition.rs | 3 +-- crates/ra_ide_api/src/imp.rs | 12 +----------- crates/ra_ide_api/src/symbol_index.rs | 8 ++++++++ 4 files changed, 11 insertions(+), 14 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/call_info.rs b/crates/ra_ide_api/src/call_info.rs index 2eb388e0e..a59ab7853 100644 --- a/crates/ra_ide_api/src/call_info.rs +++ b/crates/ra_ide_api/src/call_info.rs @@ -20,7 +20,7 @@ pub(crate) fn call_info(db: &RootDatabase, position: FilePosition) -> Option Vec { - let name = name_ref.text(); - let mut query = Query::new(name.to_string()); - query.exact(); - query.limit(4); - crate::symbol_index::world_symbols(self, query) - } } impl SourceChange { diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 9f939c650..3d0b2369e 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -109,6 +109,14 @@ pub(crate) fn world_symbols(db: &RootDatabase, query: Query) -> Vec query.search(&buf) } +pub(crate) fn index_resolve(db: &RootDatabase, name_ref: &ast::NameRef) -> Vec { + let name = name_ref.text(); + let mut query = Query::new(name.to_string()); + query.exact(); + query.limit(4); + crate::symbol_index::world_symbols(db, query) +} + #[derive(Default, Debug)] pub(crate) struct SymbolIndex { symbols: Vec, -- cgit v1.2.3