4646local get_parent_file = async .wrap (function (opts , callback )
4747 opts = opts or {}
4848 opts .bufnr = opts .bufnr or 0
49- opts .show_inherited = vim .F .if_nil (opts .show_inherited , true )
49+ -- Use explicit check for boolean values since vim.F.if_nil doesn't handle false properly
50+ if opts .show_inherited ~= nil then
51+ -- Keep the provided value (could be true or false)
52+ opts .show_inherited = opts .show_inherited
53+ else
54+ -- Default to true if not specified
55+ opts .show_inherited = true
56+ end
5057
5158 local filetype = tsparsers .get_buf_lang (opts .bufnr )
5259 local parser = vim .treesitter .get_parser (opts .bufnr , filetype )
@@ -114,7 +121,7 @@ local get_parent_file = async.wrap(function(opts, callback)
114121 local defs = M .parse_file ({
115122 filename = filepath ,
116123 class_name = class_name ,
117- show_inherited = opts .show_inherited
124+ show_inherited = opts .show_inherited ,
118125 })
119126 for _ , value in pairs (defs ) do
120127 if value [" visibility" ] ~= " private" then
@@ -139,7 +146,6 @@ end, 2)
139146M .parse_file = async .wrap (function (opts , callback )
140147 opts = opts or {}
141148 opts .class_name = opts .class_name and string.format (" %s::" , opts .class_name ) or " "
142- opts .show_inherited = vim .F .if_nil (opts .show_inherited , true )
143149
144150 if opts .filename and opts .bufnr then
145151 utils .notify (" parse_file" , {
@@ -270,9 +276,9 @@ M.parse_file = async.wrap(function(opts, callback)
270276 -- Only include inherited members if show_inherited is true
271277 if opts .show_inherited then
272278 async .run (function ()
273- local parent_defs = get_parent_file ({
279+ local parent_defs = get_parent_file ({
274280 bufnr = opts .bufnr ,
275- show_inherited = opts .show_inherited
281+ show_inherited = opts .show_inherited ,
276282 })
277283 if not parent_defs then
278284 -- error already printed somewhere
@@ -290,4 +296,5 @@ M.parse_file = async.wrap(function(opts, callback)
290296 end
291297end , 2 )
292298
293- return M
299+ return M
300+
0 commit comments