aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r--crates/ra_analysis/src/imp.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs
index e3b78bb1a..c86bc111a 100644
--- a/crates/ra_analysis/src/imp.rs
+++ b/crates/ra_analysis/src/imp.rs
@@ -18,7 +18,7 @@ use salsa::{Database, ParallelDatabase};
18 18
19use crate::{ 19use crate::{
20 completion::{completions, CompletionItem}, 20 completion::{completions, CompletionItem},
21 db::{self, FileSyntaxQuery, SyntaxDatabase}, 21 db::{self, SourceFileQuery, SyntaxDatabase},
22 hir::{ 22 hir::{
23 self, 23 self,
24 FnSignatureInfo, 24 FnSignatureInfo,
@@ -189,7 +189,7 @@ impl fmt::Debug for AnalysisImpl {
189 189
190impl AnalysisImpl { 190impl AnalysisImpl {
191 pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode { 191 pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode {
192 self.db.file_syntax(file_id) 192 self.db.source_file(file_id)
193 } 193 }
194 pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> { 194 pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> {
195 self.db.file_lines(file_id) 195 self.db.file_lines(file_id)
@@ -220,7 +220,7 @@ impl AnalysisImpl {
220 .collect() 220 .collect()
221 }; 221 };
222 self.db 222 self.db
223 .query(FileSyntaxQuery) 223 .query(SourceFileQuery)
224 .sweep(salsa::SweepStrategy::default().discard_values()); 224 .sweep(salsa::SweepStrategy::default().discard_values());
225 Ok(query.search(&buf)) 225 Ok(query.search(&buf))
226 } 226 }
@@ -270,7 +270,7 @@ impl AnalysisImpl {
270 &self, 270 &self,
271 position: FilePosition, 271 position: FilePosition,
272 ) -> Cancelable<Vec<(FileId, FileSymbol)>> { 272 ) -> Cancelable<Vec<(FileId, FileSymbol)>> {
273 let file = self.db.file_syntax(position.file_id); 273 let file = self.db.source_file(position.file_id);
274 let syntax = file.syntax(); 274 let syntax = file.syntax();
275 if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(syntax, position.offset) { 275 if let Some(name_ref) = find_node_at_offset::<ast::NameRef>(syntax, position.offset) {
276 if let Some(fn_descr) = 276 if let Some(fn_descr) =
@@ -322,7 +322,7 @@ impl AnalysisImpl {
322 } 322 }
323 323
324 pub fn find_all_refs(&self, position: FilePosition) -> Vec<(FileId, TextRange)> { 324 pub fn find_all_refs(&self, position: FilePosition) -> Vec<(FileId, TextRange)> {
325 let file = self.db.file_syntax(position.file_id); 325 let file = self.db.source_file(position.file_id);
326 // Find the binding associated with the offset 326 // Find the binding associated with the offset
327 let (binding, descr) = match find_binding(&self.db, &file, position) { 327 let (binding, descr) = match find_binding(&self.db, &file, position) {
328 None => return Vec::new(), 328 None => return Vec::new(),
@@ -365,13 +365,13 @@ impl AnalysisImpl {
365 file_id: FileId, 365 file_id: FileId,
366 symbol: FileSymbol, 366 symbol: FileSymbol,
367 ) -> Cancelable<Option<String>> { 367 ) -> Cancelable<Option<String>> {
368 let file = self.db.file_syntax(file_id); 368 let file = self.db.source_file(file_id);
369 369
370 Ok(symbol.docs(&file)) 370 Ok(symbol.docs(&file))
371 } 371 }
372 372
373 pub fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> { 373 pub fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> {
374 let syntax = self.db.file_syntax(file_id); 374 let syntax = self.db.source_file(file_id);
375 375
376 let mut res = ra_editor::diagnostics(&syntax) 376 let mut res = ra_editor::diagnostics(&syntax)
377 .into_iter() 377 .into_iter()
@@ -459,7 +459,7 @@ impl AnalysisImpl {
459 &self, 459 &self,
460 position: FilePosition, 460 position: FilePosition,
461 ) -> Cancelable<Option<(FnSignatureInfo, Option<usize>)>> { 461 ) -> Cancelable<Option<(FnSignatureInfo, Option<usize>)>> {
462 let file = self.db.file_syntax(position.file_id); 462 let file = self.db.source_file(position.file_id);
463 let syntax = file.syntax(); 463 let syntax = file.syntax();
464 464
465 // Find the calling expression and it's NameRef 465 // Find the calling expression and it's NameRef
@@ -470,7 +470,7 @@ impl AnalysisImpl {
470 let file_symbols = self.index_resolve(name_ref)?; 470 let file_symbols = self.index_resolve(name_ref)?;
471 for (fn_file_id, fs) in file_symbols { 471 for (fn_file_id, fs) in file_symbols {
472 if fs.kind == FN_DEF { 472 if fs.kind == FN_DEF {
473 let fn_file = self.db.file_syntax(fn_file_id); 473 let fn_file = self.db.source_file(fn_file_id);
474 if let Some(fn_def) = find_node_at_offset(fn_file.syntax(), fs.node_range.start()) { 474 if let Some(fn_def) = find_node_at_offset(fn_file.syntax(), fs.node_range.start()) {
475 let descr = hir::Function::guess_from_source(&*self.db, fn_file_id, fn_def); 475 let descr = hir::Function::guess_from_source(&*self.db, fn_file_id, fn_def);
476 if let Some(descriptor) = descr.signature_info(&*self.db) { 476 if let Some(descriptor) = descr.signature_info(&*self.db) {