Replies: 2 comments 13 replies
-
In the first implementation, disabling a source only hid its diagnostics (and regenerating them after re-enabling it would have required editing the buffer, as you noted). Sending synthetic notifications isn't that hard, but I stumbled on a pretty simple way to do this automatically and tried implementing it in 5ed9025. Since you are (to my knowledge) the first user of this API, let me know if this does what you expect and if you have any feedback. |
Beta Was this translation helpful? Give feedback.
-
Could you try a465bac just to rule out buffer validation completely? If that's not it, I'm not sure what's going on or why I can't reproduce it locally even though I saw it at least once before. I'd need a true minimal reproduction (no other plugins, just null-ls and specific file(s)) to investigate this further, so feel free to open an issue if you're able to put that together. |
Beta Was this translation helpful? Give feedback.
-
I've been trying to figure out how to toggle sources and tried to use buffer-scoped variables to achieve it in conjunction with a
runtime_condition
. See example below:This worked great, however I couldn't find a way to refresh diagnostics after changing the variable. Seemed to me I needed to send a
textDocument/didChange
to Neovim / LS somehow, but couldn't figure out how. So I was stuck making a change in the buffer for the runtime_condition to kick in. I could also solve it by using the command:edit
, however that gave me a (harmless) error if the buffer is intentionally unsaved. Any tips or pointers on sending atextDocument/didChange
or refreshing diagnostics on-demand are still welcome.However, i've just stumbled upon the
toggle
function, just pushed a few hours ago. This means I can now simply toggle sources usinglua require('null-ls').toggle('<sourcename>')
, which is fantastic.I've been trying to expand on this by using a query to also specify the method used. This way i'm able to distinguish between formatting and diagnostic sources that share the same name, for instance
markdownlint
. I've been trying to test the query first by usinglua print(require('null-ls').is_registered({ name = 'lua-format', method = 'NULL_LS_FORMATTING' }))
which returnsfalse
. However, when I uselua print(require('null-ls').is_registered('lua-format'))
it returnstrue
. Any pointers on using an appropriately formatted query ?Cheers on your null-ls work, it superseded both
efm-langserver
anddiagnosticls
in my case and the on-demand functionality are USPs for my workflow.Beta Was this translation helpful? Give feedback.
All reactions