From 16af10999c175d0f7cba46cafdf7aba3c1a06aca Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Mon, 20 Jul 2020 20:58:00 +0200 Subject: Fix #206: Use lsp.util.apply_text_edits for smart_rename --- lua/nvim-treesitter/ts_utils.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lua/nvim-treesitter/ts_utils.lua') diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index a365c16f..fe110a7d 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -186,4 +186,12 @@ function M.is_in_node_range(node, line, col) end end +function M.node_to_lsp_range(node) + local start_line, start_col, end_line, end_col = node:range() + local rtn = {} + rtn.start = { line = start_line, character = start_col } + rtn['end'] = { line = end_line, character = end_col } + return rtn +end + return M -- cgit v1.2.3