Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions JavaScript/TypeScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,10 @@ contexts:
- include: immediately-pop

ts-type-expression-end:
- match: (?=\|\||&&)
fail: ts-function-type-arguments
- match: \&
- match: \&(?!\&)
scope: keyword.operator.type.intersection.js
push: [ts-type-expression-end-no-line-terminator, ts-type-expression-begin]
- match: \|
- match: \|(?!\|)
scope: keyword.operator.type.union.js
push: [ts-type-expression-end-no-line-terminator, ts-type-expression-begin]
- match: is{{identifier_break}}
Expand Down
20 changes: 20 additions & 0 deletions JavaScript/tests/syntax_test_typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,26 @@ import foo;
declare();
// ^^^^^^^ meta.function-call variable.function

declare<T>();
// ^^^ meta.generic
// ^ punctuation.definition.generic.begin
// ^ support.class
// ^ punctuation.definition.generic.end

declare<T1 & T2>();
// ^^^^^^^^^ meta.generic.js
// ^ punctuation.definition.generic.begin.js
// ^^ support.class.js
// ^ keyword.operator.type.intersection.js
// ^^ support.class.js
// ^ punctuation.definition.generic.end.js

declare<T1 && T2>();
// ^^^^^^^^^^ - meta.generic

declare<T1 & T2<T3 && T4>>();
// ^^^^^^^^^^^^^^^^^^^ - meta.generic

declare con;
// ^^^^^^^ storage.modifier

Expand Down
Loading