aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-21 15:41:32 -0800
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-21 15:41:32 -0800
commit43d73ee884f97861c44adab4797a8fc185af1436 (patch)
tree7f50d920578a2491f581d5a2fc8abb28c9ebf166 /runtime/lua/vim/lsp/util.lua
parentda07e71b189a51008a93783b5f7894dc495c277e (diff)
downloadrneovim-43d73ee884f97861c44adab4797a8fc185af1436.tar.gz
rneovim-43d73ee884f97861c44adab4797a8fc185af1436.tar.bz2
rneovim-43d73ee884f97861c44adab4797a8fc185af1436.zip
Fix position params for encoding.
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 77f2ae6fbc..76681920bd 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -638,6 +638,17 @@ function M.try_trim_markdown_code_blocks(lines)
return 'markdown'
end
+function M.make_position_params()
+ local row, col = unpack(api.nvim_win_get_cursor(0))
+ row = row - 1
+ local line = api.nvim_buf_get_lines(0, row, row+1, true)[1]
+ col = vim.str_utfindex(line, col)
+ return {
+ textDocument = { uri = vim.uri_from_bufnr(0) };
+ position = { line = row; character = col; }
+ }
+end
+
return M
-- vim:sw=2 ts=2 et