mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Modernize qual path completion tests
This commit is contained in:
parent
824a24c710
commit
c14a3b4a20
3 changed files with 464 additions and 1094 deletions
|
@ -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
|
@ -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",
|
||||
),
|
||||
},
|
||||
]
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue