mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
docs(treesitter): fix TSNode:range() type signature #32224
Uses an overload to properly show the different return type based on the input parameter.
This commit is contained in:
@ -832,7 +832,7 @@ TSNode:range({include_bytes}) *TSNode:range()*
|
|||||||
• end byte (if {include_bytes} is `true`)
|
• end byte (if {include_bytes} is `true`)
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {include_bytes} (`boolean?`)
|
• {include_bytes} (`false?`)
|
||||||
|
|
||||||
Return (multiple): ~
|
Return (multiple): ~
|
||||||
(`integer`)
|
(`integer`)
|
||||||
|
@ -53,7 +53,7 @@ for _, match, metadata in query:iter_matches(tree:root(), 0, 0, -1) do
|
|||||||
for id, nodes in pairs(match) do
|
for id, nodes in pairs(match) do
|
||||||
local name = query.captures[id]
|
local name = query.captures[id]
|
||||||
local node = nodes[1]
|
local node = nodes[1]
|
||||||
local start, _, end_ = node:parent():range() --[[@as integer]]
|
local start, _, end_ = node:parent():range()
|
||||||
|
|
||||||
if name == 'code' then
|
if name == 'code' then
|
||||||
vim.api.nvim_buf_set_extmark(0, run_message_ns, start, 0, {
|
vim.api.nvim_buf_set_extmark(0, run_message_ns, start, 0, {
|
||||||
|
@ -103,18 +103,9 @@ function TSNode:end_() end
|
|||||||
--- - end row
|
--- - end row
|
||||||
--- - end column
|
--- - end column
|
||||||
--- - end byte (if {include_bytes} is `true`)
|
--- - end byte (if {include_bytes} is `true`)
|
||||||
--- @param include_bytes boolean?
|
|
||||||
--- @return integer, integer, integer, integer
|
|
||||||
function TSNode:range(include_bytes) end
|
|
||||||
|
|
||||||
--- @nodoc
|
|
||||||
--- @param include_bytes false?
|
--- @param include_bytes false?
|
||||||
--- @return integer, integer, integer, integer
|
--- @return integer, integer, integer, integer
|
||||||
function TSNode:range(include_bytes) end
|
--- @overload fun(self: TSNode, include_bytes: true): integer, integer, integer, integer, integer, integer
|
||||||
|
|
||||||
--- @nodoc
|
|
||||||
--- @param include_bytes true
|
|
||||||
--- @return integer, integer, integer, integer, integer, integer
|
|
||||||
function TSNode:range(include_bytes) end
|
function TSNode:range(include_bytes) end
|
||||||
|
|
||||||
--- Get the node's type as a string.
|
--- Get the node's type as a string.
|
||||||
|
Reference in New Issue
Block a user