Support generic function in `generate_function` assist
Part of #3639
This PR adds support for generic function generation in `generate_function` assist. Now the assist looks for generic parameters and trait bounds in scope, filters out irrelevant ones, and generates new function with them.
See `fn_generic_params()` for the outline of the procedure, and see comments on `filter_unnecessary_bounds()` for criteria for filtering. I think it's good criteria for most cases, but I'm open to opinions and suggestions.
The diff is pretty big, but it should run in linear time w.r.t. the number of nodes we operate on and should be fast enough.
Some notes:
- When we generate function in an existing impl, generic parameters may cause name conflict. While we can detect the conflict and rename conflicting params, I didn't find it worthwhile mainly because it's really easy to resolve on IDE: use Rename functionality.
- I've implemented graph structure myself, because we don't have graph library as a dependency and we only need the simplest one.
- Although `petgraph` is in our dependency graph and I was initially looking to use it, we don't actually depend on it AFAICT since it's only used in chalk's specialization graph handling, which we don't use. I'd be happy to replace my implementation with `petgraph` if it's okay to use it though.
- There are some caveats that I consider out of scope of this PR. See FIXME notes on added tests.
Expand docs section on Visual Studio to mention all three available extensions
A recent PR (#14012) by `@parthopdas` added mention of rust-analyzer.vs, his extension for Visual Studio 2022. I am submitting this PR to request that our extension (SourceGear Rust) be mentioned in that section as well, and also, for completeness, the VS_RustAnalyzer extension, by `@cchharris.`
Our extension is closed source, so I have clearly disclosed that. For consistency, I included brief mention of the licenses for the other two options as well. Also for the sake of consistency, I added marketplace and GitHub links for all 3.
The previously added paragraph by `@parthopdas` about his extension has been left intact.
minor: Bump `zip` to avoid `time-macros`
This fixes the compile time regression in #13876 and sneaks in two typo fixes spotted by `@cuishuang` (sorry for not preserving the commit attribution, but it's a little hard to manage it across repositories).
Make tt generic over the span data
This also fixes up our delimiter representation in tt, it is no longer optional (we use invisible delims in the same way as before, that is still incorrectly) and we now store two spans instead of one.
These changes should help with adjusting our token map. Though this will probably break proc-macros in some ways, will need to test that for now.
feat: Remove support for 1.58 proc-macro abi
This seems old enough that we can drop the support for it now, the less ABIs we have the less work it is adjusting our span implementation.
Extracted from https://github.com/rust-lang/rust-analyzer/pull/14061, will rebase that over this once merged.
feat: Improve "match to let else" assist
Closes https://github.com/rust-lang/rust-analyzer/issues/13540
Handles complex `let` patterns (rather than just idents), and diverging block expressions have their `{`/`}` stripped to create nicer code.