Преглед на файлове

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

Johan Ahlen преди 8 години
родител
ревизия
df98b33
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      desktop/core/src/desktop/static/desktop/js/autocomplete/sqlParseSupport.js

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