Skip to content

Commit

Permalink
[TypeScript] Support placeholder in LSP type output (#3846)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom1729 authored Sep 23, 2023
1 parent a05930d commit 16a2650
Show file tree
Hide file tree
Showing 2 changed files with 14 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 @@ -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}}
Expand Down
9 changes: 9 additions & 0 deletions JavaScript/tests/syntax_test_typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1390,3 +1390,12 @@ type T<in out U> = 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

0 comments on commit 16a2650

Please sign in to comment.