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: Add quick fix for undersolved field diagnostic #16762

Merged
merged 4 commits into from
Mar 11, 2024

Conversation

wyatt-herkamp
Copy link
Contributor

Adds an AssistKind::QuickFix for unresolved field.

Currently, Snippets are not available for Diagnostics. So the type defaults to the Unit type if the type is not able to be inferred.

2024-03-05.08-01-15.mp4

Closes #4563

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 5, 2024
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Some tests would be nice to add (to check if the quickfix is available, the lines with 💡 mark those that have fixes available)

crates/ide-diagnostics/src/handlers/unresolved_field.rs Outdated Show resolved Hide resolved
crates/ide-diagnostics/src/handlers/unresolved_field.rs Outdated Show resolved Hide resolved
crates/ide-diagnostics/src/handlers/unresolved_field.rs Outdated Show resolved Hide resolved
crates/ide-diagnostics/src/handlers/unresolved_field.rs Outdated Show resolved Hide resolved
crates/ide-diagnostics/src/handlers/unresolved_field.rs Outdated Show resolved Hide resolved
crates/ide-diagnostics/src/handlers/unresolved_field.rs Outdated Show resolved Hide resolved
@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 6, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@Veykril
Copy link
Member

Veykril commented Mar 11, 2024

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Mar 11, 2024

📌 Commit 4f0bc1a has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 11, 2024

⌛ Testing commit 4f0bc1a with merge a58f574...

@bors
Copy link
Contributor

bors commented Mar 11, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing a58f574 to master...

@bors bors merged commit a58f574 into rust-lang:master Mar 11, 2024
11 checks passed
@lnicola lnicola changed the title Added QuickFix for unresolved field. fix: Add quick fix for undersolved field diagnostic Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assist: create field in struct definition
4 participants