Don't merge trait_impls_in_deps results
Closes https://github.com/rust-lang/rust-analyzer/issues/9167
We effectively keep a lot of copies of `TraitImpl` results in memory by merging them into the result of this query. This wastes a lot of memory unnecessarily. The change here brings memory usage of self down by 50mb (at a slight cost of trait solving unfortunately, though I'm hopeful it was just noice)
Refactor symbol index
Closes https://github.com/rust-lang/rust-analyzer/issues/14677
instead of eagerly fetching the source data in symbol index we do it lazily now, this shouldn't make it much more expensive as we had to parse the source most of the time anyways even after fetching.
fix: ide: exclude sized in go-to actions in hover
fixes#13163
i opted to just simply omit `Sized` entirely from go-to actions, as opposed to including it if even someone writes an explicit `T: Sized`, as i think a go-to on Sized is of dubious value practically.
feat: Highlight closure captures when cursor is on pipe or move keyword
This runs into the same issue on vscode as exit points for `->`, where highlights are only triggered on identifiers, https://github.com/rust-lang/rust-analyzer/issues/9395
Though putting the cursor on `move` should at least work.
chore: rust-analyzer: refactor notification handlers
Fixes the FIXME in `on_notification`.
```rust
// FIXME: Move these implementations out into a module similar to on_request
```
No code has changed, this just moves stuff around.
MIR episode 4
In lowering, it now supports overloaded and arith assignment binary operators, statics. and constants in patterns. There is now 252 functions that we fail to emit mir for them, and the majority of them are due type mismatches or other deep and unrelated issues (but it isn't done yet, for example slice patterns and destructing assignment is not implemented yet).
In evaluating, it now can evaluate associated constants in traits (so now typenum's `U5::ToConst` should work), allocator functions, atomic intrinsics, and some more things. It also provides a (hacky) basis for making progress in #14275. I also added a `Interpret` code lens to `Run` and `Debug` when the experimental `interpret tests` is enabled (previously it showed result in hover, which was unusable even for debugging)
Changes in unrelated files are:
* Changes substitutions of closures, now it includes parent substs ~~before~~ after `sig_ty`.
* ~~A salsa input for retrieving the path of a file id, used in emitting stack trace for interpret result.~~
* Normalizing associated types in layout computing
Deduplicate crates when extending crate graphs
This is quadratic in runtime per deduplication attempt, but I don't think that'll be a problem for the workload here. Don't be scared of the diff, the actual diff is +42 -22, the rest is tests and test data.
Fixes https://github.com/rust-lang/rust-analyzer/issues/14476
Remove proc-macro server command from the rust-analyzer binary
We dropped support for concrete proc-macro abi versions so this no longer serves any purposes.
Revert "Handle dev-dependency cycles"
Reverts rust-lang/rust-analyzer#14475
I managed to fix the problem that causes the metric failures, but this still severely degrades IDE features in a way that makes the user experience ***worse*** than before. I am not sure how to address this, I wonder what the jetbrains plugin is doing in these cases.
Handle dev-dependency cycles
cc https://github.com/rust-lang/rust-analyzer/issues/14167
This should fix cycles errors mostly (it fixes the one on rome/tools at least, but not on rustc. Though there it might just be because of rustc workspace being rustc workspace). Unfortunately this will effectively duplicate all crates currently, since if we want to be completely correct we'd need to set the test cfg for all dev dependencies and the transitive dependencies of those, something I worry we should try to avoid.