-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Diagnostics fixes - hopefully only the non-controversial parts #4187
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4187 +/- ##
==========================================
- Coverage 89.00% 88.96% -0.05%
==========================================
Files 34 34
Lines 4403 4404 +1
==========================================
- Hits 3919 3918 -1
- Misses 484 486 +2 |
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.
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.
FWIW fixes seem fine and not that controvertial
Reviewable status: 0 of 2 LGTMs obtained
…sert_mode == 0 Needed settings: let g:ycm_update_diagnostics_in_insert_mode = 0 let g:ycm_echo_current_diagnostic = 'virtual-text' Previously, whenever we should NOT display diagnostic UI, but diag message would not need clearing, we ended up echoing. Most noticable in the following example int main() { puts("")<CR> } Note that this first patch still leaves a diagnostic UI flicker on InsertLeave.
In case the current filetype language server uses LSP async diagnostics, we might not get a reparse on InsertLeave. This happens if the user leaves insert mode after a semantic trigger. We would still try sending a FileReadyToParse request, but the diags get ignored, because: a) The filetype is known to use async diags. b) We do not insist on a synchronous diag update, like :YcmDiags. The solution is to check if the current filetype uses async diagnostics and, if so, let InsertLeave refresh diagnostic UI regardless of what the state of FileReadyToParse request is. Note that this solution makes the flicker on leaving insert mode harder to fix. Not only does OnCursorMoved cause a refresh of stale diagnostics, but so does OnInsertLeave.
2292370
to
456b469
Compare
Tests added. No idea what codecov is talking about. |
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, 1 of 1 files at r2, all commit messages.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic)
Thanks for sending a PR! |
PR Prelude
Thank you for working on YCM! :)
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your PR:
rationale for why I haven't.
actually perform all of these steps.
Why this change is necessary and useful
This PR fixes two diagnostic bugs, makes one harder to solve and leaves one for later:
CursorMoved
, now byInsertLeave
too.I have tried fixing number 3, but all I could come up with were some heuristics which were always wrong in some case...
Are these changes still too controversial?
I will (try to) write the vim level tests when we agree about the way forward.
This change is