aboutsummaryrefslogtreecommitdiff
path: root/crates/libanalysis/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-04 02:13:22 +0100
committerAleksey Kladov <[email protected]>2018-09-04 02:13:22 +0100
commit4df965a002b5296fc728f1bc2fb9312fe421ea5d (patch)
tree989dfb2bbc2751d97959b4ca320cc5301b2ec4f5 /crates/libanalysis/src
parentc3e28f06463854e4711c4c49a49c77d1e136969f (diff)
work
Diffstat (limited to 'crates/libanalysis/src')
-rw-r--r--crates/libanalysis/src/roots.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/libanalysis/src/roots.rs b/crates/libanalysis/src/roots.rs
index f1bc72e33..6d1375f88 100644
--- a/crates/libanalysis/src/roots.rs
+++ b/crates/libanalysis/src/roots.rs
@@ -138,6 +138,11 @@ pub(crate) struct ReadonlySourceRoot {
138impl ReadonlySourceRoot { 138impl ReadonlySourceRoot {
139 pub fn new(files: Vec<(FileId, String)>) -> ReadonlySourceRoot { 139 pub fn new(files: Vec<(FileId, String)>) -> ReadonlySourceRoot {
140 let mut module_map = ModuleMap::new(); 140 let mut module_map = ModuleMap::new();
141 let symbol_index = SymbolIndex::for_files(
142 files.par_iter().map(|(file_id, text)| {
143 (*file_id, File::parse(text))
144 })
145 );
141 let file_map: HashMap<FileId, FileData> = files 146 let file_map: HashMap<FileId, FileData> = files
142 .into_iter() 147 .into_iter()
143 .map(|(id, text)| { 148 .map(|(id, text)| {
@@ -145,11 +150,6 @@ impl ReadonlySourceRoot {
145 (id, FileData::new(text)) 150 (id, FileData::new(text))
146 }) 151 })
147 .collect(); 152 .collect();
148 let symbol_index = SymbolIndex::for_files(
149 file_map.par_iter().map(|(&file_id, file_data)| {
150 (file_id, file_data.syntax_transient())
151 })
152 );
153 153
154 ReadonlySourceRoot { 154 ReadonlySourceRoot {
155 symbol_index, 155 symbol_index,