typescript-vim
typescript-vim copied to clipboard
Syntax Highlighting breaks on parametrised lambda
This code breaks the syntax highlighter:
type Stuff<T> = {
result: T
} | {
error: string
}
const apply = <T>(x: T, y: T, f: (xx: T, xy: T) => Stuff<T>): Stuff<T> => {
return f(x, y)
}
console.log(apply(5, 2, (x, y) => ({result: x + y})))
Seems to break after
const apply = <T>[...etc]
Thanks for the bug report!
Another case!
import t from 'io-ts';
export enum Entity {
User,
Client
}
const extendType = <T extends t.Props, K extends t.Props>(
A: t.TypeC<T>,
B: K
): t.TypeC<T & K> =>
t.type({
...A.props,
...B
});
const DBItem = t.type({
id: t.string
});
Seems to break after T extends.

Thanks for the plugin!