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:
bors[bot] 2018-10-31 18:05:12 +00:00
commit 1dc5608d0b
20 changed files with 1066 additions and 1066 deletions

View file

@ -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}
}
}