File tree 2 files changed +14
-3
lines changed
crates/ide-completion/src
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -581,9 +581,14 @@ impl<'a> CompletionContext<'a> {
581
581
return None ;
582
582
}
583
583
584
- // has 3 colon in a row
584
+ // has 3 colon or 2 coloncolon in a row
585
585
// special casing this as per discussion in https://github.com/rust-lang/rust-analyzer/pull/13611#discussion_r1031845205
586
- if prev_token. prev_token ( ) . map ( |t| t. kind ( ) == T ! [ : ] ) . unwrap_or ( false ) {
586
+ // and https://github.com/rust-lang/rust-analyzer/pull/13611#discussion_r1032812751
587
+ if prev_token
588
+ . prev_token ( )
589
+ . map ( |t| t. kind ( ) == T ! [ : ] || t. kind ( ) == T ! [ :: ] )
590
+ . unwrap_or ( false )
591
+ {
587
592
return None ;
588
593
}
589
594
}
Original file line number Diff line number Diff line change @@ -967,11 +967,17 @@ fn foo { crate:$0 }
967
967
}
968
968
969
969
#[ test]
970
- fn no_completions_in_after_tripple_colon ( ) {
970
+ fn no_completions_in_invalid_path ( ) {
971
971
check (
972
972
r#"
973
973
fn foo { crate:::$0 }
974
974
"# ,
975
975
expect ! [ "" ] ,
976
976
) ;
977
+ check (
978
+ r#"
979
+ fn foo { crate::::$0 }
980
+ "# ,
981
+ expect ! [ "" ] ,
982
+ )
977
983
}
You can’t perform that action at this time.
0 commit comments