Modernize qual path completion tests

This commit is contained in:
Aleksey Kladov 2020-07-04 18:53:30 +02:00
parent 824a24c710
commit c14a3b4a20
3 changed files with 464 additions and 1094 deletions

View file

@ -2,6 +2,9 @@ mod completion_config;
mod completion_item;
mod completion_context;
mod presentation;
mod patterns;
#[cfg(test)]
mod test_utils;
mod complete_attribute;
mod complete_dot;
@ -15,9 +18,6 @@ mod complete_unqualified_path;
mod complete_postfix;
mod complete_macro_in_item_position;
mod complete_trait_impl;
mod patterns;
#[cfg(test)]
mod test_utils;
use ra_ide_db::RootDatabase;

File diff suppressed because it is too large Load diff

View file

@ -683,6 +683,57 @@ impl S {
},
]
"#]],
);
check(
r#"
use self::my<|>;
/// mod docs
mod my { }
/// enum docs
enum E {
/// variant docs
V
}
use self::E::*;
"#,
expect![[r#"
[
CompletionItem {
label: "E",
source_range: 10..12,
delete: 10..12,
insert: "E",
kind: Enum,
documentation: Documentation(
"enum docs",
),
},
CompletionItem {
label: "V",
source_range: 10..12,
delete: 10..12,
insert: "V",
kind: EnumVariant,
detail: "()",
documentation: Documentation(
"variant docs",
),
},
CompletionItem {
label: "my",
source_range: 10..12,
delete: 10..12,
insert: "my",
kind: Module,
documentation: Documentation(
"mod docs",
),
},
]
"#]],
)
}