summaryrefslogtreecommitdiff
path: root/xmake/plugins/show/lists/apis.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-26 00:56:34 +0800
committerruki <[email protected]>2024-04-26 00:56:34 +0800
commite009e9523b22cbc1c907c676ea6f25b7efe9ab3b (patch)
tree4a8f1f8a16ad2bc2f353b66ae55841ababfa23c7 /xmake/plugins/show/lists/apis.lua
parent5388efb7b2ce441eb32c2f3cbfc6027c3f452eda (diff)
improve to show apis
Diffstat (limited to 'xmake/plugins/show/lists/apis.lua')
-rw-r--r--xmake/plugins/show/lists/apis.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/xmake/plugins/show/lists/apis.lua b/xmake/plugins/show/lists/apis.lua
index 1a70263e6..7e481b206 100644
--- a/xmake/plugins/show/lists/apis.lua
+++ b/xmake/plugins/show/lists/apis.lua
@@ -284,12 +284,14 @@ function script_extension_module_apis()
end
modulename = modulename:gsub("/", "."):gsub("%.lua", "")
local instance = import(modulename, {try = true, anonymous = true})
- if _is_callable(instance) then
- table.insert(result, modulename)
- elseif type(instance) == "table" then
- for k, v in pairs(instance) do
- if not k:startswith("_") and type(v) == "function" then
- table.insert(result, modulename .. "." .. k)
+ if instance then
+ if _is_callable(instance) then
+ table.insert(result, modulename)
+ elseif type(instance) == "table" then
+ for k, v in pairs(instance) do
+ if not k:startswith("_") and type(v) == "function" then
+ table.insert(result, modulename .. "." .. k)
+ end
end
end
end