Skip to content

Commit 350afda

Browse files
committed
fix new line between ) and ] on attribute.
1 parent 4a76e10 commit 350afda

File tree

1 file changed

+81
-66
lines changed

1 file changed

+81
-66
lines changed

PowerShellSyntax.tmLanguage

Lines changed: 81 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
<key>attribute</key>
346346
<dict>
347347
<key>begin</key>
348-
<string>(\[)\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\b(\()</string>
348+
<string>(\[)\s*\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\b</string>
349349
<key>beginCaptures</key>
350350
<dict>
351351
<key>1</key>
@@ -358,22 +358,12 @@
358358
<key>name</key>
359359
<string>support.function.attribute.powershell</string>
360360
</dict>
361-
<key>3</key>
362-
<dict>
363-
<key>name</key>
364-
<string>punctuation.section.group.begin.powershell</string>
365-
</dict>
366361
</dict>
367362
<key>end</key>
368-
<string>(\))(?:\s+)?(\])</string>
363+
<string>(\])</string>
369364
<key>endCaptures</key>
370365
<dict>
371366
<key>1</key>
372-
<dict>
373-
<key>name</key>
374-
<string>punctuation.section.group.end.powershell</string>
375-
</dict>
376-
<key>2</key>
377367
<dict>
378368
<key>name</key>
379369
<string>punctuation.section.bracket.end.powershell</string>
@@ -384,72 +374,97 @@
384374
<key>patterns</key>
385375
<array>
386376
<dict>
387-
<key>include</key>
388-
<string>#variable</string>
389-
</dict>
390-
<dict>
391-
<key>include</key>
392-
<string>#variableNoProperty</string>
393-
</dict>
394-
<dict>
395-
<key>include</key>
396-
<string>#hashtable</string>
397-
</dict>
398-
<dict>
399-
<key>include</key>
400-
<string>#scriptblock</string>
401-
</dict>
402-
<dict>
403-
<key>include</key>
404-
<string>#doubleQuotedStringEscapes</string>
405-
</dict>
406-
<dict>
407-
<key>include</key>
408-
<string>#doubleQuotedString</string>
409-
</dict>
410-
<dict>
411-
<key>include</key>
412-
<string>#type</string>
413-
</dict>
414-
<dict>
415-
<key>include</key>
416-
<string>#numericConstant</string>
417-
</dict>
418-
<dict>
419-
<key>include</key>
420-
<string>#doubleQuotedString</string>
421-
</dict>
422-
<dict>
423-
<key>match</key>
424-
<string>(?i)\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|positionalbinding|helpuri|confirmimpact|helpmessage)\b(?:\s+)?(=)</string>
425-
<key>captures</key>
377+
<key>begin</key>
378+
<string>\(</string>
379+
<key>beginCaptures</key>
426380
<dict>
427-
<key>1</key>
381+
<key>0</key>
428382
<dict>
429383
<key>name</key>
430-
<string>variable.parameter.attribute.powershell</string>
384+
<string>punctuation.section.group.begin.powershell</string>
431385
</dict>
432-
<key>2</key>
386+
</dict>
387+
<key>end</key>
388+
<string>\)</string>
389+
<key>endCaptures</key>
390+
<dict>
391+
<key>0</key>
433392
<dict>
434393
<key>name</key>
435-
<string>keyword.operator.assignment.powershell</string>
394+
<string>punctuation.section.group.end.powershell</string>
436395
</dict>
437396
</dict>
438-
</dict>
439-
<dict>
440-
<key>begin</key>
441-
<string>(?&lt;!')'</string>
442-
<key>end</key>
443-
<string>'(?!')</string>
444-
<key>name</key>
445-
<string>string.quoted.single.powershell</string>
446397
<key>patterns</key>
447398
<array>
399+
<dict>
400+
<key>include</key>
401+
<string>#variable</string>
402+
</dict>
403+
<dict>
404+
<key>include</key>
405+
<string>#variableNoProperty</string>
406+
</dict>
407+
<dict>
408+
<key>include</key>
409+
<string>#hashtable</string>
410+
</dict>
411+
<dict>
412+
<key>include</key>
413+
<string>#scriptblock</string>
414+
</dict>
415+
<dict>
416+
<key>include</key>
417+
<string>#doubleQuotedStringEscapes</string>
418+
</dict>
419+
<dict>
420+
<key>include</key>
421+
<string>#doubleQuotedString</string>
422+
</dict>
423+
<dict>
424+
<key>include</key>
425+
<string>#type</string>
426+
</dict>
427+
<dict>
428+
<key>include</key>
429+
<string>#numericConstant</string>
430+
</dict>
431+
<dict>
432+
<key>include</key>
433+
<string>#doubleQuotedString</string>
434+
</dict>
448435
<dict>
449436
<key>match</key>
450-
<string>''</string>
451-
<key>name</key>
452-
<string>constant.character.escape.powershell</string>
437+
<string>(?i)\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|positionalbinding|helpuri|confirmimpact|helpmessage)\b(?:\s+)?(=)</string>
438+
<key>captures</key>
439+
<dict>
440+
<key>1</key>
441+
<dict>
442+
<key>name</key>
443+
<string>variable.parameter.attribute.powershell</string>
444+
</dict>
445+
<key>2</key>
446+
<dict>
447+
<key>name</key>
448+
<string>keyword.operator.assignment.powershell</string>
449+
</dict>
450+
</dict>
451+
</dict>
452+
<dict>
453+
<key>begin</key>
454+
<string>(?&lt;!')'</string>
455+
<key>end</key>
456+
<string>'(?!')</string>
457+
<key>name</key>
458+
<string>string.quoted.single.powershell</string>
459+
<key>patterns</key>
460+
<array>
461+
<dict>
462+
<key>match</key>
463+
<string>''</string>
464+
<key>name</key>
465+
<string>constant.character.escape.powershell</string>
466+
</dict>
467+
</array>
453468
</dict>
454469
</array>
455470
</dict>

0 commit comments

Comments
 (0)