mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Make extract_expressions_from_format_string
only use snippets when available
This commit is contained in:
parent
e989f22015
commit
cf9401049c
3 changed files with 98 additions and 55 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue