Skip to content

Commit 55dd8ac

Browse files
authored
Merge pull request #378 from Microsoft/castAndObjectTypeFixes
Cast and object type fixes
2 parents 55e9f73 + 61d482a commit 55dd8ac

File tree

7 files changed

+824
-22
lines changed

7 files changed

+824
-22
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ repository:
308308
- include: '#string'
309309
- name: entity.name.type.module.ts
310310
match: ([_$[:alpha:]][_$[:alnum:]]*)
311-
- name: punctuation.accessor.ts
312-
match: \.
311+
- include: '#punctuation-accessor'
313312

314313
import-equals-declaration:
315314
patterns:
@@ -511,6 +510,7 @@ repository:
511510
- include: '#type'
512511
- include: '#punctuation-comma'
513512
- include: '#punctuation-semicolon'
513+
- include: '#type'
514514

515515
field-declaration:
516516
name: meta.field.declaration.ts
@@ -1368,8 +1368,7 @@ repository:
13681368
end: (?<=\))(?!(\.\s*)?([_$[:alpha:]][_$[:alnum:]]*)\s*(<([^<>]|\<[^<>]+\>)+>\s*)?\()
13691369
patterns:
13701370
- include: '#support-objects'
1371-
- name: punctuation.accessor.ts
1372-
match: \.
1371+
- include: '#punctuation-accessor'
13731372
- name: entity.name.function.ts
13741373
match: ([_$[:alpha:]][_$[:alnum:]]*)
13751374
- include: '#comment'
@@ -1441,7 +1440,7 @@ repository:
14411440
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
14421441
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
14431442
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
1444-
begin: (?:(?<=return|throw|yield|await|default|[=(,:>*]))\s*(<)(?!<?\=)
1443+
begin: (?:(?<=return|throw|yield|await|default|^|[=(,:>*]))\s*(<)(?!<?\=)
14451444
beginCaptures:
14461445
'1': { name: meta.brace.angle.ts }
14471446
end: \>

TypeScript.tmLanguage

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -941,10 +941,8 @@
941941
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
942942
</dict>
943943
<dict>
944-
<key>name</key>
945-
<string>punctuation.accessor.ts</string>
946-
<key>match</key>
947-
<string>\.</string>
944+
<key>include</key>
945+
<string>#punctuation-accessor</string>
948946
</dict>
949947
</array>
950948
</dict>
@@ -1634,6 +1632,10 @@
16341632
<key>include</key>
16351633
<string>#punctuation-semicolon</string>
16361634
</dict>
1635+
<dict>
1636+
<key>include</key>
1637+
<string>#type</string>
1638+
</dict>
16371639
</array>
16381640
</dict>
16391641
<key>field-declaration</key>
@@ -3786,10 +3788,8 @@
37863788
<string>#support-objects</string>
37873789
</dict>
37883790
<dict>
3789-
<key>name</key>
3790-
<string>punctuation.accessor.ts</string>
3791-
<key>match</key>
3792-
<string>\.</string>
3791+
<key>include</key>
3792+
<string>#punctuation-accessor</string>
37933793
</dict>
37943794
<dict>
37953795
<key>name</key>
@@ -3970,7 +3970,7 @@
39703970
<key>name</key>
39713971
<string>cast.expr.ts</string>
39723972
<key>begin</key>
3973-
<string>(?:(?&lt;=return|throw|yield|await|default|[=(,:&gt;*]))\s*(&lt;)(?!&lt;?\=)</string>
3973+
<string>(?:(?&lt;=return|throw|yield|await|default|^|[=(,:&gt;*]))\s*(&lt;)(?!&lt;?\=)</string>
39743974
<key>beginCaptures</key>
39753975
<dict>
39763976
<key>1</key>

TypeScriptReact.tmLanguage

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -945,10 +945,8 @@
945945
<string>([_$[:alpha:]][_$[:alnum:]]*)</string>
946946
</dict>
947947
<dict>
948-
<key>name</key>
949-
<string>punctuation.accessor.tsx</string>
950-
<key>match</key>
951-
<string>\.</string>
948+
<key>include</key>
949+
<string>#punctuation-accessor</string>
952950
</dict>
953951
</array>
954952
</dict>
@@ -1638,6 +1636,10 @@
16381636
<key>include</key>
16391637
<string>#punctuation-semicolon</string>
16401638
</dict>
1639+
<dict>
1640+
<key>include</key>
1641+
<string>#type</string>
1642+
</dict>
16411643
</array>
16421644
</dict>
16431645
<key>field-declaration</key>
@@ -3790,10 +3792,8 @@
37903792
<string>#support-objects</string>
37913793
</dict>
37923794
<dict>
3793-
<key>name</key>
3794-
<string>punctuation.accessor.tsx</string>
3795-
<key>match</key>
3796-
<string>\.</string>
3795+
<key>include</key>
3796+
<string>#punctuation-accessor</string>
37973797
</dict>
37983798
<dict>
37993799
<key>name</key>

0 commit comments

Comments
 (0)