Apply suggestions from code review

Co-authored-by: Gauthier Dandele <92022724+GogoVega@users.noreply.github.com>
envvar-auto-complete
Nick O'Leary 2023-12-20 16:39:52 +00:00 committed by GitHub
parent a77f8cc3e9
commit 4be6d57d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -122,7 +122,8 @@
const contextAutoComplete = function(options) { const contextAutoComplete = function(options) {
const getContextKeysFromRuntime = function(scope, store, searchKey, done) { const getContextKeysFromRuntime = function(scope, store, searchKey, done) {
contextKnownKeys[store] = contextKnownKeys[store] || new Set() contextKnownKeys[scope] = contextKnownKeys[scope] || {}
contextKnownKeys[scope][store] = contextKnownKeys[scope][store] || new Set()
if (searchKey.length > 0) { if (searchKey.length > 0) {
try { try {
RED.utils.normalisePropertyExpression(searchKey) RED.utils.normalisePropertyExpression(searchKey)
@ -209,7 +210,8 @@
}); });
} }
}) })
done(matches) matches.sort(function(a, b) { return a.value.localeCompare(b.value) });
done(matches);
}) })
} }
} }