소스 검색

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;