-
Notifications
You must be signed in to change notification settings - Fork 273
Add function and plug mappings to cycle diagnostics #1075
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
9ea33b3 to
28dd20f
Compare
|
@autozimu I'm not 100% sure if I missed something and there's already something in place for this or if this is in fact a missing feature, so I'll this for you to comment on and then I'll merge it if there aren't any functions that provide this functionality. |
|
I personally use quickfix to display diagnostics (the default) with |
|
Not quite. The only bit that I find difficult with that workflow is that the items in the location/quickfix list are (logically) not re-sorted every time you move the cursor, so the "next" item in the location list is not really the next diagnostic based on the position of the cursor, which makes navigation a little difficult if you have many diagnostics. It can also be a little surprising, if you have the location list closed and do Another thing is that diagnostics do not seem to be ordered by line number in the location/quickfix list, maybe that can be solved though, but it still doesn't solve the previous issue. |
|
Ahh, makes sense. Can you add this gist to the function doc? Then let's
merge it in.
…On Wed, Jul 15, 2020 at 00:15 martskins ***@***.***> wrote:
Not quite. The only bit that I find difficult with that workflow is that
the items in the location/quickfix list are (logically) not re-sorted every
time you move the cursor, so the "next" item in the location list is not
really the next diagnostic based on the position of the cursor, which makes
navigation a little difficult if you have many diagnostics.
Another thing is that diagnostics do not seem to be ordered by line number
in the location/quickfix list, maybe that can be solved though, but it
still doesn't solve the previous issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1075 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALC337EAK6MRZ4KUQLS6ILR3VJQLANCNFSM4OYVQM4A>
.
|
|
I adjusted the doc to make it a little clearer, but not sure if that's what you meant. |
28dd20f to
23045f3
Compare
src/language_server_protocol.rs
Outdated
| } | ||
| }) { | ||
| let target = diagnostic.range.start.line + 1; | ||
| let _: String = self.vim()?.rpcclient.call("execute", json!([target]))?; |
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.
Is it convenient to jump to proper column as well? Especially helpful when there are more than one diagnostics reported for the same line.
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.
Yeah good call!
23045f3 to
2050e73
Compare
* Add function and plug mappings to cycle diagnostics * Fix lint errors
This PR creates two new function
LanguageClient_diagnosticsNextandLanguageClient_diagnosticsPreviouswhich enable the user to jump to the next or previous diagnostic in the current buffer, relative to the cursor's current position.