Make extract_expressions_from_format_string only use snippets when available

This commit is contained in:
DropDemBits 2024-03-04 20:33:15 -05:00
parent e989f22015
commit cf9401049c
No known key found for this signature in database
GPG key ID: 7FE02A6C1EDFA075
3 changed files with 98 additions and 55 deletions

View file

@ -338,6 +338,12 @@ impl SourceChangeBuilder {
self.add_snippet(PlaceSnippet::Over(node.syntax().clone().into()))
}
/// Adds a snippet to move the cursor selected over `token`
pub fn add_placeholder_snippet_token(&mut self, _cap: SnippetCap, token: SyntaxToken) {
assert!(token.parent().is_some());
self.add_snippet(PlaceSnippet::Over(token.into()))
}
/// Adds a snippet to move the cursor selected over `nodes`
///
/// This allows for renaming newly generated items without having to go