浏览代码

fixed regex to reflect my issue

Akira Kido 7 年之前
父节点
当前提交
c20909fdb3
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      src/gdscript/diagnostic.ts

+ 1 - 4
src/gdscript/diagnostic.ts

@@ -112,11 +112,8 @@ class GDScriptDiagnosticSeverity {
           return
         if(line.match(new RegExp(`.*?#.*?\\s${keywords[1]}\\s.*?`)))
           return
-        if(line.match(/.*?\sif\s+(\!|\[|\{|\w).*?\s+else\s+[^\s]+/))
+        if(line.match(/.*?\sif\s+(\!|\[|\{|\w|").*?\s+else\s+[^\s]+/))
           return
-        if(line.match(/.*?if.*else.*/)) {
-          return
-        }
         if (line.match(/.*?\\/))
           expectEndOfLine = true;
         else if (line.match(/.*?\:[\s+]+[^#\s]+/))