From 037e02c08da80f25a6e0ddac06b36adac93f2076 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 12 Sep 2019 00:02:07 +0300 Subject: Complete macros parenthesis --- .../src/completion/complete_macro_in_item_position.rs | 2 +- crates/ra_ide_api/src/completion/complete_path.rs | 2 +- crates/ra_ide_api/src/completion/complete_scope.rs | 12 ++++++------ crates/ra_ide_api/src/completion/presentation.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'crates') diff --git a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs b/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs index 708dc9777..dfba97f17 100644 --- a/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs +++ b/crates/ra_ide_api/src/completion/complete_macro_in_item_position.rs @@ -40,7 +40,7 @@ mod tests { label: "foo", source_range: [46; 46), delete: [46; 46), - insert: "foo!", + insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 31e7dffe8..465edf6dd 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -608,7 +608,7 @@ mod tests { label: "foo", source_range: [179; 179), delete: [179; 179), - insert: "foo!", + insert: "foo!($0)", kind: Macro, detail: "#[macro_export]\nmacro_rules! foo", }, diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs index 2062e7300..7380d8508 100644 --- a/crates/ra_ide_api/src/completion/complete_scope.rs +++ b/crates/ra_ide_api/src/completion/complete_scope.rs @@ -571,7 +571,7 @@ mod tests { label: "bar", source_range: [252; 252), delete: [252; 252), - insert: "bar!", + insert: "bar!($0)", kind: Macro, detail: "macro_rules! bar", }, @@ -579,7 +579,7 @@ mod tests { label: "baz", source_range: [252; 252), delete: [252; 252), - insert: "baz!", + insert: "baz!($0)", kind: Macro, detail: "#[macro_export]\nmacro_rules! baz", }, @@ -587,7 +587,7 @@ mod tests { label: "foo", source_range: [252; 252), delete: [252; 252), - insert: "foo!", + insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, @@ -637,7 +637,7 @@ mod tests { label: "foo", source_range: [49; 49), delete: [49; 49), - insert: "foo!", + insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, @@ -673,7 +673,7 @@ mod tests { label: "foo", source_range: [57; 57), delete: [57; 57), - insert: "foo!", + insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, @@ -709,7 +709,7 @@ mod tests { label: "foo", source_range: [50; 50), delete: [50; 50), - insert: "foo!", + insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 1b706bb13..1995e8971 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs @@ -114,7 +114,7 @@ impl Completions { .kind(CompletionItemKind::Macro) .set_documentation(macro_.docs(ctx.db)) .detail(detail) - .insert_snippet(format!("{}!", name)); + .insert_snippet(format!("{}!($0)", name)); self.add(builder); } -- cgit v1.2.3