File tree 2 files changed +8
-2
lines changed 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,11 @@ if !hlexists('typescriptTypeCast')
46
46
\ fold
47
47
endif
48
48
49
- syntax cluster typescriptExpression add =jsxRegion,typescriptParens
50
-
51
49
runtime syntax /jsx_pretty.vim
50
+ syntax cluster typescriptExpression add =jsxRegion,typescriptParens,tsCast
51
+ " Fix type casting ambiguity with JSX syntax
52
+ syntax match typescriptTypeBrackets + [<>]+ contained
53
+ syntax match typescriptTypeCast + <\( [_$A-Za-z0-9]\+\) >\% (\s *\% ([_$A-Za-z0-9]\+\s *;\?\| (\)\% (\_ [^<]*</\1 >\)\@ !\)\@ =+ contains =typescriptTypeBrackets,@typescriptType
52
54
53
55
let b: current_syntax = ' typescript.tsx'
54
56
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ import React from 'react';
2
2
3
3
const head = < T > ( arr : T [ ] ) : T => arr [ 0 ]
4
4
5
+ const foo = < string > bar;
6
+ const foo = < string > bar;
7
+ </ string >
8
+
5
9
function test() {
6
10
const a = 1 ;
7
11
let foo ;
You can’t perform that action at this time.
0 commit comments