Closed bwells closed 2 years ago
Thanks for the detailed report! The fundamental issue (and the reason running linters on save is not supported on 0.5.1) is that the LSP API doesn't give us a good way to publish 2 sets of diagnostics separately, so they wipe each other out. I think the easiest fix is to simply disable the notifications completely on 0.5.1, which is what I did in 765613c5a7499d92d6cf7aac6ccd7e4946bd5ec8. Could you update and let me know if that fixes your issue?
Your issue also made me realize that we didn't have an easy way to override a built-in's default method, so I added that in 2143761a0a3991308a482d7d5624ce9c9cef93b7. There's an example there for how to configure pylint
to run only on save, so you can try that out once 0.6 releases (or earlier if you build from source).
Thanks so much for such a quick fix and for null-ls in general. I can confirm that 765613c resolves the issue for me.
Great! You're also right that there is a potential timing issue with changedtick tracking, but it shouldn't cause problems on 0.5.1 for now, so I'll solve that separately.
FAQ
Issues
Neovim Version
v0.5.1
null-ls config
Steps to reproduce
textDocument/didChange
, but do not yet save the filetextDocument/didSave
Expected behavior
On save I expect that previously reported errors would not disappear when the document has not otherwise changed.
Actual behavior
All reported errors disappear.
This appears to be due to the the result of
NULL_LS_DIAGNOSTICS_ON_SAVE
triggering with no configured generators.Furthermore, even though errors on document change are working correctly, if you write right after a change null-ls rejects the diagnostics generated by the change event (
buffer changed; ignoring received diagnostics
) even though the contents have not actually changed between the change event and save event.Debug log
Help
Yes, but I don't know how to start. I would need guidance
Implementation help
I'm happy to help improve either null-ls or the pylint builtin. I see several approaches: