-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement buffer-wide virtual text support #4289
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.
Can verify this works in Neovim 0.7 and does not break anything as far as I can see. Again would be better if someone (not the PR author) can check this works fine in their environment using Vim.
Using: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2022 19:26:30) |
I believe this happens because |
This also completely breaks all virtualtext for Vim using emulated virtual text. I am unsure if the buffer-wide virtualtext should be supported or not, but I would prefer it to not break vim 8.x setups. |
Yeah, sorry I only tested with vim 9 and neovim, will fix that asap I originally intended to remove the vim 8.2 compatibility virtual text, because it is a total hack and buggy on its own, but I guess we can leave it for now. |
Works fine! Thank you all, people who make it! info:
ALEInfo
|
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 contribution and to those that verified it working.
@vimpostor there is a merge conflict. Appreciated if you can take a look into it. |
This is more robust and has the additional sideeffect that it will make it easier to implement showing virtual text for all warnings simultaneously. We definitely do not want to do a call to prop_remove() for every virtual text as that will cause noticeable lag when many warnings are present, thus we can use this to remove all virtual text lines with one call in the future. Fixes dense-analysis#4294 refs: vim/vim#10945
This can be enabled with: let g:ale_virtualtext_cursor = 2 It is implemented both for neovim and vim 9.0.0297. Note that sometimes it may appear like some warnings are displayed multiple times. This is not a bug in the virtual text implementation, but a sideeffect of multiple linters returning similar results. For example for Rust, the 'cargo' and 'rls' linters appear to be activated at the same time, but they sometimes return identical errors. This causes the virtual text to show the same warning twice. In the future we can mitigate this problem by removing duplicate errors from our internal location list. However users can also achieve cleaner warnings simply by activating only one linter for each language (or multiple unambiguous linters). For example for Rust, the problem could be solved with: let g:ale_linters = {'rust': ['analyzer']} Fixes dense-analysis#2962 Fixes dense-analysis#3666
I fixed the merge conflict.
|
Thanks! |
* Remove virtual text via types-filter This is more robust and has the additional sideeffect that it will make it easier to implement showing virtual text for all warnings simultaneously. We definitely do not want to do a call to prop_remove() for every virtual text as that will cause noticeable lag when many warnings are present, thus we can use this to remove all virtual text lines with one call in the future. Fixes dense-analysis#4294 refs: vim/vim#10945 * Allow virtual text to appear for all warnings of the buffer This can be enabled with: let g:ale_virtualtext_cursor = 2 It is implemented both for neovim and vim 9.0.0297. Note that sometimes it may appear like some warnings are displayed multiple times. This is not a bug in the virtual text implementation, but a sideeffect of multiple linters returning similar results. For example for Rust, the 'cargo' and 'rls' linters appear to be activated at the same time, but they sometimes return identical errors. This causes the virtual text to show the same warning twice. In the future we can mitigate this problem by removing duplicate errors from our internal location list. However users can also achieve cleaner warnings simply by activating only one linter for each language (or multiple unambiguous linters). For example for Rust, the problem could be solved with: let g:ale_linters = {'rust': ['analyzer']} Fixes dense-analysis#2962 Fixes dense-analysis#3666
This implements buffer-wide virtual text as detailed in #2962, both for vim and neovim.
You can activate it with
let g:ale_virtualtext_cursor = 2
.Note that sometimes there is a problem, where very similar warnings appear
twice as virtual text, but this is not a bug in the implementation, rather it's
a problem of using multiple linters that return very similar warnings.
Demo