summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/core/completion.lua6
-rw-r--r--script/core/diagnostics/init.lua3
-rw-r--r--script/utility.lua4
3 files changed, 11 insertions, 2 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 9f35c4ac..d261b302 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -132,6 +132,9 @@ local function buildFunctionSnip(source, value, oop)
end
local function buildDetail(source)
+ if source.type == 'dummy' then
+ return
+ end
local types = infer.searchAndViewInfers(source)
local literals = infer.searchAndViewLiterals(source)
if literals then
@@ -170,6 +173,9 @@ local function getSnip(source)
end
local function buildDesc(source)
+ if source.type == 'dummy' then
+ return
+ end
local hover = getHover.get(source)
local md = markdown()
md:add('lua', hover.label)
diff --git a/script/core/diagnostics/init.lua b/script/core/diagnostics/init.lua
index 82107a2d..5446a7c3 100644
--- a/script/core/diagnostics/init.lua
+++ b/script/core/diagnostics/init.lua
@@ -59,6 +59,9 @@ local function check(uri, name, results)
if passed >= 0.5 then
log.warn(('Diagnostics [%s] @ [%s] takes [%.3f] sec!'):format(name, uri, passed))
end
+ if DIAGTIMES then
+ DIAGTIMES[name] = (DIAGTIMES[name] or 0) + passed
+ end
end
return function (uri, response)
diff --git a/script/utility.lua b/script/utility.lua
index 04597a39..16c5e0c9 100644
--- a/script/utility.lua
+++ b/script/utility.lua
@@ -317,12 +317,12 @@ end
--- 排序后遍历
---@param t table
-function m.sortPairs(t)
+function m.sortPairs(t, sorter)
local keys = {}
for k in pairs(t) do
keys[#keys+1] = k
end
- tableSort(keys)
+ tableSort(keys, sorter)
local i = 0
return function ()
i = i + 1