diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-09-05 20:43:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-09-05 20:43:58 +0800 |
commit | 740513ad4c4dc3efc3ee8c4f156326e296027860 (patch) | |
tree | 2c80a256d3f6922c6faa75e3f281a61bb95e461d /server/src/core | |
parent | d7f43ed4331b68da34e0598a350a8e1aed4cdd5b (diff) | |
download | lua-language-server-740513ad4c4dc3efc3ee8c4f156326e296027860.zip |
修正调用片段的bug
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/completion.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index e2db64d9..5c86aa7e 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -167,20 +167,21 @@ local function buildSnipArgs(args, enums) return table.concat(t, ', ') end -local function getFunctionSnip(name, value) +local function getFunctionSnip(name, value, source) if value:getType() ~= 'function' then return end local lib = value:getLib() + local object = source:get 'object' local hover if lib then - hover = getFunctionHoverAsLib(name, lib) + hover = getFunctionHoverAsLib(name, lib, object) else local emmy = value:getEmmy() if emmy and emmy.type == 'emmy.functionType' then - hover = getFunctionHoverAsEmmy(name, emmy) + hover = getFunctionHoverAsEmmy(name, emmy, object) else - hover = getFunctionHover(name, value:getFunction()) + hover = getFunctionHover(name, value:getFunction(), object) end end if not hover then @@ -197,7 +198,7 @@ local function getValueData(cata, name, value, pos, source) documentation = getDucumentation(name, value), detail = getDetail(value), kind = getKind(cata, value), - snip = getFunctionSnip(name, value), + snip = getFunctionSnip(name, value, source), } if cata == 'field' then if not parser:grammar(name, 'Name') then |