move index_resolve to symbol index

This commit is contained in:
Aleksey Kladov 2019-02-08 14:09:57 +03:00
parent 5173c6295b
commit e4a6343e47
4 changed files with 11 additions and 14 deletions

View file

@ -109,6 +109,14 @@ pub(crate) fn world_symbols(db: &RootDatabase, query: Query) -> Vec<FileSymbol>
query.search(&buf)
}
pub(crate) fn index_resolve(db: &RootDatabase, name_ref: &ast::NameRef) -> Vec<FileSymbol> {
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<FileSymbol>,