Skip to content
Open
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
3 changes: 2 additions & 1 deletion TypeScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,8 @@ repository:
match: '{{startOfIdentifier}}instanceof{{endOfIdentifier}}'
- name: keyword.operator.new.ts
match: '{{startOfIdentifier}}new{{endOfIdentifier}}'
- include: '#typeof-operator'
- name: keyword.operator.typeof.ts
match: '{{startOfIdentifier}}typeof{{endOfIdentifier}}'
- name: keyword.operator.expression.void.ts
match: '{{startOfIdentifier}}void{{endOfIdentifier}}'
#handle as operator specifically to be recognized only if it is 'as' followed by space
Expand Down
6 changes: 4 additions & 2 deletions TypeScript.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -5670,8 +5670,10 @@
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
<dict>
<key>include</key>
<string>#typeof-operator</string>
<key>name</key>
<string>keyword.operator.typeof.ts</string>
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
<dict>
<key>name</key>
Expand Down
6 changes: 4 additions & 2 deletions TypeScriptReact.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -5616,8 +5616,10 @@
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
<dict>
<key>include</key>
<string>#typeof-operator</string>
<key>name</key>
<string>keyword.operator.typeof.tsx</string>
<key>match</key>
<string>(?&lt;![_$[:alnum:]])(?:(?&lt;=\.\.\.)|(?&lt;!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))</string>
</dict>
<dict>
<key>name</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.function.ts meta.block.ts meta.brace.round.ts
^^^^^^
source.ts meta.function.ts meta.block.ts keyword.operator.expression.typeof.ts
source.ts meta.function.ts meta.block.ts keyword.operator.typeof.ts
^
source.ts meta.function.ts meta.block.ts
^
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/Issue180.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.brace.round.ts
^^^^^^
source.ts keyword.operator.expression.typeof.ts
source.ts keyword.operator.typeof.ts
^
source.ts
^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/Issue37.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.var.expr.ts
^^^^^^
source.ts meta.var.expr.ts keyword.operator.expression.typeof.ts
source.ts meta.var.expr.ts keyword.operator.typeof.ts
^
source.ts meta.var.expr.ts
^
Expand Down Expand Up @@ -696,7 +696,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.brace.round.ts
^^^^^^
source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.operator.expression.typeof.ts
source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.operator.typeof.ts
^
source.ts meta.namespace.declaration.ts meta.block.ts meta.class.ts meta.method.declaration.ts meta.block.ts
^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.objectliteral.ts meta.object.member.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts
^^^^^^
source.ts meta.objectliteral.ts meta.object.member.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts keyword.operator.expression.typeof.ts
source.ts meta.objectliteral.ts meta.object.member.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts keyword.operator.typeof.ts
^
source.ts meta.objectliteral.ts meta.object.member.ts meta.function.expression.ts meta.block.ts meta.var.expr.ts
^
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/Issue554.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Grammar: TypeScript.tmLanguage
^^^
source.ts keyword.operator.spread.ts
^^^^^^
source.ts keyword.operator.expression.typeof.ts
source.ts keyword.operator.typeof.ts
^
source.ts
^
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/Issue858.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.operator.expression.typeof.ts
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.operator.typeof.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts
^^^^^^^^^^^^
Expand Down
48 changes: 48 additions & 0 deletions tests/baselines/Issue978.baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
original file
-----------------------------------
typeof x < ''; function f() {}

-----------------------------------

Grammar: TypeScript.tmLanguage
-----------------------------------
>typeof x < ''; function f() {}
^^^^^^
source.ts keyword.operator.typeof.ts
^
source.ts
^
source.ts variable.other.readwrite.ts
^
source.ts
^
source.ts keyword.operator.relational.ts
^
source.ts
^
source.ts string.quoted.single.ts punctuation.definition.string.begin.ts
^
source.ts string.quoted.single.ts punctuation.definition.string.end.ts
^
source.ts punctuation.terminator.statement.ts
^
source.ts
^^^^^^^^
source.ts meta.function.ts storage.type.function.ts
^
source.ts meta.function.ts
^
source.ts meta.function.ts meta.definition.function.ts entity.name.function.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.begin.ts
^
source.ts meta.function.ts meta.parameters.ts punctuation.definition.parameters.end.ts
^
source.ts meta.function.ts
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
^
source.ts meta.function.ts meta.block.ts punctuation.definition.block.ts
>
^
source.ts
2 changes: 1 addition & 1 deletion tests/baselines/assertions.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ Grammar: TypeScript.tmLanguage
^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts meta.brace.round.ts
^^^^^^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.operator.expression.typeof.ts
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts keyword.operator.typeof.ts
^
source.ts meta.class.ts meta.method.declaration.ts meta.block.ts
^
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/javascript.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Grammar: TypeScript.tmLanguage
source.ts switch-statement.expr.ts punctuation.definition.block.ts
>typeof x;
^^^^^^
source.ts keyword.operator.expression.typeof.ts
source.ts keyword.operator.typeof.ts
^
source.ts
^
Expand Down
1 change: 1 addition & 0 deletions tests/cases/Issue978.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typeof x < ''; function f() {}