Skip to content
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

fix: record completion filtering #13028

Merged
merged 1 commit into from
Aug 16, 2022
Merged

Conversation

yue4u
Copy link
Contributor

@yue4u yue4u commented Aug 15, 2022

close #12975

@@ -94,3 +94,12 @@ pub(crate) fn format_literal_label(name: &str, kind: StructKind) -> SmolStr {
StructKind::Unit => name.into(),
}
}

/// Format a struct, etc. literal option for lookup used in completions filtering.
pub(crate) fn format_literal_lookup(name: &str, kind: StructKind) -> SmolStr {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

() and {} are still needed as current testing infra does not allow duplicated lookup.

let (completion,) = completions
.iter()
.filter(|it| it.lookup() == what)
.collect_tuple()
.unwrap_or_else(|| panic!("can't find {:?} completion in {:#?}", what, completions));

I guess IDEs will happily accept duplicated lookup? Anyway these extra parentheses and brackets also allow completing something like E{ so I'd prefer to keep them here.

@jonas-schievink
Copy link
Contributor

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 16, 2022

📌 Commit 91358bd has been approved by jonas-schievink

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 16, 2022

⌛ Testing commit 91358bd with merge b6fae56...

@bors
Copy link
Collaborator

bors commented Aug 16, 2022

☀️ Test successful - checks-actions
Approved by: jonas-schievink
Pushing b6fae56 to master...

@bors bors merged commit b6fae56 into rust-lang:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong record completion after match
3 participants