mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
fix(lsp): support workspace/configuation with no section
This commit is contained in:
parent
b12d193b4a
commit
4541189052
@ -206,6 +206,9 @@ M[ms.workspace_configuration] = function(_, result, 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
|
||||||
|
@ -149,9 +149,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,
|
||||||
}
|
}
|
||||||
|
@ -502,6 +502,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 },
|
||||||
|
Loading…
Reference in New Issue
Block a user