Skip to content
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

Go back to v3.2.0 style error reporting - not HUNDREDS of INLINE error messages #4439

Closed
coolaj86 opened this issue Feb 1, 2023 · 16 comments

Comments

@coolaj86
Copy link

coolaj86 commented Feb 1, 2023

I incidentally updated to the latest version and now I get HUNDREDS of INLINE error messages that are indistinguishable from comments every time I change a bracket.

It's quite often that I start writing a new function () { in the middle of a file and then all these messages pop up before I can finish typing the closing `}.

Or I cut and paste some partial code to fill it out differently that a similar block and, boom, I'm so flooded with errors that I can't even see which line I'm on.

For now I've downgraded to v3.2.0 because v3.3.0 is not usable for writing code in real time.

Is there a way to turn that "feature" off?

@natemccurdy
Copy link

natemccurdy commented Feb 1, 2023

I'm also seeing this problem in v3.3.0. Since the change made in #4345, it appears that all lint issues are reported as inline comments in Neovim.

According to the PR's notes, that should only happen when:

let g:ale_use_neovim_diagnostics_api = 1

But it happens even when I have that setting explicitly set to 0:

let g:ale_use_neovim_diagnostics_api = 0

A workaround I've found for now is to set:

let g:ale_virtualtext_cursor = 0

Is it expected that the changes from #4345 should require disabling ale_virtualtext_cursor to "turn off" the diagnostics inline messages, or is that an unintended side effect/bug?


For reference, here is my full ALE config:

" ALE Options
let g:ale_completion_enabled = 1
let g:airline#extensions#ale#enabled = 1  " Use the vim-airline integration
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 1
let g:ale_sign_error = ''
let g:ale_sign_warning = ''
let g:ale_python_flake8_options = '--append-config $HOME/.config/flake8'
" Disable inline diagnostics messages: https://github.com/dense-analysis/ale/issues/4439
let g:ale_virtualtext_cursor = 0
highlight ALEErrorSign ctermbg=NONE ctermfg=red
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow

@hsanson
Copy link
Contributor

hsanson commented Feb 1, 2023

Virtual text enabled by default is intended. See release notes:

@hsanson hsanson closed this as completed Feb 1, 2023
@coolaj86
Copy link
Author

coolaj86 commented Feb 3, 2023

So the default behavior became:

let g:ale_virtualtext_cursor = 'all'

And the solution is to set

let g:ale_virtualtext_cursor = 'current'

Or

let g:ale_virtualtext_cursor = 'disabled'

Re: https://github.com/dense-analysis/ale/blob/master/doc/ale.txt#L2312-L2336

@w0rp
Copy link
Member

w0rp commented Feb 3, 2023

I understand some people might intensely dislike virtualtext messages, so I made sure you're one vimrc or init.vim line away from turning it off. let ale_virtualtext_cursor = 'disabled' (Or 0) will turn it off forever.

I firmly believe the virtualtext messages are helpful and people probably won't know they are available if they aren't enabled by default. I'm definitely keeping them on my default. I tweaked them to look like comments in code so they are about as subtle as they can be. Some people really hate the sign column too, but I think that should also be on by default. (I've had bizarre reactions to that one before.)

@w0rp
Copy link
Member

w0rp commented Feb 3, 2023

Also, revealing hundreds of annoying errors is kind of what ALE is designed to do. 😆

@zakkudo
Copy link

zakkudo commented Feb 3, 2023

This documentation for this was really hard to find and your link here is the first time I've seen it. If this is not added to the README on https://github.com/dense-analysis/ale, I would be prepared for a lot of bug reports because of this change. I've personally been trying to turn this off for the last week and have added all sorts of stray settings to my vimrc because of it.

let g:LanguageClient_useVirtualText = 0?
let g:ale_set_highlights = 0?
let ale_virtualtext_cursor = 'disabled'?

I even went through disabling plugins just to verify it was actually ale and I made sure I wasn't using NeoVim.

The wall of text this makes appear make it impossible to actually read code for correctness or clean up stray comments in a sane way. Similar to spellchecking when writing a document can harm the content, having this enabled makes it impossible to work out the generals of an architecture before cleaning up the syntax.

@zakkudo
Copy link

zakkudo commented Feb 3, 2023

Seriously. If this is not added to the root README on github, there are probably going to be a lot more bugs from other people.

@w0rp
Copy link
Member

w0rp commented Feb 3, 2023

It's not that hard. If you type :h ale and /virt the first thing you'll see is the setting to turn virtualtext off. I do agree there should be an FAQ entry for it. I'll add an issue for doing that so I don't forget to do it later.

@w0rp
Copy link
Member

w0rp commented Feb 3, 2023

#4441 I've added an issue so I can remember to clean up the FAQ, not just for this, but for a bunch of amendments I've been thinking about.

@coolaj86
Copy link
Author

coolaj86 commented Feb 3, 2023

It's not that hard. If you type :h ale and /virt ...

Except that 1) people who are seeing this for the first time have no idea what it is or what it's called and 2) only the tiniest fraction of vim users actually customize their config. Most use something like vim-essentials and expect reasonable defaults.

The wall of text this makes appear make it impossible to actually read code for correctness or clean up stray comments in a sane way

This is the issue.

'current' could be a sane default for an asynchronous linter, but NOT 'all'.

'all' could work as a default behavior for on save, NOT each keypress.

Also, revealing hundreds of annoying errors is kind of what ALE is designed to do.

B.S. The only time you have hundreds of errors in your code is when you're in-between writing brackets - unless you've opened a file from a project with a wildly different linter config that's not supported by your linter.

And it's certainly not helpful to report dozens of errors for a single line, blocking the view of the lines above and below from context.

The configuration as it stands simply doesn't work for the intended use case in vim (I haven't tried on neovim to see what the UX is like there).

@w0rp
Copy link
Member

w0rp commented Feb 3, 2023

Okay.

@w0rp
Copy link
Member

w0rp commented Feb 3, 2023

'all' will be the default, and I'm sticking with that. Just change one line in your config.

@coolaj86
Copy link
Author

coolaj86 commented Feb 3, 2023

P.S. I get that you're trying to make the best reasonable defaults and help people, and I appreciate that.

In this particular case, it was a mistake - probably because most users are using languages and linters and tools that don't work in concert with this option the way that your own do.

@coolaj86
Copy link
Author

coolaj86 commented Feb 3, 2023

'all' will be the default, and I'm sticking with that. Just change one line in your config.

We shall see... I have a feeling that over the course of the next few weeks and months as more people update to this "minor" update to discover a "breaking" change to their workflow, your good sense will get the better of your pride. 😉

@betoharres
Copy link

I love this plugin, I truly do, but with all respect, I don't think virtualtext is a good idea...
It's annoying because as I'm creating a simple function, it floods the entire empty function with error messages of missing types, semi-colon and unused var errors as I'm typing!
I use the default line-length of 80 column, and the error messages are 99% bigger than 100 characters(specially with typescript, which is VERY verbose).
Really, this kind of changes makes me not wanting to update, it feels like gambling my spare hours.
My suggestion is to have this one specific feature displayed at the top of the README instead of enabling it by default.

For me, this is like the re-born of clippy but on steroids from hell

@w0rp
Copy link
Member

w0rp commented Mar 7, 2023

Add one line to vimrc.

@dense-analysis dense-analysis locked as resolved and limited conversation to collaborators Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants