Browse Source

HUE-4642 [editor] Ace autocomplete should honour the weights for partial matching

Johan Ahlen 10 năm trước cách đây
mục cha
commit
b4578d3

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/ace/ext-language_tools.js


+ 1 - 0
desktop/core/src/desktop/static/desktop/js/sqlAutocompleter2.js

@@ -455,6 +455,7 @@
     var currentScore = 1000;
     completions.forEach(function (completion) {
       completion.score = currentScore;
+      completion.prioritizeScore = true;
       currentScore--;
     });
 

+ 7 - 0
tools/ace-editor/lib/ace/autocomplete.js

@@ -437,6 +437,13 @@ var FilteredList = function(array, filterText) {
         this.filterText = str;
         matches = this.filterCompletions(matches, this.filterText);
         matches = matches.sort(function (a, b) {
+          if (a.prioritizeScore && b.prioritzeScore) {
+            return b.score - a.score
+          } else if (a.prioritizeScore) {
+            return -1;
+          } else if (b.prioritizeScore) {
+            return 1;
+          }
           var alpha = 0;
           if (a.caption > b.caption) {
             alpha = 1;

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác