diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-10-29 19:47:34 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-29 18:47:34 -0700 |
commit | e921e98ce38a33a824a8b4efb376a9901a8191d7 (patch) | |
tree | 1ac925a36f515db8e7e354f3f101849a3e1539f8 /runtime/lua/vim/lsp/diagnostic.lua | |
parent | 4472c56d54f447040f6e8610b261b7efa0d04eb6 (diff) | |
download | rneovim-e921e98ce38a33a824a8b4efb376a9901a8191d7.tar.gz rneovim-e921e98ce38a33a824a8b4efb376a9901a8191d7.tar.bz2 rneovim-e921e98ce38a33a824a8b4efb376a9901a8191d7.zip |
refactor(diagnostic): make display handlers generic (#16137)
Rather than treating virtual_text, signs, and underline specially,
introduce the concept of generic "handlers", of which those three are
simply the defaults bundled with Nvim. Handlers are called in
`vim.diagnostic.show()` and `vim.diagnostic.hide()` and are used to
handle how diagnostics are displayed.
Diffstat (limited to 'runtime/lua/vim/lsp/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index bea0e44aca..6b856a52a5 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -146,7 +146,8 @@ local _client_namespaces = {} function M.get_namespace(client_id) vim.validate { client_id = { client_id, 'n' } } if not _client_namespaces[client_id] then - local name = string.format("vim.lsp.client-%d", client_id) + local client = vim.lsp.get_client_by_id(client_id) + local name = string.format("vim.lsp.%s.%d", client.name, client_id) _client_namespaces[client_id] = vim.api.nvim_create_namespace(name) end return _client_namespaces[client_id] |