diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2022-01-20 22:51:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-21 07:51:34 +0100 |
commit | 8e702c14ac5fc481bc4a3c709e75e3c165326128 (patch) | |
tree | 95aa52af449e37cf7c09c2240a9e2f17c4e43abd /runtime/lua/vim/lsp/handlers.lua | |
parent | 431915fe6af4e176a84a60c95ad7aa9d36b71e50 (diff) | |
download | rneovim-8e702c14ac5fc481bc4a3c709e75e3c165326128.tar.gz rneovim-8e702c14ac5fc481bc4a3c709e75e3c165326128.tar.bz2 rneovim-8e702c14ac5fc481bc4a3c709e75e3c165326128.zip |
feat(lsp): add handler for workspace/workspaceFolders (#17149)
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 36ab6d59dd..a997b887d9 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -152,6 +152,17 @@ M['workspace/configuration'] = function(_, result, ctx) return response end +--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_workspaceFolders +M['workspace/workspaceFolders'] = function(_, _, ctx) + local client_id = ctx.client_id + local client = vim.lsp.get_client_by_id(client_id) + if not client then + err_message("LSP[id=", client_id, "] client has shut down after sending the message") + return + end + return client.workspace_folders or vim.NIL +end + M['textDocument/publishDiagnostics'] = function(...) return require('vim.lsp.diagnostic').on_publish_diagnostics(...) end |