File tree 5 files changed +41
-2
lines changed
5 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ name: JSX
5
5
file_extensions :
6
6
- jsx
7
7
scope : source.jsx
8
- extends : Packages/JavaScript/ JavaScript.sublime-syntax
8
+ extends : JavaScript.sublime-syntax
9
9
10
10
variables :
11
11
jsx_identifier_part : (?:{{identifier_part}}|-)
Original file line number Diff line number Diff line change
1
+ %YAML 1.2
2
+ ---
3
+ version : 2
4
+ name : TSX
5
+ file_extensions :
6
+ - tsx
7
+ scope : source.tsx
8
+ extends :
9
+ - JSX.sublime-syntax
10
+ - TypeScript.sublime-syntax
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ name: TypeScript
5
5
file_extensions :
6
6
- ts
7
7
scope : source.ts
8
- extends : Packages/ JavaScript/JSX .sublime-syntax
8
+ extends : JavaScript.sublime-syntax
9
9
10
10
variables :
11
11
dot_accessor : (?:[?!]?\.)
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "Packages/JavaScript/TSX.sublime-syntax"
2
+
3
+ < foo /> ;
4
+ // ^^^^^^^ meta.jsx meta.tag
5
+ // ^ punctuation.definition.tag.begin
6
+ // ^^^ meta.tag.name entity.name.tag
7
+ // ^^ punctuation.definition.tag.end
8
+
9
+ type x < T = Foo > = any ;
10
+ // ^^^^^^^^^^^^^^^^^^^^^^^^ meta.type-alias
11
+ // ^^^^ storage.type
12
+ // ^ entity.name.type
13
+ // ^^^^^^^^^^^ meta.generic
14
+ // ^ punctuation.definition.generic.begin
15
+ // ^ variable.parameter.generic
16
+ // ^ keyword.operator.assignment
17
+ // ^^^ support.class
18
+ // ^ punctuation.definition.generic.end
19
+ // ^ keyword.operator.assignment
20
+ // ^^^ meta.type-alias support.type.any
21
+
22
+ // This is invalid TSX as the TypeScript type assertion is parsed as a JSX tag
23
+ let strLength : number = ( < string > someValue).length; // </ string >
24
+ // ^^^^^^^^ meta.tag - meta.assertion
25
+ // ^^^^^^^^^ meta.tag - comment
Original file line number Diff line number Diff line change @@ -377,6 +377,10 @@ x as const;
377
377
// ^ keyword.operator.type
378
378
// ^ punctuation.terminator.statement
379
379
380
+ // This is a type assertion that is incompatible with JSX
381
+ let strLength : number = ( < string > someValue ) . length ; // </string>
382
+ // ^^^^^^^^ meta.assertion - meta.tag
383
+ // ^^^^^^^^^ comment - meta.tag
380
384
381
385
/* Types */
382
386
You can’t perform that action at this time.
0 commit comments