diff options
author | sumneko <sumneko@hotmail.com> | 2019-06-05 14:09:09 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-06-05 14:09:09 +0800 |
commit | b63b4592368c512c216f18dbb7b1b9a0fae8f771 (patch) | |
tree | 578cb81e8fc321f4c9497fc09084a2c87e6d5ce1 /server | |
parent | da83f37c216757814935f4deb313c9f066880996 (diff) | |
download | lua-language-server-b63b4592368c512c216f18dbb7b1b9a0fae8f771.zip |
修正报错
Diffstat (limited to 'server')
-rw-r--r-- | server/src/parser/ast.lua | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua index ab3bcae0..b126efb8 100644 --- a/server/src/parser/ast.lua +++ b/server/src/parser/ast.lua @@ -1234,18 +1234,24 @@ local Defs = { } end, EmmyParam = function (argName, emmyName, ...) - return { + local emmy = { type = 'emmyParam', argName, emmyName, ... } + emmy.start = emmy[1].start + emmy.finish = emmy[#emmy].finish + return emmy end, EmmyReturn = function (...) - return { + local emmy = { type = 'emmyReturn', ... } + emmy.start = emmy[1].start + emmy.finish = emmy[#emmy].finish + return emmy end, EmmyField = function (access, fieldName, ...) local obj = { @@ -1258,23 +1264,35 @@ local Defs = { return obj end, EmmyGenericBlock = function (genericName, parentName) - return { genericName, parentName } + return { + start = genericName.start, + finish = parentName and parentName.finish or genericName.finish, + genericName, + parentName, + } end, EmmyGeneric = function (...) - return { + local emmy = { type = 'emmyGeneric', ... } + emmy.start = emmy[1].start + emmy.finish = emmy[#emmy].finish + return emmy end, EmmyVararg = function (typeName) return { type = 'emmyVararg', + start = typeName.start, + finish = typeName.finish, typeName, } end, EmmyLanguage = function (language) return { type = 'emmyLanguage', + start = language.start, + finish = language.finish, language, } end, |