Browse Source

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

Johan Ahlen 8 years ago
parent
commit
df98b33719

+ 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;