aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorJongwook Choi <wookayin@gmail.com>2024-01-14 23:12:54 -0500
committerLewis Russell <me@lewisr.dev>2024-01-16 20:14:17 +0000
commit3973a5e40505422c7ac42692eaecc1ff84f89e7f (patch)
tree7e270515a2e1b89daf690db942ee19871c1f74a9 /runtime/lua/vim/lsp/util.lua
parent8f02ae82e203920b472d17e75a61763f3a409a7b (diff)
downloadrneovim-3973a5e40505422c7ac42692eaecc1ff84f89e7f.tar.gz
rneovim-3973a5e40505422c7ac42692eaecc1ff84f89e7f.tar.bz2
rneovim-3973a5e40505422c7ac42692eaecc1ff84f89e7f.zip
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.
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 50890e37ce..cee09d85e0 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -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