mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-03 01:16:14 +03:00
Added tests for no auto-completion on comments
This commit is contained in:
@@ -1516,4 +1516,54 @@ fn go(world: &WorldSnapshot) {
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_keyword_autocompletion_on_line_comments() {
|
||||
assert_debug_snapshot!(
|
||||
do_completion(
|
||||
r"
|
||||
fn test() {
|
||||
let x = 2; // A comment<|>
|
||||
}
|
||||
",
|
||||
CompletionKind::Keyword
|
||||
),
|
||||
@r###"
|
||||
[]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_keyword_autocompletion_on_multi_line_comments() {
|
||||
assert_debug_snapshot!(
|
||||
do_completion(
|
||||
r"
|
||||
/*
|
||||
Some multi-line comment<|>
|
||||
*/
|
||||
",
|
||||
CompletionKind::Keyword
|
||||
),
|
||||
@r###"
|
||||
[]
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_keyword_autocompletion_on_doc_comments() {
|
||||
assert_debug_snapshot!(
|
||||
do_completion(
|
||||
r"
|
||||
/// Some doc comment
|
||||
/// let test<|> = 1
|
||||
",
|
||||
CompletionKind::Keyword
|
||||
),
|
||||
@r###"
|
||||
[]
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user