-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JavaScript] Rename TypeScript to TSX, add proper TypeScript syntax
- Loading branch information
Showing
5 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
%YAML 1.2 | ||
--- | ||
version: 2 | ||
name: TSX | ||
file_extensions: | ||
- tsx | ||
scope: source.tsx | ||
extends: | ||
- JSX.sublime-syntax | ||
- TypeScript.sublime-syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SYNTAX TEST "Packages/JavaScript/TSX.sublime-syntax" | ||
|
||
<foo />; | ||
// ^^^^^^^ meta.jsx meta.tag | ||
// ^ punctuation.definition.tag.begin | ||
// ^^^ meta.tag.name entity.name.tag | ||
// ^^ punctuation.definition.tag.end | ||
|
||
type x < T = Foo > = any; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^ meta.type-alias | ||
// ^^^^ storage.type | ||
// ^ entity.name.type | ||
// ^^^^^^^^^^^ meta.generic | ||
// ^ punctuation.definition.generic.begin | ||
// ^ variable.parameter.generic | ||
// ^ keyword.operator.assignment | ||
// ^^^ support.class | ||
// ^ punctuation.definition.generic.end | ||
// ^ keyword.operator.assignment | ||
// ^^^ meta.type-alias support.type.any | ||
|
||
// This is invalid TSX as the TypeScript type assertion is parsed as a JSX tag | ||
let strLength: number = (<string>someValue).length; // </string> | ||
// ^^^^^^^^ meta.tag - meta.assertion | ||
// ^^^^^^^^^ meta.tag - comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters