Explorar o código

HUE-4031 [editor] Sort expected alphabetically when distance is equal

Johan Ahlen %!s(int64=8) %!d(string=hai) anos
pai
achega
df98b33

+ 3 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/sqlParseSupport.js

@@ -1609,6 +1609,9 @@ var SqlParseSupport = (function () {
           }
         });
         weightedExpected.sort(function (a, b) {
+          if (a.distance === b.distance) {
+            return a.text.localeCompare(b.text);
+          }
           return a.distance - b.distance
         });
         parser.yy.error.expected = weightedExpected;