File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
crates/ide-completion/src Expand file tree Collapse file tree 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> {
581581 return None ;
582582 }
583583
584- // has 3 colon in a row
584+ // has 3 colon or 2 coloncolon in a row
585585 // 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+ {
587592 return None ;
588593 }
589594 }
Original file line number Diff line number Diff line change @@ -967,11 +967,17 @@ fn foo { crate:$0 }
967967}
968968
969969#[ test]
970- fn no_completions_in_after_tripple_colon ( ) {
970+ fn no_completions_in_invalid_path ( ) {
971971 check (
972972 r#"
973973fn foo { crate:::$0 }
974974"# ,
975975 expect ! [ "" ] ,
976976 ) ;
977+ check (
978+ r#"
979+ fn foo { crate::::$0 }
980+ "# ,
981+ expect ! [ "" ] ,
982+ )
977983}
You can’t perform that action at this time.
0 commit comments