-
Notifications
You must be signed in to change notification settings - Fork 834
Further optimize the rich style of diagnostic message #19141
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
base: main
Are you sure you want to change the base?
Conversation
❗ Release notes required
|
1afdee9 to
bd92cbf
Compare
| // 'true' for "canSuggestNames" is passed last here because we want to report suggestions in fsc.exe and fsi.exe, just not in regular IDE usage. | ||
| let diagnostics = CollectFormattedDiagnostics(tcConfig, severity, diagnostic, true) | ||
|
|
||
| let renderRich (details: FormattedDiagnosticDetailedInfo) = |
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.
We have grown to a non-trivial amount of logic now.
This should now have dedicated tests showing the various aspects of the feature in place.
(as an inspiration, look how existing "help" function exercise the compiler to print help and then assert on exact matching compiler output - that might work well. Other test suites typically do not focus on the formatting of diagnostics and instead use F# data to assert them, so e.g. ComponentTests style will not be much applicable for this feature)
| // 'true' for "canSuggestNames" is passed last here because we want to report suggestions in fsc.exe and fsi.exe, just not in regular IDE usage. | ||
| let diagnostics = CollectFormattedDiagnostics(tcConfig, severity, diagnostic, true) | ||
|
|
||
| let renderRich (details: FormattedDiagnosticDetailedInfo) = |
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.
If this does not need any environmental information and it only takes the details object, you can also consider extracting this to a separate standalone function and test it in isolation.
Description
This is some simple optimization work for #17488. On the basis of optimizing the style, the standard path format has been retained ^_^
Checklist
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: