summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/parser/compile.lua1
-rw-r--r--test/completion/common.lua14
2 files changed, 15 insertions, 0 deletions
diff --git a/script/parser/compile.lua b/script/parser/compile.lua
index 6748b5ea..446f181b 100644
--- a/script/parser/compile.lua
+++ b/script/parser/compile.lua
@@ -2349,6 +2349,7 @@ local function parseFunction(isLocal, isAction)
func.finish = endRight
Index = Index + 2
else
+ func.finish = lastRightPosition()
missEnd(funcLeft, funcRight)
end
LocalCount = LastLocalCount
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 1cdff803..7c383fe4 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3382,3 +3382,17 @@ f(<??>)
kind = define.CompletionItemKind.EnumMember,
},
}
+
+TEST [[
+return function ()
+ local function fff(xxx)
+ for f in xx<??>
+ end
+end
+]]
+{
+ {
+ label = 'xxx',
+ kind = define.CompletionItemKind.Variable,
+ },
+}