summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-08 03:30:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-08 03:30:10 +0800
commitf1a0d7caf5106798fe9c79c55ba3e92576d8682c (patch)
treee9a00f09fc9cdad0f1b75ef91bfb38c1aadb0671 /script
parent5362015b546b94c124e8add5e11ba261105f439a (diff)
downloadlua-language-server-f1a0d7caf5106798fe9c79c55ba3e92576d8682c.zip
cleanup
Diffstat (limited to 'script')
-rw-r--r--script/core/completion/completion.lua1
-rw-r--r--script/core/hover/description.lua15
-rw-r--r--script/core/signature.lua1
-rw-r--r--script/core/type-definition.lua10
4 files changed, 2 insertions, 25 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index edbb2673..471566b3 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -207,7 +207,6 @@ local function getSnip(source)
end
local defs = vm.getDefs(source)
for _, def in ipairs(defs) do
- def = vm.getObjectValue(def) or def
if def ~= source and def.type == 'function' then
local uri = guide.getUri(def)
local text = files.getText(uri)
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua
index 8fe2eb4f..e3acd07d 100644
--- a/script/core/hover/description.lua
+++ b/script/core/hover/description.lua
@@ -188,19 +188,8 @@ local function buildEnumChunk(docType, name)
return table.concat(lines, '\n')
end
-local function isFunction(source)
- if source.type == 'function' then
- return true
- end
- local value = vm.getObjectValue(source)
- if not value then
- return false
- end
- return value.type == 'function'
-end
-
local function getBindEnums(source, docGroup)
- if not isFunction(source) then
+ if source.type ~= 'function' then
return
end
@@ -308,7 +297,7 @@ local function tryDocComment(source)
if not source.bindDocs then
return
end
- if not isFunction(source) then
+ if source.type ~= 'function' then
local comment = getBindComment(source, source.bindDocs)
return comment
end
diff --git a/script/core/signature.lua b/script/core/signature.lua
index 449f1c8c..1ca10399 100644
--- a/script/core/signature.lua
+++ b/script/core/signature.lua
@@ -125,7 +125,6 @@ local function makeSignatures(text, call, pos)
local defs = vm.getDefs(node)
local mark = {}
for _, src in ipairs(defs) do
- src = vm.getObjectValue(src) or src
if src.type == 'function'
or src.type == 'doc.type.function' then
if not mark[src] then
diff --git a/script/core/type-definition.lua b/script/core/type-definition.lua
index f45cb352..b43f7dfe 100644
--- a/script/core/type-definition.lua
+++ b/script/core/type-definition.lua
@@ -132,21 +132,11 @@ return function (uri, offset)
end
local defs = vm.getDefs(source)
- local values = {}
- for _, src in ipairs(defs) do
- local value = vm.getObjectValue(src)
- if value and value ~= src and guide.isLiteral(value) then
- values[value] = true
- end
- end
for _, src in ipairs(defs) do
if src.dummy then
goto CONTINUE
end
- if values[src] then
- goto CONTINUE
- end
local root = guide.getRoot(src)
if not root then
goto CONTINUE