diff options
Diffstat (limited to 'crates/ra_analysis/src/db.rs')
-rw-r--r-- | crates/ra_analysis/src/db.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs index 9ab273ad7..94fdd36a4 100644 --- a/crates/ra_analysis/src/db.rs +++ b/crates/ra_analysis/src/db.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use ra_editor::LineIndex; | 3 | use ra_editor::LineIndex; |
4 | use ra_syntax::File; | 4 | use ra_syntax::{File, SyntaxNode}; |
5 | use salsa; | 5 | use salsa; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
@@ -11,7 +11,7 @@ use crate::{ | |||
11 | SubmodulesQuery, | 11 | SubmodulesQuery, |
12 | }, | 12 | }, |
13 | symbol_index::SymbolIndex, | 13 | symbol_index::SymbolIndex, |
14 | syntax_ptr::{ResolveSyntaxPtrQuery, SyntaxPtrDatabase}, | 14 | syntax_ptr::SyntaxPtr, |
15 | Cancelable, Canceled, FileId, | 15 | Cancelable, Canceled, FileId, |
16 | }; | 16 | }; |
17 | 17 | ||
@@ -62,6 +62,7 @@ salsa::database_storage! { | |||
62 | fn file_syntax() for FileSyntaxQuery; | 62 | fn file_syntax() for FileSyntaxQuery; |
63 | fn file_lines() for FileLinesQuery; | 63 | fn file_lines() for FileLinesQuery; |
64 | fn file_symbols() for FileSymbolsQuery; | 64 | fn file_symbols() for FileSymbolsQuery; |
65 | fn resolve_syntax_ptr() for ResolveSyntaxPtrQuery; | ||
65 | } | 66 | } |
66 | impl DescriptorDatabase { | 67 | impl DescriptorDatabase { |
67 | fn module_tree() for ModuleTreeQuery; | 68 | fn module_tree() for ModuleTreeQuery; |
@@ -70,9 +71,6 @@ salsa::database_storage! { | |||
70 | fn fn_syntax() for FnSyntaxQuery; | 71 | fn fn_syntax() for FnSyntaxQuery; |
71 | fn fn_scopes() for FnScopesQuery; | 72 | fn fn_scopes() for FnScopesQuery; |
72 | } | 73 | } |
73 | impl SyntaxPtrDatabase { | ||
74 | fn resolve_syntax_ptr() for ResolveSyntaxPtrQuery; | ||
75 | } | ||
76 | } | 74 | } |
77 | } | 75 | } |
78 | 76 | ||
@@ -87,6 +85,12 @@ salsa::query_group! { | |||
87 | fn file_symbols(file_id: FileId) -> Cancelable<Arc<SymbolIndex>> { | 85 | fn file_symbols(file_id: FileId) -> Cancelable<Arc<SymbolIndex>> { |
88 | type FileSymbolsQuery; | 86 | type FileSymbolsQuery; |
89 | } | 87 | } |
88 | fn resolve_syntax_ptr(ptr: SyntaxPtr) -> SyntaxNode { | ||
89 | type ResolveSyntaxPtrQuery; | ||
90 | // Don't retain syntax trees in memory | ||
91 | storage volatile; | ||
92 | use fn crate::syntax_ptr::resolve_syntax_ptr; | ||
93 | } | ||
90 | } | 94 | } |
91 | } | 95 | } |
92 | 96 | ||