mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
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:
commit
1dc5608d0b
20 changed files with 1066 additions and 1066 deletions
|
@ -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}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue