rust-analyzer/crates/ide-db
bors da9c0bd0a7 Auto merge of #14442 - DropDemBits:structured-snippet-api, r=Veykril
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.
2023-04-05 14:33:30 +00:00
..
src Auto merge of #14442 - DropDemBits:structured-snippet-api, r=Veykril 2023-04-05 14:33:30 +00:00
Cargo.toml Support UTF-32 position encoding 2023-02-14 01:09:50 +00:00