aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorkylo252 <59826753+kylo252@users.noreply.github.com>2023-02-16 13:34:07 +0100
committerStephan Seitz <stephan.seitz@fau.de>2023-02-17 16:54:02 -0800
commitd1d00f46ce1a19c114350fb7db2998afd79f7a47 (patch)
tree2a1c4d5d7c373871fe02b8d477f5c8b4e8f56151 /lua
parentSplit out `@keyword.return` (diff)
downloadnvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.tar
nvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.tar.gz
nvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.tar.bz2
nvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.tar.lz
nvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.tar.xz
nvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.tar.zst
nvim-treesitter-d1d00f46ce1a19c114350fb7db2998afd79f7a47.zip
refactor(utils): clean up deprecated code
use `vim.treesitter.is_in_node_range()` directly
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/ts_utils.lua19
1 files changed, 1 insertions, 18 deletions
diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua
index 560b49cf2..31dfbf048 100644
--- a/lua/nvim-treesitter/ts_utils.lua
+++ b/lua/nvim-treesitter/ts_utils.lua
@@ -294,30 +294,13 @@ function M.node_length(node)
return end_byte - start_byte
end
---- Determines whether (line, col) position is in node range
--- @deprecated Use `vim.treesitter.is_in_node_range()` instead
--- @param node Node defining the range
--- @param line A line (0-based)
--- @param col A column (0-based)
function M.is_in_node_range(node, line, col)
vim.notify_once(
"nvim-treesitter.ts_utils.is_in_node_range is deprecated: use vim.treesitter.is_in_node_range",
vim.log.levels.WARN
)
- local start_line, start_col, end_line, end_col = node:range()
- if line >= start_line and line <= end_line then
- if line == start_line and line == end_line then
- return col >= start_col and col < end_col
- elseif line == start_line then
- return col >= start_col
- elseif line == end_line then
- return col < end_col
- else
- return true
- end
- else
- return false
- end
+ return ts.is_in_node_range(node, line, col)
end
--- @deprecated Use `vim.treesitter.get_node_range()` instead