Compare commits

...

2 Commits

Author SHA1 Message Date
Tim Pope
a4272b926d
Merge 4541189052 into 738320188f 2024-12-17 21:59:46 -08:00
Tim Pope
4541189052 fix(lsp): support workspace/configuation with no section 2024-02-17 17:53:49 -05:00
3 changed files with 13 additions and 1 deletions

View File

@ -193,6 +193,9 @@ RSC[ms.workspace_configuration] = function(_, params, ctx)
value = vim.NIL value = vim.NIL
end end
table.insert(response, value) table.insert(response, value)
else
-- If no section is provided, return settings as is
table.insert(response, client.settings)
end end
end end
return response return response

View File

@ -150,9 +150,16 @@ function tests.check_workspace_configuration()
{ section = 'testSetting2' }, { section = 'testSetting2' },
{ section = 'test.Setting3' }, { section = 'test.Setting3' },
{ section = 'test.Setting4' }, { 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') notify('shutdown')
end, end,
} }

View File

@ -677,6 +677,8 @@ describe('LSP', function()
{ section = 'testSetting2' }, { section = 'testSetting2' },
{ section = 'test.Setting3' }, { section = 'test.Setting3' },
{ section = 'test.Setting4' }, { section = 'test.Setting4' },
{},
{ section = '' },
}, },
}, },
{ method = 'workspace/configuration', client_id = 1 }, { method = 'workspace/configuration', client_id = 1 },