You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
[Typescript] bug -- backticks sometimes results in the rest of the file being highlighted as a string #5774
Here is a minimal .ts example to reproduce the problem:
class Foo {
f(obj) {
for (let key in obj) {
}
}
g(a: string): void {
if (!this.h(a)) {
throw Error(`${a}`);
}
}
// This should not be red!
h(a: string): boolean {
//...
}
}
I refined the one above to be a bit shorter. It seems to trip over nested { { .. } }:
if (true) {
for (let i in [1, 2, 3]) {
console.log(`${i}`);
}
}
console.log("this is all orange");
console.log("this is all orange");
console.log("this is all orange");
Activity
haraldschilly commentedon Feb 6, 2019
I refined the one above to be a bit shorter. It seems to trip over nested
{ { .. } }:[javascript mode] Simplify parsing of for loop specs
Update from master (#1)
OmgImAlexis commentedon May 11, 2021
Seems this is still an issue alexcanessa/typescript-coverage-report#61 (comment)
marijnh commentedon May 12, 2021
That's a different issue -- the mode didn't support the newly introduced template string types yet. Attached patch should address that.
[javascript mode] Add support for template string types
[javascript mode] Simplify parsing of for loop specs