apis.lua 814 B

1234567891011121314151617181920212223242526
  1. import("core.base.json")
  2. import("core.project.config")
  3. import("plugins.show.lists.apis", {rootdir = os.programdir()})
  4. function main()
  5. config.load()
  6. local result = table.join(apis.description_builtin_apis(), apis.description_builtin_module_apis())
  7. for _, name in ipairs(apis.description_scope_apis()) do
  8. local splitinfo = name:split("%.")
  9. table.insert(result, splitinfo[2] or splitinfo[1])
  10. end
  11. result = table.unique(result)
  12. if json.mark_as_array then
  13. json.mark_as_array(result)
  14. end
  15. local localjson = json.encode(result)
  16. -- denote the start of vscode information to ignore anything logging to stdout before this point
  17. print("__begin__")
  18. print(localjson)
  19. -- print end tag to ignore other deprecated/warnings infos
  20. print("__end__")
  21. end