fix: builtin only have entries for extension functions (#1587)
* fix: `builtin` only have entries for extension functions * fix: add check for underscore and explanation of which functions included
This commit is contained in:
@@ -55,11 +55,14 @@ internal.builtin = function(opts)
|
||||
title = "Telescope Pickers"
|
||||
for ext, funcs in pairs(require("telescope").extensions) do
|
||||
for func_name, func_obj in pairs(funcs) do
|
||||
local debug_info = debug.getinfo(func_obj)
|
||||
table.insert(objs, {
|
||||
filename = string.sub(debug_info.source, 2),
|
||||
text = string.format("%s : %s", ext, func_name),
|
||||
})
|
||||
-- Only include exported functions whose name doesn't begin with an underscore
|
||||
if type(func_obj) == "function" and string.sub(func_name, 0, 1) ~= "_" then
|
||||
local debug_info = debug.getinfo(func_obj)
|
||||
table.insert(objs, {
|
||||
filename = string.sub(debug_info.source, 2),
|
||||
text = string.format("%s : %s", ext, func_name),
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user