mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
refactor(lsp): deprecate vim.lsp.util.lookup_section
This function is used only in the `workspace/configuration` handler, and does not warrant a public API because of its confusing return types. The only caller `vim.lsp.handlers["workspace.configuration"]` is also refactored to use `vim.tbl_get()` instead.
This commit is contained in:

committed by
Lewis Russell

parent
8f02ae82e2
commit
3973a5e405
@@ -2140,7 +2140,9 @@ end
|
||||
---@param settings table language server settings
|
||||
---@param section string indicating the field of the settings table
|
||||
---@return table|string|vim.NIL The value of settings accessed via section. `vim.NIL` if not found.
|
||||
---@deprecated
|
||||
function M.lookup_section(settings, section)
|
||||
vim.deprecate('vim.lsp.util.lookup_section()', 'vim.tbl_get() with `vim.split`', '0.12')
|
||||
for part in vim.gsplit(section, '.', { plain = true }) do
|
||||
settings = settings[part]
|
||||
if settings == nil then
|
||||
|
Reference in New Issue
Block a user