Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Show error and warning indicators in project panel items #18182
Show error and warning indicators in project panel items #18182
Changes from 16 commits
9116e13
993c727
09bb386
5dd0f94
bc64eb2
18085fa
4bebe91
0761d36
d1b3217
eaa0937
cddc98e
53f07c5
108ccf2
492de1f
ae949b5
15c4495
edbb6c6
dcec8e3
96e6536
026510e
370362a
c22e70f
3b2c990
0ffa167
3671a10
009db72
49cb5d1
fc15825
52bb56e
7b6f663
37b1f49
a2b51d3
73d1334
88573c5
06cb366
2f3b8f3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what default setting do you prefer? With the Icons I actually prefer "all"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but I'd use a
match
statement:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually change these two functions to be a single function that returns
(Color, Option<IconName>)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to restructure the code so you could always call
this.update_diagnostics(cx)
in case the value changed. Sinceupdate_diagnostics
already resets the diagnostics, the rest of it would only need to be restructured so it only adds diagnostics based on the settings (which it already kinda does by usingshow_warnings
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better here to store everything in a local HashMap first and assign the local variable at the end to
self.diagnostics
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that's how I'd do it, would make the code nicer, IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This here is necessary to also include the root directory of the worktree. We need the empty buffer in the HashMap as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can using
end_slot
in here