-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Changes from all commits
a5dad01
eb20136
4740d3e
82be54f
2512d7f
3967911
d58c5c4
8253a7a
5017f40
aa22e17
410200b
85f5049
cbd064a
1801323
dc00590
ac8b366
4f77eb2
f259384
e730e1d
1fb5bec
6ea6488
08bf99f
fbb850b
2efad74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,8 @@ enum MessageStyle : ubyte | |
| { | ||
| digitalmars, /// filename.d(line): message | ||
| gnu, /// filename.d:line: message, see https://www.gnu.org/prep/standards/html_node/Errors.html | ||
| sarif /// JSON SARIF output, see https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html | ||
| 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 | ||
|
Comment on lines
+26
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also you will probably have to update
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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,
};
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
| } | ||
| /** | ||
| A source code location | ||
|
|
@@ -228,6 +229,8 @@ void writeSourceLoc(ref OutBuffer buf, | |
| case MessageStyle.sarif: // https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html | ||
| // No formatting needed here for SARIF | ||
| break; | ||
| case MessageStyle.lsp: // lsp-style error messages | ||
| break; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| REQUIRED_ARGS: -verror-style=lsp | ||
| TEST_OUTPUT: | ||
| --- | ||
| { | ||
| "severity":"Error", | ||
| "uri":"fail_compilation/diag21979.d", | ||
| "line:":27, | ||
| "column":12, | ||
| "description":"return value `"hi"` of type `string` does not match return type `int`, and cannot be implicitly converted", | ||
| } | ||
| --- | ||
| */ | ||
|
|
||
| int num(int a) | ||
| { | ||
| return "hi"; | ||
| } | ||
| void main() | ||
| { | ||
| int ch = num(5); | ||
| writeln(ch); | ||
| } |
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