-
-
Notifications
You must be signed in to change notification settings - Fork 661
Implementation of LSP format for diagnostics in dmd #21979
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: master
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request and interest in making D better, @Iskaban10! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#21979" |
thewilsonator
left a comment
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.
it seems it would be good idea to refactor
if (global.params.v.messageStyle == MessageStyle.lsp)
{
printLSPDiagnostic(format, ap, info);
return;
}
if (global.params.v.messageStyle == MessageStyle.sarif)
{
addSarifDiagnostic(loc, format, ap, kind);
return;
}
printDiagnostic(format, ap, info);
and make printDiagnostic take the message style as an argument
|
|
||
| void vdeprecationSupplemental(Loc loc, const(char)* format, va_list ap) { } | ||
| } | ||
| } |
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.
leave to newline at EOF in place
| sarif, /// JSON SARIF output, see https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html | ||
| lsp /// JSON output in Language Server protocol format |
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.
also you will probably have to update frontend.h with this change, see the CircleCI failure
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.
Like this in frontend.h?
enum class MessageStyle : uint8_t
{
digitalmars = 0u,
gnu = 1u,
sarif = 2u,
lsp = 3u,
};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.
yes
|
Thanks for the review @thewilsonator. Will make the changes. |
| { | ||
| int ch = num(5); | ||
| writeln(ch); | ||
| } No newline at end of file |
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.
new line at end of file
No description provided.