summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/completion.lua6
-rw-r--r--test/completion/init.lua8
2 files changed, 7 insertions, 7 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,
diff --git a/test/completion/init.lua b/test/completion/init.lua
index d975fa7e..419bde82 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -131,11 +131,11 @@ zabcde$
]]
{
{
- label = 'zabcdefg',
+ label = 'zabcde',
kind = define.CompletionItemKind.Variable,
},
{
- label = 'zabcde',
+ label = 'zabcdefg',
kind = define.CompletionItemKind.Variable,
},
}
@@ -829,11 +829,11 @@ xxxx$
]]
{
{
- label = 'xxxx',
+ label = 'XXXX',
kind = define.CompletionItemKind.Variable,
},
{
- label = 'XXXX',
+ label = 'xxxx',
kind = define.CompletionItemKind.Variable,
},
}