aboutsummaryrefslogtreecommitdiff
path: root/crates/libanalysis/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libanalysis/src/lib.rs')
-rw-r--r--crates/libanalysis/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs
index acaadb8a2..b2f4bdbb3 100644
--- a/crates/libanalysis/src/lib.rs
+++ b/crates/libanalysis/src/lib.rs
@@ -21,7 +21,8 @@ use std::{
21use libsyntax2::ast; 21use libsyntax2::ast;
22use libeditor::{LineIndex, FileSymbol}; 22use libeditor::{LineIndex, FileSymbol};
23 23
24use self::symbol_index::{FileSymbols, Query}; 24use self::symbol_index::{FileSymbols};
25pub use self::symbol_index::Query;
25 26
26pub type Result<T> = ::std::result::Result<T, ::failure::Error>; 27pub type Result<T> = ::std::result::Result<T, ::failure::Error>;
27 28
@@ -89,14 +90,13 @@ impl World {
89 Ok(index.clone()) 90 Ok(index.clone())
90 } 91 }
91 92
92 pub fn world_symbols<'a>(&'a self, query: &str) -> impl Iterator<Item=(&'a Path, &'a FileSymbol)> + 'a 93 pub fn world_symbols<'a>(&'a self, query: Query) -> impl Iterator<Item=(&'a Path, &'a FileSymbol)> + 'a
93 { 94 {
94 let q = Query::new(query);
95 self.data.file_map.iter() 95 self.data.file_map.iter()
96 .flat_map(move |(path, data)| { 96 .flat_map(move |(path, data)| {
97 let path: &'a Path = path.as_path(); 97 let path: &'a Path = path.as_path();
98 let symbols = data.symbols(path); 98 let symbols = data.symbols(path);
99 q.process(symbols).map(move |s| (path, s)) 99 query.process(symbols).map(move |s| (path, s))
100 }) 100 })
101 } 101 }
102 102