aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/shared.lua
diff options
context:
space:
mode:
authorAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-24 04:44:50 -0800
committerGitHub <noreply@github.com>2019-11-24 04:44:50 -0800
commitd5aaad14ecdd2047089e1a018e97af1f790b3e42 (patch)
tree51e00c6adb0563918a5b76ed5138813567f1b4e9 /runtime/lua/vim/shared.lua
parentd0d38fc36e0c1602186aa540417070fa6c1e2746 (diff)
parenta9036502dca7191c8ada70367e44c398d48dd94a (diff)
downloadrneovim-d5aaad14ecdd2047089e1a018e97af1f790b3e42.tar.gz
rneovim-d5aaad14ecdd2047089e1a018e97af1f790b3e42.tar.bz2
rneovim-d5aaad14ecdd2047089e1a018e97af1f790b3e42.zip
Followup improvements to LSP (#11430)
Addressing things brought up in https://github.com/neovim/neovim/issues/11389 and beyond. - Bugfix for empty dictionary serialization. - Reduce markdown previews of code. - Refactor method triggers to `lsp.buf.*` methods - Switch to v:lua and get rid of vim interface. - Get rid of filetype config in favor of something from https://github.com/neovim/nvim-lsp - Switch error messages to something which doesn't require `ENTER` because if an LSP goes crazy, it'll block neovim. - Rename `builtin_callbacks` to `default_callbacks` - Resolve callback at time of calling using default_callbacks instead of at client creation - Make hover/signatureHelp preview focusable so you can mess with it. - Add vim.lsp.util.set_qflist and vim.lsp.util.set_loclist and vim.lsp.util.locations_to_items(). - Add apply_textedit and tests which enables a new class of features. - Fix column offsets in character and bytes in vim.lsp.buf to be correct. New methods: - Add textDocument/references under vim.lsp.buf.references() - Finish textDocument/rename - Finish textDocument/rangeFormatting and textDocument/format
Diffstat (limited to 'runtime/lua/vim/shared.lua')
-rw-r--r--runtime/lua/vim/shared.lua31
1 files changed, 19 insertions, 12 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua
index 6aa5f3bd9b..1912d3708d 100644
--- a/runtime/lua/vim/shared.lua
+++ b/runtime/lua/vim/shared.lua
@@ -226,18 +226,25 @@ function vim.tbl_add_reverse_lookup(o)
return o
end
---- Extends a list-like table with the values of another list-like table.
----
---NOTE: This *mutates* dst!
---@see |extend()|
----
---@param dst The list which will be modified and appended to.
---@param src The list from which values will be inserted.
-function vim.list_extend(dst, src)
- assert(type(dst) == 'table', "dst must be a table")
- assert(type(src) == 'table', "src must be a table")
- for _, v in ipairs(src) do
- table.insert(dst, v)
+-- Extends a list-like table with the values of another list-like table.
+--
+-- NOTE: This *mutates* dst!
+-- @see |extend()|
+--
+-- @param dst list which will be modified and appended to.
+-- @param src list from which values will be inserted.
+-- @param start Start index on src. defaults to 1
+-- @param finish Final index on src. defaults to #src
+-- @returns dst
+function vim.list_extend(dst, src, start, finish)
+ vim.validate {
+ dst = {dst, 't'};
+ src = {src, 't'};
+ start = {start, 'n', true};
+ finish = {finish, 'n', true};
+ }
+ for i = start or 1, finish or #src do
+ table.insert(dst, src[i])
end
return dst
end