From 5e302c4e92e60a7af8b5d3b2b21b2eb40a84d388 Mon Sep 17 00:00:00 2001 From: gly Date: Tue, 27 Dec 2022 16:34:46 +0100 Subject: correct completer when there's no values option --- xmake/modules/private/utils/completer.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xmake/modules/private/utils/completer.lua b/xmake/modules/private/utils/completer.lua index 7688afc4e..e4427bc87 100644 --- a/xmake/modules/private/utils/completer.lua +++ b/xmake/modules/private/utils/completer.lua @@ -229,7 +229,9 @@ function completer:_complete_option_v(options, current, completing) end -- get completion candidates from values option local function _values_into_candidates(values) - if type(values) == "function" then + if values == nil then + return {} + elseif type(values) == "function" then -- no need to filter result of values() as we consider values() already filter candidates return _transform_values(values(completing, current)) else -- cgit v1.3.1