Skip to content

Commit bd2fe12

Browse files
committed
Match attribute scopes to C# annotations
1 parent 5d3fc73 commit bd2fe12

4 files changed

Lines changed: 202 additions & 177 deletions

File tree

PowerShell.sublime-syntax

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,21 +596,21 @@ contexts:
596596
attributes:
597597
- match: (\[)\s*(ValidatePattern)
598598
captures:
599-
1: punctuation.section.brackets.begin.powershell
600-
2: support.function.attribute.powershell
599+
1: punctuation.definition.annotation.begin.powershell
600+
2: variable.annotation.powershell
601601
push: inside-attribute
602602
with_prototype:
603603
- include: regex-strings
604604
- match: (\[)\s*({{attributes}})
605605
captures:
606-
1: punctuation.section.brackets.begin.powershell
607-
2: support.function.attribute.powershell
606+
1: punctuation.definition.annotation.begin.powershell
607+
2: variable.annotation.powershell
608608
push: inside-attribute
609609

610610
inside-attribute:
611-
- meta_scope: meta.attribute.powershell
611+
- meta_scope: meta.annotation.powershell
612612
- match: \]
613-
scope: punctuation.section.brackets.end.powershell
613+
scope: punctuation.definition.annotation.end.powershell
614614
pop: 1
615615
- match: \(
616616
scope: punctuation.section.group.begin.powershell

tests/syntax_test_Class.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class TypeName
3131
# <- punctuation.definition.comment
3232
# ^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line
3333
[ValidateSet("val1", "Val2")]
34-
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
35-
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attribute.powershell
36-
# ^ punctuation.section.brackets.begin.powershell
37-
# ^^^^^^^^^^^ support.function.attribute.powershell
34+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
35+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.annotation.powershell
36+
# ^ punctuation.definition.annotation.begin.powershell
37+
# ^^^^^^^^^^^ variable.annotation.powershell
3838
# ^ punctuation.section.group.begin.powershell
3939
# ^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell
4040
# ^ punctuation.definition.string.begin.powershell
@@ -44,7 +44,7 @@ class TypeName
4444
# ^ punctuation.definition.string.begin.powershell
4545
# ^ punctuation.definition.string.end.powershell
4646
# ^ punctuation.section.group.end.powershell
47-
# ^ punctuation.section.brackets.end.powershell
47+
# ^ punctuation.definition.annotation.end.powershell
4848
[string] $P1
4949
#^^^^^^^^^^^^^^^ meta.class.powershell
5050
# ^ punctuation.section.brackets.begin.powershell

0 commit comments

Comments
 (0)