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

Dereferencing completions #18873

Closed
Veykril opened this issue Jan 7, 2025 · 7 comments
Closed

Dereferencing completions #18873

Veykril opened this issue Jan 7, 2025 · 7 comments
Labels
A-completion autocompletion C-feature Category: feature request

Comments

@Veykril
Copy link
Member

Veykril commented Jan 7, 2025

We currently have extra logic that duplicates completions with a (mutable) borrow if the expected type is a borrow but the completion's type is not. We should also have the inverse of that where we insert a deref * if the expected type is one dereference away from the completion's type and the expected type is Copy.

@Veykril Veykril added A-completion autocompletion C-feature Category: feature request labels Jan 7, 2025
@boattime
Copy link
Contributor

boattime commented Jan 9, 2025

For this feature, should ref_match and a new field deref_match be separate properties in CompletionItem? Or should we refactor ref_match to include both references and dereferences in a single property?

@ChayimFriedman2
Copy link
Contributor

I'd also be happy with completions that skip .await and iter() - RustRover does this.

@Veykril
Copy link
Member Author

Veykril commented Jan 9, 2025

For this feature, should ref_match and a new field deref_match be separate properties in CompletionItem? Or should we refactor ref_match to include both references and dereferences in a single property?

we can repurpose ref_match, we won't have a situation where both adding a ref and a deref would apply at the same time

@Veykril
Copy link
Member Author

Veykril commented Jan 9, 2025

I'd also be happy with completions that skip .await and iter() - RustRover does this.

skip? You mean it inserts those?

@ChayimFriedman2
Copy link
Contributor

I'd also be happy with completions that skip .await and iter() - RustRover does this.

skip? You mean it inserts those?

I meant that we e.g. complete filter_map() on Vec, and turn it into iter().filter_map(). Similar thing for .await.

@Veykril
Copy link
Member Author

Veykril commented Jan 9, 2025

Ah right, we have #15369 for the iterator ones

@lnicola
Copy link
Member

lnicola commented Jan 20, 2025

I think we can now close this.

@lnicola lnicola closed this as completed Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

4 participants