diff options
author | eightpigs <eightpigs@outlook.com> | 2020-12-03 14:00:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 01:00:54 -0500 |
commit | fa73bb70fc8dfbdd4527ecfb33e282c1eef31dd1 (patch) | |
tree | 04ea4fafc9521224c93ff1629617653a827beaf4 /runtime/lua/vim/lsp.lua | |
parent | 8fb786e415d1c3538452885455b2268d13f640a6 (diff) | |
download | rneovim-fa73bb70fc8dfbdd4527ecfb33e282c1eef31dd1.tar.gz rneovim-fa73bb70fc8dfbdd4527ecfb33e282c1eef31dd1.tar.bz2 rneovim-fa73bb70fc8dfbdd4527ecfb33e282c1eef31dd1.zip |
lsp: Fix "unsupported_method" error when the buffer does not have an LSP Server (#13175)
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 92f56b2ddf..f082fe29f2 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -1032,9 +1032,9 @@ function lsp.buf_request(bufnr, method, params, handler) end end) - -- if no clients support the given method, call the handler with the proper + -- if has client but no clients support the given method, call the callback with the proper -- error message. - if not method_supported then + if not tbl_isempty(all_buffer_active_clients[resolve_bufnr(bufnr)] or {}) and not method_supported then local unsupported_err = lsp._unsupported_method(method) handler = handler or lsp.handlers[method] if handler then |