Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/inline_macro.rs')
-rw-r--r--crates/ide-assists/src/handlers/inline_macro.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/crates/ide-assists/src/handlers/inline_macro.rs b/crates/ide-assists/src/handlers/inline_macro.rs
index 3fc552306a..626f2060b2 100644
--- a/crates/ide-assists/src/handlers/inline_macro.rs
+++ b/crates/ide-assists/src/handlers/inline_macro.rs
@@ -254,4 +254,49 @@ fn f() { if true{}; }
"#,
)
}
+
+ #[test]
+ fn whitespace_between_text_and_pound() {
+ check_assist(
+ inline_macro,
+ r#"
+macro_rules! foo {
+ () => {
+ cfg_if! {
+ if #[cfg(test)] {
+ 1;
+ } else {
+ 1;
+ }
+ }
+ }
+}
+fn main() {
+ $0foo!();
+}
+"#,
+ r#"
+macro_rules! foo {
+ () => {
+ cfg_if! {
+ if #[cfg(test)] {
+ 1;
+ } else {
+ 1;
+ }
+ }
+ }
+}
+fn main() {
+ cfg_if!{
+ if #[cfg(test)]{
+ 1;
+ }else {
+ 1;
+ }
+};
+}
+"#,
+ );
+ }
}