We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad94a04 commit 7ec0af9Copy full SHA for 7ec0af9
src/providers/ObjectScriptDiagnosticProvider.ts
@@ -95,10 +95,24 @@ export class ObjectScriptDiagnosticProvider {
95
let inComment = false;
96
let endingComma = false;
97
let isCode = !isClass;
98
+ let jsScript = false;
99
for (let i = 0; i < document.lineCount; i++) {
100
const line = document.lineAt(i);
101
const text = this.stripLineComments(line.text);
102
103
+ // it is important to check script tag context before ObjectScript comments
104
+ // since /* ... */ comments can also be used in JavaScript
105
+ if (text.match(/<script .*>/)) {
106
+ jsScript = true;
107
+ }
108
+
109
+ if (jsScript) {
110
+ if (text.match(/<\/script>/)) {
111
+ jsScript = false;
112
113
+ continue;
114
115
116
if (text.match(/\/\*/)) {
117
inComment = true;
118
}
0 commit comments