Selaa lähdekoodia

HUE-7329 [editor] Don't warn when the syntax checker can't find a token

Johan Ahlen 8 vuotta sitten
vanhempi
commit
7a4cd3b
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -3658,14 +3658,14 @@
             }
             if (!e.data.syntaxError.incompleteStatement) {
               var token = self.editor.session.getTokenAt(e.data.syntaxError.loc.first_line - 1, e.data.syntaxError.loc.first_column + 1);
+              // If no token is found it likely means that the parserresponse came back after the text was changed,
+              // at which point it will trigger another parse so we can ignore this.
               if (token) {
                 token.syntaxError = e.data.syntaxError;
                 var AceRange = ace.require('ace/range').Range;
                 var range = new AceRange(e.data.syntaxError.loc.first_line - 1, e.data.syntaxError.loc.first_column, e.data.syntaxError.loc.last_line - 1, e.data.syntaxError.loc.first_column + e.data.syntaxError.text.length);
                 var markerId = self.editor.session.addMarker(range, 'hue-ace-syntax-error');
                 self.editor.session.$backMarkers[markerId].token = token;
-              } else {
-                console.warn("couldn't find a token at line: " + (e.data.syntaxError.loc.first_line - 1) + ", column: " + (e.data.syntaxError.loc.first_column + 1));
               }
             }
           }