mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Simplify
This commit is contained in:
parent
822d9b55b7
commit
26fef97d59
3 changed files with 16 additions and 10 deletions
|
@ -20,7 +20,7 @@ fn render(
|
|||
name: hir::Name,
|
||||
macro_: hir::Macro,
|
||||
) -> Builder {
|
||||
let source_range = if completion.is_immediately_after_macro_bang() {
|
||||
let source_range = if ctx.is_immediately_after_macro_bang() {
|
||||
cov_mark::hit!(completes_macro_call_if_cursor_at_bang_token);
|
||||
completion.token.parent().map_or_else(|| ctx.source_range(), |it| it.text_range())
|
||||
} else {
|
||||
|
@ -52,7 +52,7 @@ fn render(
|
|||
|
||||
let name = &*name;
|
||||
match ctx.snippet_cap() {
|
||||
Some(cap) if needs_bang && !completion.path_is_call() => {
|
||||
Some(cap) if needs_bang && !ctx.path_is_call() => {
|
||||
let snippet = format!("{}!{}$0{}", name, bra, ket);
|
||||
let lookup = banged_name(name);
|
||||
item.insert_snippet(cap, snippet).lookup_by(lookup);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue