Skip to content

fix: filter unnecessary completions after colon #13611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remove insufficient check for coloncolon
  • Loading branch information
yue4u committed Nov 19, 2022
commit 7a568f7f9571c2c93fd8e60712878736d942c787
3 changes: 0 additions & 3 deletions crates/ide-completion/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,6 @@ impl<'a> CompletionContext<'a> {
return None;
}
}
T![::] if !is_prev_token_valid_path_start_or_segment(&original_token) => {
return None;
}
_ => {}
}

Expand Down
7 changes: 0 additions & 7 deletions crates/ide-completion/src/tests/special.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,13 +977,6 @@ fn foo { crate:::$0 }
check(
r#"
fn foo { crate::::$0 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait, we no longer catch this because the token here is a :: again right? Let's add that to the check as well as it is simple, I forgot that :) That is, t.kind() == T![:] || t.kind() == T![::] for the previous token check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 1ca5cb7

"#,
expect![""],
);

check(
r#"
fn foo { crate:::::$0 }
"#,
expect![""],
);
Expand Down