diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index a9da812231..3e1ab00627 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -206,6 +206,9 @@ M[ms.workspace_configuration] = function(_, result, 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 d9f44da0b4..03ced8f7a2 100644 --- a/test/functional/fixtures/fake-lsp-server.lua +++ b/test/functional/fixtures/fake-lsp-server.lua @@ -149,9 +149,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 be9a8342ff..3648cbd917 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -502,6 +502,8 @@ describe('LSP', function() { section = 'testSetting2' }, { section = 'test.Setting3' }, { section = 'test.Setting4' }, + {}, + { section = '' }, }, }, { method = 'workspace/configuration', client_id = 1 },