-
Notifications
You must be signed in to change notification settings - Fork 774
[READY] Print diagnostic code field #1239
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
Conversation
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.
Reviewed 2 of 2 files at r1.
Reviewable status: 1 of 2 LGTMs obtained
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.
Thanks for the PR. Looks good but I think it would be better to extend our diagnostic API with a code
field and do the formatting on the client side.
Reviewed 2 of 2 files at r1.
Reviewable status: 1 of 2 LGTMs obtained
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.
@micbou Does that really matter?
Reviewable status: 1 of 2 LGTMs obtained
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 don't think clients would benefit more in that case. Because I would expect all of them to simply append this to diag text. In addition to that it would also require clients to be modified as well, which makes things a little bit more complicated.
Reviewable status: 1 of 2 LGTMs obtained
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 tend to agree that just putting it in the text is fine. We have filtering etc. that applies only to the text.
However, it's not obvious to me why we're only doing this for non-floating-point errors. Wouldn't it be simpler to just always include it?
Reviewable status: 1 of 2 LGTMs obtained
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.
Reviewed 2 of 2 files at r1.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @kadircet)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
float( code ) except ValueError: # We are only interested in non-number codes.
why is that?
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.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
why is that?
IIRC, this is supposed to be presented to users, something like appending [-Wwarning-name]
to a diagnostic. If the name is some sort of number, because the server (stupidly) exposes internal IDs, we would end up appending [123]
. I can hear the confusion of the users going "WAT?".
In short, using numbers just adds verbosity, but doesn't provide any useful information.
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.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
IIRC, this is supposed to be presented to users, something like appending
[-Wwarning-name]
to a diagnostic. If the name is some sort of number, because the server (stupidly) exposes internal IDs, we would end up appending[123]
. I can hear the confusion of the users going "WAT?".In short, using numbers just adds verbosity, but doesn't provide any useful information.
unless the particular compiler/language uses numbers to represent error codes. I've seen plenty of those. Anyway i suppose we could revisit that if necessary.
Checking the specification, the type of 'message' is 'number | string', so this check rather than being "convertible" to string, should be "is-a" string, i.e. isinstance( code, str )
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.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @kadircet)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
unless the particular compiler/language uses numbers to represent error codes. I've seen plenty of those. Anyway i suppose we could revisit that if necessary.
Checking the specification, the type of 'message' is 'number | string', so this check rather than being "convertible" to string, should be "is-a" string, i.e.
isinstance( code, str )
I also believe @kadircet said JDT sends something like {"code": "123"}
, thus sending numbers as strings.
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.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
I also believe @kadircet said JDT sends something like
{"code": "123"}
, thus sending numbers as strings.
yes, IIRC there were breakages inside jdt.ls tests, since they were representing numbers with strings.
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.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic and @kadircet)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, kadircet (kadir çetinkaya) wrote…
yes, IIRC there were breakages inside jdt.ls tests, since they were representing numbers with strings.
Are we sure that the numbers are not useful/meaningful to java developers ? Would users not want to use those numbers for filtering ?
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.
they looked arbitrary with 8+ digits, I am not sure anyone has that good memory :D
I just thought it might annoy users to see those digits, but it is totally ok for me to surface them as well
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic and @kadircet)
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.
OK well let's go with this and we can expand later if there's a request to.
Reviewable status:
complete! 2 of 2 LGTMs obtained (waiting on @bstaletic and @kadircet)
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.
Reviewable status:
complete! 2 of 2 LGTMs obtained (waiting on @bstaletic and @kadircet)
@kadircet can you rebase and push the PR ? It still has the old CI system on the commit checks ! |
d77b729
to
7ad9f3e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1239 +/- ##
==========================================
+ Coverage 97.14% 97.18% +0.04%
==========================================
Files 95 96 +1
Lines 7343 7243 -100
Branches 153 0 -153
==========================================
- Hits 7133 7039 -94
- Misses 169 204 +35
+ Partials 41 0 -41 |
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #1239 +/- ##
==========================================
+ Coverage 97.14% 97.18% +0.04%
==========================================
Files 95 96 +1
Lines 7343 7243 -100
Branches 153 0 -153
==========================================
- Hits 7133 7039 -94
- Misses 169 204 +35
+ Partials 41 0 -41 |
Tests are failing on RLS |
yup just saw. I believe rust was not merged when I've written the patch? They appear to be reporting codes like 'E0609', I have no idea whether they are meaningful or not. Anyone knows if these are worth keeping ? |
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.
@theli-ua Can you make sense of diagnostic code E0609
?
Reviewed 2 of 2 files at r2.
Reviewable status: 0 of 2 LGTMs obtained (and 2 stale) (waiting on @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
Are we sure that the numbers are not useful/meaningful to java developers ? Would users not want to use those numbers for filtering ?
Filtering! That might be a good reason to just flat out pass anything, even [123]
.
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.
Reviewable status: 0 of 2 LGTMs obtained (and 2 stale) (waiting on @bstaletic and @kadircet)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
Filtering! That might be a good reason to just flat out pass anything, even
[123]
.
Yeah.. that was my point :)
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.
Reviewable status: 0 of 2 LGTMs obtained (and 2 stale) (waiting on @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
Yeah.. that was my point :)
@kadircet Is there any problem with just always adding the code
to the diagnostic? It would make it much easier for users to filter diagnostics if they need to and it would fix the tests.
7ad9f3e
to
a7473f7
Compare
Codecov Report
@@ Coverage Diff @@
## master #1239 +/- ##
=========================================
Coverage ? 97.18%
=========================================
Files ? 96
Lines ? 7243
Branches ? 0
=========================================
Hits ? 7039
Misses ? 204
Partials ? 0 |
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.
Reviewable status: 0 of 2 LGTMs obtained (and 2 stale) (waiting on @bstaletic and @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2181 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
@kadircet Is there any problem with just always adding the
code
to the diagnostic? It would make it much easier for users to filter diagnostics if they need to and it would fix the tests.
Done
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 tests fail, a rebase will be necessary, but otherwise
Reviewed 3 of 3 files at r3.
Reviewable status: 1 of 2 LGTMs obtained (and 1 stale) (waiting on @puremourning)
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.
Reviewable status: 1 of 2 LGTMs obtained (and 1 stale) (waiting on @kadircet and @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2244 at r3 (raw file):
try: code = diag[ 'code' ] diag_text += " [" + code + "]"
code
needs to be str( code )
a7473f7
to
0c09ae0
Compare
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.
Reviewable status: 1 of 2 LGTMs obtained (and 1 stale) (waiting on @bstaletic and @puremourning)
ycmd/completers/language_server/language_server_completer.py, line 2244 at r3 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
code
needs to bestr( code )
Done.
Latest master should be more flake-free. So maybe one more rebase ? |
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.
Reviewed 1 of 3 files at r3, 3 of 3 files at r4.
Reviewable status:complete! 2 of 2 LGTMs obtained (waiting on @bstaletic)
0c09ae0
to
328f023
Compare
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.
Reviewed 2 of 2 files at r5.
Reviewable status:complete! 2 of 2 LGTMs obtained (waiting on @bstaletic)
Thanks for sending a PR! |
1 similar comment
Thanks for sending a PR! |
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
Clangd started populating diagnostic's code field with relevant information with https://reviews.llvm.org/D60822 and https://reviews.llvm.org/D58291.
This patch aims to surface that information to ycmd users, as vscode does.
This change is