don't cache parses twice

Before this commit, `Parse`s for original file ended up two times in
salsa's db: first, when we parse original file, and second, when we
parse macro or a file.

Given that parse trees are the worst ofenders in terms of memory, it
makes sense to make sure we store them only once.
This commit is contained in:
Aleksey Kladov 2019-06-02 20:15:10 +03:00
parent b40c6de8a6
commit 8b7f58976b
5 changed files with 61 additions and 33 deletions

View file

@ -226,7 +226,7 @@ impl RootDatabase {
self.query(ra_db::ParseQuery).sweep(sweep);
self.query(hir::db::ParseOrExpandQuery).sweep(sweep);
self.query(hir::db::ParseMacroQuery).sweep(sweep);
self.query(hir::db::MacroDefQuery).sweep(sweep);
self.query(hir::db::MacroArgQuery).sweep(sweep);
self.query(hir::db::MacroExpandQuery).sweep(sweep);