10865: internal: Use the right `ItemTree` when re-resolving attr r=jonas-schievink a=jonas-schievink
Followup to https://github.com/rust-analyzer/rust-analyzer/pull/10863, which caused a panic when analyzing diesel
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
10824: project_model: print full cargo command if cargo metadata fails to run r=Veykril a=jhgg
well, `Command` implements a sensible `Debug` which *roughly* does what we want to do. Unfortunately it's got a bit of a quote situation,
So it'd output something like `"cargo" "metadata" "--format-version" "1" "--features" "foo,bar,baz"`.
Which although is a bit verbose with the quotes, it's at the very least, not entirely incorrect/misleading.
fixes#10797
Co-authored-by: Jake Heinz <jh@discordapp.com>
10847: fix: derive attr path handling in `replace_derive_with_manual_impl` r=rainy-me a=rainy-me
partially fixes#10666
renaming issues mentioned in https://github.com/rust-analyzer/rust-analyzer/issues/10666#issuecomment-955671021 doesn't seem to be fixable at this moment since it's not searchable?(not recorded?) by name.
<del>I'm not sure if it's appropriate to move `parse_comma_sep_paths` function to a method in `ast/node_ext`, maybe `ide_db::helpers` also make sense.</del> put into `ide_db::` instead.
Co-authored-by: rainy-me <github@yue.coffee>
10846: fix: qualify struct name in struct constructor completion r=Veykril a=andrewleverette
* Alter `add_struct_literal` method signature to take an optional module path
* Update `render_literal` method to use a qualified
Relates to issue #10771
Side note: This is my first contribution. Any feedback is welcome!
Co-authored-by: Andrew Leverette <andrewleverette@gmail.com>
10840: fix: Omit generic defaults for types in hover messages r=jonas-schievink a=Veykril
Fixes#9198
We have ranged hovers now which query specifically for the type of an expression/pattern, so if interested in seeing the default, the user can use that functionality instead.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
10834: Make lint groups work correctly with `warningsAsInfo` and `warningsAsHint` r=Veykril a=Emilgardis
this change makes it possible to specify
```json
{
"rust-analyzer.diagnostics.warningsAsInfo": ["unused"],
}
```
to make all lints in the `unused` group show as info, etc.
Co-authored-by: Emil Gardström <emil.gardstrom@gmail.com>
10809: fix: don't discard formatting of `use` lines r=Veykril a=iDawer
Use mutable syntax trees in `merge_imports`, `split_imports`. This tries to resolve#9013. But I haven't much managed to simplify code of merging.
Also resolve#9361. It reuses a use tree under the cursor so that comments+indentation are preserved. Merged trees are just appended to the end.
This touches bunch of tests. I removed the sorting of use trees as it needs a proper implementation that takes into account comments and line wrapping. I think it is rustfmt's job or at least until we get a close implementation.
Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
10832: internal: Split parts of `ide_db::call_info` off into `ide` r=Veykril a=Veykril
`call_info` itself is just an ide feature and thus should not reside in `ide_db` itself.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>