add treesitter depth setup

pull/249/head
ray-x 2 years ago
parent a356035440
commit 9ecc909548

@ -33,6 +33,7 @@ _NgConfigValues = {
treesitter_analysis = true, -- treesitter variable context
treesitter_analysis_max_num = 100, -- how many items to run treesitter analysis
treesitter_analysis_condense = true, -- short format of function
treesitter_analysis_depth = 3, -- max depth
transparency = 50, -- 0 ~ 100 blur the main window, 100: fully transparent, 0: opaque, set to nil to disable it
lsp_signature_help = true, -- if you would like to hook ray-x/lsp_signature plugin in navigator
-- setup here. if it is nil, navigator will not init signature help

@ -188,13 +188,11 @@ function M.ref_context(opts)
table.insert(lines, 1, line)
end
expr = expr:parent()
if #line > _NgConfigValues.treesitter_analysis_depth then
break
end
end
table.remove(lines, #lines)
if #lines < 1 then
return ""
end
local text = table.concat(lines, separator)
local text_len = #text
if text_len > indicator_size then

Loading…
Cancel
Save