diff options
Diffstat (limited to 'xmake/plugins/lua')
| -rw-r--r-- | xmake/plugins/lua/xmake.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xmake/plugins/lua/xmake.lua b/xmake/plugins/lua/xmake.lua index 792299651..60a12fe54 100644 --- a/xmake/plugins/lua/xmake.lua +++ b/xmake/plugins/lua/xmake.lua @@ -56,8 +56,20 @@ task("lua") if not complete or opt.command or opt.list then return end - - return import("main.scripts")() + local list = import("main.scripts")() + if list and complete then + local result = {} + for _, item in ipairs(list) do + if item:startswith(complete) then + table.insert(result, item) + end + end + if #result > 0 then + return result + end + end + -- we just return nil and fallback to system autocomplete + -- it will complete file path, e.g. `xmake l scripts/test.lua` end } , {nil, "arguments" , "vs" , nil , "The script arguments, use '--deserialize' option to enable deserializing.", "e.g.", |
