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.
1368: Store referece instead of full token tree in tokenbuffer r=matklad a=edwin0cheng
This PR try to minimize the memory allocation in converting `SyntaxNode` to `TokenTree` by using reference isnteead of full token tree in `TokenBuffer`.
Note that the final goal is replace `TokenTree` with TokenBuffer such that there is no conversion between them.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1362: Introduce AST database r=matklad a=matklad
The idea here is to separate fragile bits which look into the syntax directly from robust bits which are safe across reparses. This uses the new `salsa::requires` featue
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
1360: Improve goto definition for MBE r=matklad a=edwin0cheng
This PR improve the macro resolution for goto definition and expression macro invocation by using proper path resolution for external macros.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
We use panics for cancellation, so we could trigger panic while
holding the solver. std::sync::Mutex will be poisoned as a result,
which and all further attempts to use solver (from other threads) will
panic as well.
This commit switches to parking_lot::Mutex which just unlocks on panic.
1347: Add status buffer function to emacs integration r=flodiebold a=flodiebold
Also fix a minor race condition in the 'extend selection' initialization.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>