Skip to content

Commit d14162e

Browse files
committed
imrpove embedded subexpressions
rename #interpolatedStringContent to subexpression. change subexpression scope to not include 'interpolation'. change scopes for #interpolation to include embedded, keyword.other was punctuation.definition.variable. Change scope for regular `$()`, keyword.other was punctuation.definition.variable. removed redundant includes from #subexpression and #interpolation.
1 parent 44eac87 commit d14162e

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</dict>
6464
<dict>
6565
<key>include</key>
66-
<string>#interpolatedStringContent</string>
66+
<string>#subexpression</string>
6767
</dict>
6868
<dict>
6969
<key>include</key>
@@ -214,15 +214,20 @@
214214
</dict>
215215
<dict>
216216
<key>begin</key>
217-
<string>(\$)(\()</string>
217+
<string>((\$))(\()</string>
218218
<key>beginCaptures</key>
219219
<dict>
220220
<key>1</key>
221221
<dict>
222222
<key>name</key>
223-
<string>punctuation.definition.variable.powershell</string>
223+
<string>keyword.other.substatement.powershell</string>
224224
</dict>
225225
<key>2</key>
226+
<dict>
227+
<key>name</key>
228+
<string>punctuation.definition.subexpression.powershell</string>
229+
</dict>
230+
<key>3</key>
226231
<dict>
227232
<key>name</key>
228233
<string>punctuation.section.group.begin.powershell</string>
@@ -666,7 +671,7 @@
666671
</dict>
667672
</array>
668673
</dict>
669-
<key>interpolatedStringContent</key>
674+
<key>subexpression</key>
670675
<dict>
671676
<key>begin</key>
672677
<string>\(</string>
@@ -678,8 +683,6 @@
678683
<string>punctuation.section.group.begin.powershell</string>
679684
</dict>
680685
</dict>
681-
<key>contentName</key>
682-
<string>interpolated.simple.source.powershell</string>
683686
<key>end</key>
684687
<string>\)</string>
685688
<key>endCaptures</key>
@@ -690,65 +693,73 @@
690693
<string>punctuation.section.group.end.powershell</string>
691694
</dict>
692695
</dict>
696+
<key>name</key>
697+
<string>meta.group.simple.subexpression.powershell</string>
693698
<key>patterns</key>
694699
<array>
695700
<dict>
696701
<key>include</key>
697702
<string>$self</string>
698703
</dict>
699-
<dict>
700-
<key>include</key>
701-
<string>#interpolation</string>
702-
</dict>
703-
<dict>
704-
<key>include</key>
705-
<string>#interpolatedStringContent</string>
706-
</dict>
707704
</array>
708705
</dict>
709706
<key>interpolation</key>
710707
<dict>
711708
<key>begin</key>
712-
<string>(\$)(\()</string>
709+
<string>(((\$)))((\())</string>
713710
<key>beginCaptures</key>
714711
<dict>
715712
<key>1</key>
716713
<dict>
717714
<key>name</key>
718-
<string>punctuation.definition.variable.powershell</string>
715+
<string>keyword.other.substatement.powershell</string>
719716
</dict>
720717
<key>2</key>
718+
<dict>
719+
<key>name</key>
720+
<string>punctuation.definition.substatement.powershell</string>
721+
</dict>
722+
<key>3</key>
723+
<dict>
724+
<key>name</key>
725+
<string>punctuation.section.embedded.substatement.begin.powershell</string>
726+
</dict>
727+
<key>4</key>
721728
<dict>
722729
<key>name</key>
723730
<string>punctuation.section.group.begin.powershell</string>
724731
</dict>
732+
<key>5</key>
733+
<dict>
734+
<key>name</key>
735+
<string>punctuation.section.embedded.substatement.begin.powershell</string>
736+
</dict>
725737
</dict>
726738
<key>contentName</key>
727739
<string>interpolated.complex.source.powershell</string>
728740
<key>end</key>
729-
<string>\)</string>
741+
<string>(\))</string>
730742
<key>endCaptures</key>
731743
<dict>
732744
<key>0</key>
733745
<dict>
734746
<key>name</key>
735747
<string>punctuation.section.group.end.powershell</string>
736748
</dict>
749+
<key>1</key>
750+
<dict>
751+
<key>name</key>
752+
<string>punctuation.section.embedded.substatement.end.powershell</string>
753+
</dict>
737754
</dict>
755+
<key>name</key>
756+
<string>meta.embedded.substatement.powershell</string>
738757
<key>patterns</key>
739758
<array>
740759
<dict>
741760
<key>include</key>
742761
<string>$self</string>
743762
</dict>
744-
<dict>
745-
<key>include</key>
746-
<string>#interpolation</string>
747-
</dict>
748-
<dict>
749-
<key>include</key>
750-
<string>#interpolatedStringContent</string>
751-
</dict>
752763
</array>
753764
</dict>
754765
<key>numericConstant</key>

0 commit comments

Comments
 (0)