9734: semantic highlighting: add reference hlmod r=matklad a=jhgg
This PR adds the "reference" highlight modifier!
I basically went around and looked for `HlMod::Mutable` to find the callsites to add a reference. I think these all make sense!
Co-authored-by: Jake Heinz <jh@discordapp.com>
Co-authored-by: Jake <jh@discordapp.com>
9773: internal: Improve `extract_function` assist r=Veykril a=Veykril
- fix: It doesn't try to overwrite parts of selected comments any longer
- fix: It doesn't wrap tail expressions and return types in a result or option unnecessarily
- feat?: It now adds a `const` modifier to the created function if extract somethings from a const context
Fixes#7840
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
9771: Give better error message when the rust-analyzer binary path was set in the user's config but the binary is invalid r=matklad a=rylev
`@yoshuawuyts` and I ran into an issue where my rust-analyzer binary path was set in my extension config (which I didn't realize), but the path set in the config was invalid (it simply wasn't on my path). Having an error message that hinted that the binary's path was explicitly set in the config would have considerably shortened the debug time.
Thanks!
Co-authored-by: Ryan Levick <me@ryanlevick.com>
9764: fix: Don't use the module as the candidate node in fuzzy path flyimport r=Veykril a=Veykril
The problem was that the candidate node is whats being used for the scope, so using an inline module will yield the surrounding scope of the module instead of the scope of the module itself.
Also seems to fix the problem in this comment https://github.com/rust-analyzer/rust-analyzer/issues/9760#issuecomment-891125674, though I could not recreate that in a test for some reason.
Fixes#9760
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
9751: Make `LoadCargoConfig`, `fn load_workspace_at` & `fn load_workspace` public again r=matklad a=regexident
This [commit](b24f816c0d) which restricted the visibility of `LoadCargoConfig`, `fn load_workspace_at` & `fn load_workspace` unfortunately effectively rendered every crate/tool that uses rust-analyzer as a library dead in the water.
On of such tools is [cargo-modules](https://github.com/regexident/cargo-modules), a tool for generating tree/graph visualizations of one's Rust project and is powered by rust-analyzer as a library.
For more context see the PRs that introduced those types/functions and made them `pub`:
- https://github.com/rust-analyzer/rust-analyzer/pull/7595
- https://github.com/rust-analyzer/rust-analyzer/pull/7690
If kept as is rust-analyzer would effectively no longer be usable as a library.
cc `@SomeoneToIgnore`
Co-authored-by: Vincent Esche <regexident@gmail.com>