diff --git a/JavaScript/TypeScript.sublime-syntax b/JavaScript/TypeScript.sublime-syntax index 0767815b3e..510c70f2ed 100644 --- a/JavaScript/TypeScript.sublime-syntax +++ b/JavaScript/TypeScript.sublime-syntax @@ -854,6 +854,11 @@ contexts: - ts-type-expression-begin ts-type-expression-begin: + # Placeholder in LSP output. This should never occur in actual TypeScript code. + - match: '\.\.\. \d+ more \.\.\.' + scope: comment.other.ts + pop: true + - match: keyof{{identifier_break}} scope: keyword.operator.type.js - match: typeof{{identifier_break}} diff --git a/JavaScript/tests/syntax_test_typescript.ts b/JavaScript/tests/syntax_test_typescript.ts index 3b380ddf9e..ee7bd6fd62 100644 --- a/JavaScript/tests/syntax_test_typescript.ts +++ b/JavaScript/tests/syntax_test_typescript.ts @@ -1390,3 +1390,12 @@ type T = V; // ^^^ storage.modifier.variance // ^ variable.parameter.generic // ^ punctuation.definition.generic.end + +type T = Foo | ... 100 more ... | Bar; +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type-alias +// ^^^ support.class +// ^ keyword.operator.type.union +// ^^^^^^^^^^^^^^^^ comment.other.ts +// ^ keyword.operator.type.union +// ^^^ support.class +// ^ punctuation.terminator.statement.empty