summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-11 10:42:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-11 10:42:30 +0800
commite2cdda52b7239c180f9f3a8f5090aa3f2dd7e9aa (patch)
tree0e138569faba10abcb5058e6db5ab1822449f805 /script/core
parent52c24177d3df9520a244e22b8dbf3c1b5bb323dc (diff)
downloadlua-language-server-e2cdda52b7239c180f9f3a8f5090aa3f2dd7e9aa.zip
sort pairs
Diffstat (limited to 'script/core')
-rw-r--r--script/core/completion.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 63492689..f6556233 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -287,7 +287,7 @@ end
local function checkLocal(ast, word, offset, results)
local locals = guide.getVisibleLocals(ast.ast, offset)
- for name, source in pairs(locals) do
+ for name, source in util.sortPairs(locals) do
if isSameSource(ast, source, offset) then
goto CONTINUE
end
@@ -1673,7 +1673,7 @@ local function tryLuaDocBySource(ast, offset, source, results)
end
return true
elseif source.type == 'doc.diagnostic.name' then
- for name in pairs(define.DiagnosticDefaultSeverity) do
+ for name in util.sortPairs(define.DiagnosticDefaultSeverity) do
if matchKey(source[1], name) then
results[#results+1] = {
label = name,
@@ -1758,7 +1758,7 @@ local function tryLuaDocByErr(ast, offset, err, docState, results)
}
end
elseif err.type == 'LUADOC_MISS_DIAG_NAME' then
- for name in pairs(define.DiagnosticDefaultSeverity) do
+ for name in util.sortPairs(define.DiagnosticDefaultSeverity) do
results[#results+1] = {
label = name,
kind = define.CompletionItemKind.Value,