Fix sourceMap functionality

This commit is contained in:
arrkiin
2017-05-05 22:59:39 +02:00
committed by geequlim
parent e21de33ffc
commit f40f091421
2 changed files with 3 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ class GDScriptDiagnosticSeverity {
diagnostics.push(new vscode.Diagnostic(new vscode.Range(i, semicolonIndex, i, semicolonIndex+1), "Statement contains a semicolon.", DiagnosticSeverity.Warning));
} if (line.match(/[^#].*?/) && expectEndOfLine){
if(!line.match(/.*?(\\|\:)/)){
diagnostics.push(new vscode.Diagnostic(range, "': or /' expected at end of the line.", DiagnosticSeverity.Error));
diagnostics.push(new vscode.Diagnostic(range, "': or \\' expected at end of the line.", DiagnosticSeverity.Error));
expectEndOfLine = false;
}
if(line.match(/.*?\:/))
@@ -106,7 +106,7 @@ class GDScriptDiagnosticSeverity {
if(line.match(/(if|elif|else|for|while|func|class).*?\\/))
expectEndOfLine = true;
if(line.match(/(if|elif|else|for|while|func|class).*?/) && !line.match(/.*?(\\|\:)/))
diagnostics.push(new vscode.Diagnostic(range, "': or /' expected at end of the line.", DiagnosticSeverity.Error));
diagnostics.push(new vscode.Diagnostic(range, "': or \\' expected at end of the line.", DiagnosticSeverity.Error));
else if(line.match(/(if|elif|while|func|class)\s*\:/))
diagnostics.push(new vscode.Diagnostic(range, "Indentifier expected before ':'", DiagnosticSeverity.Error));
else if(line.match(/[^\w]for[^\w]/) && !line.match(/\s+for\s\w+\s+in\s+[\w+]|\{.*?\}|\[.*?\]/))