Open charlesr1971 opened 8 months ago
And you need to add a new rule for typescript generics:
{
$languages: "js",
$name: "typescript-generics",
$startPatterns: [/(?<!\w<)<[\w\s,]+(?=>)/i],
$endPatterns: [/>/],
$indent: true,
$consumeEndMatch: true
},
This ensures that it will match the TypeScript Generic, below:
import { Subject } from 'rxjs';
const subject = new Subject()<string>;
const subscription = subject.subscribe(data => {
console.log(data);
});
subject.next('Hello');
subject.next('World');
subscription.unsubscribe();
But won't match the less than operator, below:
var c,i,l,quitchars;
quitchars=['q','Q'];
charloop:while(c=getc()){
for (i=0; i < quitchars.length; i++){
if (c == quitchars[i]) break charloop;
}
}
This is converted to:
And here is the solution:
To: