aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
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