Specifically, when a rename of a local will change some code that refers it to refer another local, or some code that refer another local to refer to it.
We do it by introducing a dummy edit with an annotation. I'm not a fond of this approach, but I don't think LSP has a better way.
This is required to format evaluated consts, because we need trait env, and it needs the crate (currently it uses the last crate in topological order, which is wrong, the next commit will fix that).
I added it by mistake in #18927.
I chose to keep the method as not static, because it's more comfortable, and keep the name `add_reference()` and not `reference()`, because it is clearer and better matches `strip_reference[s]()`.
Split manual.adoc into markdown files, one for each chapter.
For the parts of the manual that are generated from source code doc
comments, update the comments to use markdown syntax and update the
code generators to write to `generated.md` files.
For the weekly release, stop copying the .adoc files to the
`rust-analyzer/rust-analyzer.github.io` at release time. Instead,
we'll sync the manual hourly from this repository.
See https://github.com/rust-analyzer/rust-analyzer.github.io/pull/226
for the sync. This PR should be merged first, and that PR needs to be
merged before the next weekly release.
This change is based on #15795, but rebased and updated. I've also
manually checked each page for markdown syntax issues and fixed any I
encountered.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Josh Rotenberg <joshrotenberg@gmail.com>
Previously, we'd suggest a type of `vec` for a value of type `Vec<T>`,
which is rarely what the user wants. We also had no suggestions for
values of type `&[T]`.
Instead, try to pluralise the inner type name, and fall back to
`items`.
And not just called to be listed.
This was a major performance hang when repeatedly switching back-and-forth between a large `include!`d file (but there are others)..
`make::match_arm` should take a single `ast::Pat`, and callers can handle creating an `ast::OrPat` if need be. It should also take a proper `ast::MatchGuard`, instead of making one itself.