diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2020-07-20 20:58:00 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2020-07-20 23:24:54 +0200 |
| commit | 16af10999c175d0f7cba46cafdf7aba3c1a06aca (patch) | |
| tree | 877ad09a11d06d6dfda1b7e5beca919601a4c78d /lua/nvim-treesitter/ts_utils.lua | |
| parent | 23a16ab605bb5a38ed4dd6ad5ffd893bd2172250 (diff) | |
Fix #206: Use lsp.util.apply_text_edits for smart_rename
Diffstat (limited to 'lua/nvim-treesitter/ts_utils.lua')
| -rw-r--r-- | lua/nvim-treesitter/ts_utils.lua | 8 |
1 files changed, 8 insertions, 0 deletions
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 |
