Although salsa is a great framework for incremental computation, most IDE computations are lazy, but not incremental. Specifically, stuff like per-function type inference does not really needs to be incremental, however it must be lazy (that is, for completion, we should be able to infer type of a single function only).
Salsa supports purely lazy computations via volatile queries, but they don't jibe to well with inremental queries (a volatile dependency causes everything to be recomputed).
So we should split HirDatabase into two PersisrentHirDatabase (for stuff like modules) and HirDatabase: PersistentHirDatabase, which includes volatile queries for type-inference, etc.
Although salsa is a great framework for incremental computation, most IDE computations are lazy, but not incremental. Specifically, stuff like per-function type inference does not really needs to be incremental, however it must be lazy (that is, for completion, we should be able to infer type of a single function only).
Salsa supports purely lazy computations via volatile queries, but they don't jibe to well with inremental queries (a volatile dependency causes everything to be recomputed).
So we should split
HirDatabase
into twoPersisrentHirDatabase
(for stuff like modules) andHirDatabase: PersistentHirDatabase
, which includes volatile queries for type-inference, etc.Specifically, this trait should be split into
and
query defenitions and code_model should be adjusted to use the correct database.