diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 1945040bda..b484bd2596 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -193,6 +193,9 @@ RSC[ms.workspace_configuration] = function(_, params, ctx) value = vim.NIL end table.insert(response, value) + else + -- If no section is provided, return settings as is + table.insert(response, client.settings) end end return response diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua index 5d7ab2ad12..1e2b66d21d 100644 --- a/test/functional/fixtures/fake-lsp-server.lua +++ b/test/functional/fixtures/fake-lsp-server.lua @@ -150,9 +150,16 @@ function tests.check_workspace_configuration() { section = 'testSetting2' }, { section = 'test.Setting3' }, { section = 'test.Setting4' }, + {}, + { section = '' }, }, }) - expect_notification('workspace/configuration', { true, false, 'nested', vim.NIL }) + local all = { + testSetting1 = true, + testSetting2 = false, + test = { Setting3 = 'nested' }, + } + expect_notification('workspace/configuration', { true, false, 'nested', vim.NIL, all, all }) notify('shutdown') end, } diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 1f246b0914..04bbda935e 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -677,6 +677,8 @@ describe('LSP', function() { section = 'testSetting2' }, { section = 'test.Setting3' }, { section = 'test.Setting4' }, + {}, + { section = '' }, }, }, { method = 'workspace/configuration', client_id = 1 },