fix: when running the "discoverProjectCommand", use the Rust file's parent directory instead of the workspace folder
This is a quick fix to allow the `discoverProjectCommand` to run successfully when the user has a workspace that does not, e.g., have a `.buckconfig` defined.
(It's also probably _more correct_ to set the `pwd` of the command to the parent of the Rust file _anyways_ rather than relying on the workspace folders, which may be entirely unrelated.)
Compute closure captures
This PR:
* Computes closure captures and the trait it implements (Fn, FnMut or FnOnce)
* Computes data layout of closures
* Adds support for closure MIR lowering
* Changes the closure type display from `|arg1: ty1, arg2: ty| -> ret` to `impl FnX(arg1: ty1, arg2: ty2) -> ret`
fix#12297
fix: unify types in `infer_expr_coerce_never()`
Fixes#14506#14506 turned out to be a regression in type inference. `infer_expr_coerce_never()` added in #14251 allows never-to-any coercion but should also perform ordinary type unification in other cases.
Drop support for non-syroot proc macro ABIs
This makes some bigger changes to how we handle the proc-macro-srv things, for one it is now an empty crate if built without the `sysroot-abi` feature, this simplifies some things dropping the need to put the feature cfg in various places. The cli wrapper now actually depends on the server, instead of being part of the server that is just exported, that way we can have a true dummy server that just errors on each request if no sysroot support was specified.
minor: Fix some simple FIXMEs
Each FIXME fix has been split into its own commit, since they're all pretty independent changes.
(Forgot to open a PR for this a few days ago, oops)
internal: Implement Structured API for snippets
Fixes#11638 (including moving the cursor before the generated type parameter)
Adds `add_tabstop_{before,after}` for inserting tabstop snippets before & after nodes, and `add_placeholder_snippet` for wrapping nodes inside placeholder nodes.
Currently, the snippets are inserted into the syntax tree in `SourceChange::commit` so that snippet bits won't interfere with syntax lookups before completing a `SourceChange`.
It would be preferable if snippet rendering was deferred to after so that rendering can work directly with text ranges, but have left that for a future PR (it would also make it easier to finely specify which text edits have snippets in them).
Another possible snippet variation to support would be a group of placeholders (i.e. placeholders with the same tabstop number) so that a generated item and its uses can be renamed right as it's generated, which is something that is technically supported by the current snippet hack in VSCode, though it's not clear if that's a thing that is officially supported.