6750: Remove documentation query, move doc handling to attributes r=matklad a=Veykril
Fixes#3182
Removes the documentation query in favor of `Attrs::docs`. Attrs already handlded doc comments partially but the alloc saving check was wrong so it only worked when other attributes existed as well. Unfortunately the `new` constructor has to do an intermediate allocation now because we need to keep the order of mixed doc attributes and doc comments.
I've also partially adjusted the `hover` module to have its tests check the changes, it still has some `HasSource` trait usage due to the `ShortLabel` trait usage, as that is only implemented on the Ast parts and not the Hir, should this ideally be implemented for the Hir types as well?(would be a follow up PR of course)
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6754: Apply environment set by build scripts r=jonas-schievink a=jonas-schievink
Fixes inclusion of generated files in typenum/heapless/defmt etc.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6752: Pass `--target` when loading out dirs from check r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6719: Use items can also have doc comments r=matklad a=Veykril
Prior to this change modules show more docs than they have cause they inherit the docs from documented use items inside of them.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6751: Use the right `def_crate` for builtin macros r=jonas-schievink a=jonas-schievink
Fixes the incorrect macro resolution in https://github.com/rust-analyzer/rust-analyzer/issues/6716
No test, because diagnostics do not get remapped correctly for some reason. I've checked manually that this fixes the resolution errors.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6745: Some more proc macro cleanups r=jonas-schievink a=jonas-schievink
* Remove `ProcMacroClient::dummy` and just use `Option<ProcMacroClient>` instead
* Remember the type of proc macros (later allows us to reject using an incorrect macro type)
* Prepare a few internals for procedural attribute macros
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6743: Don't insert blank lines between doc attributes r=Veykril a=Veykril
Fixes#6742.
Doc attributes should be concatenated via a single linebreak as written in the [rustdoc book](https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html).
Also changed the loop to use an iterator to get rid of the `docs.trim_end_matches("\n\n").to_owned()` part using `Itertools::intersperse`.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>