mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 13:00:08 -04:00
style: fill in missing code docs wherever applicable
This commit is contained in:
parent
fceb4ed0ec
commit
853b1ab39a
17 changed files with 431 additions and 191 deletions
|
|
@ -31,7 +31,10 @@ local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr)
|
|||
end)
|
||||
|
||||
-- start..stop is an inclusive range
|
||||
|
||||
---@type table<number, number>
|
||||
local start_counts = {}
|
||||
---@type table<number, number>
|
||||
local stop_counts = {}
|
||||
|
||||
local prev_start = -1
|
||||
|
|
@ -40,11 +43,11 @@ local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr)
|
|||
local min_fold_lines = api.nvim_win_get_option(0, "foldminlines")
|
||||
|
||||
for _, match in ipairs(matches) do
|
||||
local start, stop, stop_col
|
||||
local start, stop, stop_col ---@type integer, integer, integer
|
||||
if match.metadata and match.metadata.range then
|
||||
start, _, stop, stop_col = unpack(match.metadata.range)
|
||||
start, _, stop, stop_col = unpack(match.metadata.range) ---@type integer, integer, integer, integer
|
||||
else
|
||||
start, _, stop, stop_col = match.node:range()
|
||||
start, _, stop, stop_col = match.node:range() ---@type integer, integer, integer, integer
|
||||
end
|
||||
|
||||
if stop_col == 0 then
|
||||
|
|
@ -65,6 +68,7 @@ local folds_levels = tsutils.memoize_by_buf_tick(function(bufnr)
|
|||
end
|
||||
end
|
||||
|
||||
---@type string[]
|
||||
local levels = {}
|
||||
local current_level = 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue