summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-10 14:25:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-10 14:25:40 +0800
commitee07ad02720ea8e36f08e1f7981d2b41cb7e9f07 (patch)
treec8cb775888ec0cc543eb14cb3458aa494d30374e /script-beta/core
parent328db97c169dfa44607acebd09bd63ca22491733 (diff)
downloadlua-language-server-ee07ad02720ea8e36f08e1f7981d2b41cb7e9f07.zip
格式化文档
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/completion.lua21
1 files changed, 12 insertions, 9 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 8e7dfdf9..2dae0b90 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -74,11 +74,12 @@ end
local function checkLocal(ast, word, offset, results)
local locals = guide.getVisibleLocals(ast.ast, offset)
- for name in pairs(locals) do
+ for name, source in pairs(locals) do
if matchKey(word, name) then
results[#results+1] = {
- label = name,
- kind = ckind.Variable,
+ label = name,
+ kind = ckind.Variable,
+ detail = getLabel(source),
}
end
end
@@ -146,12 +147,14 @@ end
local function checkLibrary(ast, text, word, offset, results)
for name, lib in pairs(library.global) do
if matchKey(word, name) then
- buildFunction(results, lib, false, {
- label = name,
- kind = ckind.Function,
- documentation = lib.description,
- detail = getLabel(lib),
- })
+ if lib.type == 'function' then
+ buildFunction(results, lib, false, {
+ label = name,
+ kind = ckind.Function,
+ documentation = lib.description,
+ detail = getLabel(lib),
+ })
+ end
end
end
end