-
Notifications
You must be signed in to change notification settings - Fork 45
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
What is the purpose of publish_diagnostic_on
?
#315
Comments
As far as I know this
|
@KostkaBrukowa Interesting, thank you, I shall admit I do not have deep enough knowledge on this topic to properly understand what is going on. For instance, I was trying to figure out where in my client (Neovim), Anyways, the odd thing here is that, even though Do you see the same thing? EDIT: Actually, I see from the code you linked that if plugin_config.publish_diagnostic_on == publish_diagnostic_mode.insert_leave then
common.create_lsp_attach_augcmd(function()
request_diagnostics_debounced()
api.nvim_create_autocmd("InsertEnter", {
pattern = common.extensions_pattern,
callback = function(e)
proto_utils.publish_diagnostics(dispatchers, vim.uri_from_bufnr(e.buf), {})
end,
group = augroup,
})
api.nvim_create_autocmd({ "BufEnter", "InsertLeave", "TextChanged" }, {
pattern = common.extensions_pattern,
callback = request_diagnostics_debounced,
group = augroup,
})
end, augroup)
end
end It seems to use the Any idea what the two different autocommands do? Meaning, what is the difference between |
Screen.Recording.2024-11-26.at.09.52.05.mov |
That is extremely helpful, thank you so much. I will leave the setting alone (I initially thought I had to set it to "change" to ensure it picked up changes as I changed text). |
Thank you for a fantastic tool.
Question:
In the Language Server Protocol, it is mandatory for LS clients to support on
textDocument/didOpen
andtextDocument/didChange
.I was therefore under the impression that the client always has to let the server know whenever any text changes, by calling the
textDocument/didChange
method.Additionally, according to the spec the server is responsible for pushing diagnositcs to the client.
If that assumption is right, and the client always lets the server know about changes, and the server needs to push diagnostics back, then what is the purpose of the setting
publish_diagnostic_on
?By default, it is set to
publish_diagnostic_on = "insert_leave"
, instead ofpublish_diagnostic_on = "change"
.The text was updated successfully, but these errors were encountered: