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.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/libanalysis/src/lib.rs b/crates/libanalysis/src/lib.rs
index ea3a28702..b4b7a6a30 100644
--- a/crates/libanalysis/src/lib.rs
+++ b/crates/libanalysis/src/lib.rs
@@ -14,11 +14,11 @@ extern crate salsa;
14 14
15mod symbol_index; 15mod symbol_index;
16mod module_map; 16mod module_map;
17pub(crate) mod module_map_db;
18mod imp; 17mod imp;
19mod job; 18mod job;
20mod roots; 19mod roots;
21mod db; 20mod db;
21mod queries;
22mod descriptors; 22mod descriptors;
23 23
24use std::{ 24use std::{
@@ -166,8 +166,8 @@ impl Analysis {
166 pub fn file_syntax(&self, file_id: FileId) -> File { 166 pub fn file_syntax(&self, file_id: FileId) -> File {
167 self.imp.file_syntax(file_id).clone() 167 self.imp.file_syntax(file_id).clone()
168 } 168 }
169 pub fn file_line_index(&self, file_id: FileId) -> LineIndex { 169 pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> {
170 self.imp.file_line_index(file_id).clone() 170 self.imp.file_line_index(file_id)
171 } 171 }
172 pub fn extend_selection(&self, file: &File, range: TextRange) -> TextRange { 172 pub fn extend_selection(&self, file: &File, range: TextRange) -> TextRange {
173 libeditor::extend_selection(file, range).unwrap_or(range) 173 libeditor::extend_selection(file, range).unwrap_or(range)
@@ -177,19 +177,19 @@ impl Analysis {
177 } 177 }
178 pub fn syntax_tree(&self, file_id: FileId) -> String { 178 pub fn syntax_tree(&self, file_id: FileId) -> String {
179 let file = self.imp.file_syntax(file_id); 179 let file = self.imp.file_syntax(file_id);
180 libeditor::syntax_tree(file) 180 libeditor::syntax_tree(&file)
181 } 181 }
182 pub fn join_lines(&self, file_id: FileId, range: TextRange) -> SourceChange { 182 pub fn join_lines(&self, file_id: FileId, range: TextRange) -> SourceChange {
183 let file = self.imp.file_syntax(file_id); 183 let file = self.imp.file_syntax(file_id);
184 SourceChange::from_local_edit(file_id, "join lines", libeditor::join_lines(file, range)) 184 SourceChange::from_local_edit(file_id, "join lines", libeditor::join_lines(&file, range))
185 } 185 }
186 pub fn on_eq_typed(&self, file_id: FileId, offset: TextUnit) -> Option<SourceChange> { 186 pub fn on_eq_typed(&self, file_id: FileId, offset: TextUnit) -> Option<SourceChange> {
187 let file = self.imp.file_syntax(file_id); 187 let file = self.imp.file_syntax(file_id);
188 Some(SourceChange::from_local_edit(file_id, "add semicolon", libeditor::on_eq_typed(file, offset)?)) 188 Some(SourceChange::from_local_edit(file_id, "add semicolon", libeditor::on_eq_typed(&file, offset)?))
189 } 189 }
190 pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> { 190 pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
191 let file = self.imp.file_syntax(file_id); 191 let file = self.imp.file_syntax(file_id);
192 libeditor::file_structure(file) 192 libeditor::file_structure(&file)
193 } 193 }
194 pub fn symbol_search(&self, query: Query, token: &JobToken) -> Vec<(FileId, FileSymbol)> { 194 pub fn symbol_search(&self, query: Query, token: &JobToken) -> Vec<(FileId, FileSymbol)> {
195 self.imp.world_symbols(query, token) 195 self.imp.world_symbols(query, token)
@@ -208,15 +208,15 @@ impl Analysis {
208 } 208 }
209 pub fn runnables(&self, file_id: FileId) -> Vec<Runnable> { 209 pub fn runnables(&self, file_id: FileId) -> Vec<Runnable> {
210 let file = self.imp.file_syntax(file_id); 210 let file = self.imp.file_syntax(file_id);
211 libeditor::runnables(file) 211 libeditor::runnables(&file)
212 } 212 }
213 pub fn highlight(&self, file_id: FileId) -> Vec<HighlightedRange> { 213 pub fn highlight(&self, file_id: FileId) -> Vec<HighlightedRange> {
214 let file = self.imp.file_syntax(file_id); 214 let file = self.imp.file_syntax(file_id);
215 libeditor::highlight(file) 215 libeditor::highlight(&file)
216 } 216 }
217 pub fn completions(&self, file_id: FileId, offset: TextUnit) -> Option<Vec<CompletionItem>> { 217 pub fn completions(&self, file_id: FileId, offset: TextUnit) -> Option<Vec<CompletionItem>> {
218 let file = self.imp.file_syntax(file_id); 218 let file = self.imp.file_syntax(file_id);
219 libeditor::scope_completion(file, offset) 219 libeditor::scope_completion(&file, offset)
220 } 220 }
221 pub fn assists(&self, file_id: FileId, range: TextRange) -> Vec<SourceChange> { 221 pub fn assists(&self, file_id: FileId, range: TextRange) -> Vec<SourceChange> {
222 self.imp.assists(file_id, range) 222 self.imp.assists(file_id, range)