Merge #176
176: Move completio to ra_analysis r=matklad a=matklad While we should handle completion for isolated file, it's better achieved by using empty Analysis, rather than working only with &File: we need memoization for type inference even inside a single file. Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ salsa::query_group! {
|
||||
pub(crate) trait SyntaxPtrDatabase: SyntaxDatabase {
|
||||
fn resolve_syntax_ptr(ptr: SyntaxPtr) -> SyntaxNode {
|
||||
type ResolveSyntaxPtrQuery;
|
||||
// Don't retain syntax trees in memory
|
||||
storage volatile;
|
||||
}
|
||||
}
|
||||
@@ -83,6 +84,10 @@ impl LocalSyntaxPtr {
|
||||
.unwrap_or_else(|| panic!("can't resolve local ptr to SyntaxNode: {:?}", self))
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn into_global(self, file_id: FileId) -> SyntaxPtr {
|
||||
SyntaxPtr { file_id, local: self}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user