Skip to content

Commit

Permalink
[TypeScript] Support new import type syntax (#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom1729 authored Dec 30, 2021
1 parent 773b357 commit 73d86db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions JavaScript/TypeScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ contexts:
- ts-import-type
- import-check-branch

import-brace:
- meta_prepend: true
- match: type{{identifier_break}}
scope: keyword.control.import-export.ts

property-access:
- meta_prepend: true
- match: \!\.
Expand Down
14 changes: 14 additions & 0 deletions JavaScript/tests/syntax_test_typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ import foo;
// ^^^^ keyword.control.import-export
// ^^^^^^^^^^^ meta.string string.quoted.single

import { type W } from 'somewhere';
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.import
// ^^^^^^ keyword.control.import-export
// ^^^^^^^^^^ meta.block
// ^ punctuation.section.block.begin
// ^^^^ keyword.control.import-export.ts
// ^ variable.other.readwrite
// ^ punctuation.section.block.end
// ^^^^ keyword.control.import-export
// ^^^^^^^^^^^ meta.string string.quoted.single
// ^ punctuation.definition.string.begin
// ^ punctuation.definition.string.end
// ^ punctuation.terminator.statement

export type T = any;
// ^^^^^^^^^^^^^^^^^^^ meta.export
// ^^^^^^ keyword.control.import-export
Expand Down

0 comments on commit 73d86db

Please sign in to comment.