aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorMatthieu Coudron <teto@users.noreply.github.com>2021-01-01 23:52:48 +0100
committerGitHub <noreply@github.com>2021-01-01 23:52:48 +0100
commit48caf1df8581a9a9da9072f901411b918333952d (patch)
treec1dfa6befd03c69c8d70fcc67996905ce6faf091 /runtime/lua/vim/lsp/util.lua
parent4a0a6f7bff64b03c80dd84444fc4dbddbe1065ad (diff)
parentf3bbc92476df1112deb34b9c7408cd594ee47a50 (diff)
downloadrneovim-48caf1df8581a9a9da9072f901411b918333952d.tar.gz
rneovim-48caf1df8581a9a9da9072f901411b918333952d.tar.bz2
rneovim-48caf1df8581a9a9da9072f901411b918333952d.zip
Merge pull request #13649 from mjlbach/move_from_nvim-lspconfig
LSP: Move workspace/configuration from nvim-lspconfig to core
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 0972ea83c4..ecff95f61e 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -1422,6 +1422,21 @@ function M.character_offset(buf, row, col)
return str_utfindex(line, col)
end
+--- Helper function to return nested values in language server settings
+---
+--@param settings a table of language server settings
+--@param section a string indicating the field of the settings table
+--@returns (table or string) The value of settings accessed via section
+function M.lookup_section(settings, section)
+ for part in vim.gsplit(section, '.', true) do
+ settings = settings[part]
+ if not settings then
+ return
+ end
+ end
+ return settings
+end
+
M._get_line_byte_from_position = get_line_byte_from_position
M._warn_once = warn_once