@@ -6,93 +6,127 @@ using namespace system.management.automation
66# ^ punctuation.accessor.dot.powershell
77# ^ punctuation.accessor.dot.powershell
88
9+ class Foo : Bar, Baz { }
10+ # ^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
11+ # ^^^^ keyword.declaration.class.powershell
12+ # ^^^ entity.name.class.powershell
13+ # @@@ definition
14+ # ^ punctuation.separator.type.powershell
15+ # ^^^ entity.other.inherited-class.powershell
16+ # @@@ reference
17+ # ^ punctuation.separator.sequence.powershell
18+ # ^^^ entity.other.inherited-class.powershell
19+ # @@@ reference
20+ # ^ punctuation.section.block.begin.powershell
21+ # ^ punctuation.section.block.end.powershell
22+
923# Define a class
1024class TypeName
11- # <- storage.type
12- # ^^^^^^^^ entity.name.class
25+ # ^^^^^^^^^^^^^ meta.class.powershell
26+ # ^^^^ keyword.declaration.class.powershell
27+ # ^^^^^^^^ entity.name.class.powershell
1328# @@@@@@@@ definition
1429{
1530 # Property with validate set
1631 # <- punctuation.definition.comment
1732 # ^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line
1833 [ValidateSet (" val1" , " Val2" )]
19- # ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attribute
20- # <- punctuation.section.brackets.begin
21- # ^^^^^^^^^^ support.function.attribute
22- # ^ punctuation.section.group.begin
23- # ^^^^^^ string.quoted.double
24- # ^ punctuation.separator
25- # ^^^^^^ string.quoted.double
26- # ^ punctuation.section.group.end
27- # ^ punctuation.section.brackets.end
34+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
35+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attribute.powershell
36+ # ^ punctuation.section.brackets.begin.powershell
37+ # ^^^^^^^^^^^ support.function.attribute.powershell
38+ # ^ punctuation.section.group.begin.powershell
39+ # ^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell
40+ # ^ punctuation.definition.string.begin.powershell
41+ # ^ punctuation.definition.string.end.powershell
42+ # ^ punctuation.separator.sequence.powershell
43+ # ^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell
44+ # ^ punctuation.definition.string.begin.powershell
45+ # ^ punctuation.definition.string.end.powershell
46+ # ^ punctuation.section.group.end.powershell
47+ # ^ punctuation.section.brackets.end.powershell
2848 [string ] $P1
29- # <- punctuation.section.brackets.begin
30- # ^^^^^ storage.type
31- # ^ punctuation.section.brackets.end
32- # ^ punctuation.definition.variable
33- # ^^ variable.other.readwrite
49+ # ^^^^^^^^^^^^^^^ meta.class.powershell
50+ # ^ punctuation.section.brackets.begin.powershell
51+ # ^^^^^^ storage.type.powershell
52+ # ^ punctuation.section.brackets.end.powershell
53+ # ^^^ variable.other.readwrite.powershell
54+ # ^ punctuation.definition.variable.powershell
3455
3556 # Static property
3657 # <- punctuation.definition.comment
3758 # ^^^^^^^^^^^^^^^ comment.line
3859 static [hashtable ] $P2
39- # ^^^^^ storage.modifier
40- # ^ punctuation.section.brackets.begin
41- # ^^^^^^^^^ storage.type
42- # ^ punctuation.section.brackets.end
43- # ^ punctuation.definition.variable
44- # ^^ variable.other.readwrite
60+ # ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
61+ # ^^^^^^ storage.modifier.powershell
62+ # ^ punctuation.section.brackets.begin.powershell
63+ # ^^^^^^^^^ storage.type.powershell
64+ # ^ punctuation.section.brackets.end.powershell
65+ # ^^^ variable.other.readwrite.powershell
66+ # ^ punctuation.definition.variable.powershell
4567
4668 # Hidden property does not show as result of Get-Member
4769 # <- punctuation.definition.comment
4870 # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line
4971 hidden [int ] $P3
50- # ^^^^^ storage.modifier
51- # ^ punctuation.section.brackets.begin
52- # ^ storage.type
53- # ^ punctuation.section.brackets.end
54- # ^ punctuation.definition.variable
55- # ^^ variable.other.readwrite
72+ # ^^^^^^^^^^^^^^^^^^^ meta.class.powershell
73+ # ^^^^^^ storage.modifier.powershell
74+ # ^ punctuation.section.brackets.begin.powershell
75+ # ^^^ storage.type.powershell
76+ # ^ punctuation.section.brackets.end.powershell
77+ # ^^^ variable.other.readwrite.powershell
78+ # ^ punctuation.definition.variable.powershell
5679
5780 # Constructor
5881 # <- punctuation.definition.comment
5982 # ^^^^^^^^^^^ comment.line
6083 TypeName ([string ] $s ) {
61- # ^ punctuation.section.group.begin
62- # ^ punctuation.section.brackets.begin
63- # ^^^^^^ storage.type
64- # ^ punctuation.section.brackets.end
65- # ^ punctuation.definition.variable
66- # ^ variable.other.readwrite
67- # ^ punctuation.section.group.end
84+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
85+ # ^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell
86+ # ^^^^^^^^ entity.name.function.powershell
87+ # @@@@@@@@ definition
88+ # ^ punctuation.section.parameters.begin.powershell
89+ # ^ punctuation.section.brackets.begin.powershell
90+ # ^^^^^^ storage.type.powershell
91+ # ^ punctuation.section.brackets.end.powershell
92+ # ^^ variable.parameter.powershell
93+ # ^ punctuation.definition.variable.begin.powershell
94+ # ^ punctuation.section.parameters.end.powershell
95+ # ^ punctuation.section.block.begin.powershell
6896 $this.P1 = $s
69- # <- punctuation.definition.variable
70- # ^ variable.language
71- # ^^ variable.other.member
72- # ^ keyword.operator.assignment
73- # ^ punctuation.definition.variable
74- # ^ variable.other.readwrite
97+ # ^^^^^^^^^^^^^^^^^^^^ meta.class.powershell meta.function.powershell
98+ # ^^^^^ variable.language.powershell
99+ # ^ punctuation.definition.variable.powershell
100+ # ^ punctuation.accessor.dot.powershell
101+ # ^^ variable.other.member.powershell
102+ # ^ keyword.operator.assignment.powershell
103+ # ^^ variable.other.readwrite.powershell
104+ # ^ punctuation.definition.variable.powershell
75105 }
76106
77107 # Static method
78108 # <- punctuation.definition.comment
79109 # ^^^^^^^^^^^^^ comment.line
80110 static [void ] MemberMethod1([hashtable ] $h ) {
81- # <- storage.modifier
82- # ^ punctuation.section.brackets.begin
83- # ^^^^ storage.type
84- # ^ punctuation.section.brackets.end
85- # ^^^^^^^^^^^^^ entity.name.function
86- # @@@@@@@@@@@@@ definition
87- # ^ punctuation.section.group.begin
88- # ^ punctuation.section.brackets.begin
89- # ^^^^^^^^^ storage.type
90- # ^ punctuation.section.brackets.end
91- # ^ punctuation.definition.variable
92- # ^ variable.other.readwrite
93- # ^ punctuation.section.group.end
111+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
112+ # ^^^ meta.function.powershell
113+ # ^^^^^^ storage.modifier.powershell
114+ # ^ punctuation.section.brackets.begin.powershell
115+ # ^^^^ storage.type.powershell
116+ # ^ punctuation.section.brackets.end.powershell
117+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell
118+ # ^^^^^^^^^^^^^ entity.name.function.powershell
119+ # @@@@@@@@@@@@@ definition
120+ # ^ punctuation.section.parameters.begin.powershell
121+ # ^ punctuation.section.brackets.begin.powershell
122+ # ^^^^^^^^^ storage.type.powershell
123+ # ^ punctuation.section.brackets.end.powershell
124+ # ^^ variable.parameter.powershell
125+ # ^ punctuation.definition.variable.begin.powershell
126+ # ^ punctuation.section.parameters.end.powershell
127+ # ^ punctuation.section.block.begin.powershell
94128 [TypeName ]::P2 = $h
95- # ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block .powershell meta.block .powershell
129+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class .powershell meta.function .powershell
96130# ^ punctuation.section.brackets.begin.powershell
97131# ^^^^^^^^ support.type.powershell
98132# ^ punctuation.section.brackets.end.powershell
@@ -107,27 +141,29 @@ class TypeName
107141 # <- punctuation.definition.comment
108142 # ^^^^^^^^^^^^^^^ comment.line
109143 [int ] MemberMethod2([int ] $i ) {
110- # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.block .powershell
111- # ^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell
144+ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class .powershell
145+ # ^^^ meta.function.powershell
112146# ^ punctuation.section.brackets.begin.powershell
113147# ^^^ storage.type.powershell
114148# ^ punctuation.section.brackets.end.powershell
149+ # ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell
115150# ^^^^^^^^^^^^^ entity.name.function.powershell
116151# @@@@@@@@@@@@@ definition
117- # ^^^^^^^^^^ meta.group.powershell
118- # ^ punctuation.section.group.begin.powershell
152+ # ^ punctuation.section.parameters.begin.powershell
119153# ^ punctuation.section.brackets.begin.powershell
120154# ^^^ storage.type.powershell
121155# ^ punctuation.section.brackets.end.powershell
122- # ^^ variable.other.readwrite .powershell
123- # ^ punctuation.definition.variable.powershell
124- # ^ punctuation.section.group .end.powershell
125- # ^ meta.block.powershell punctuation.section.braces .begin.powershell
156+ # ^^ variable.parameter .powershell
157+ # ^ punctuation.definition.variable.begin. powershell
158+ # ^ punctuation.section.parameters .end.powershell
159+ # ^ punctuation.section.block .begin.powershell
126160 return $this.P3
127- # <- keyword.control
128- # ^ punctuation.definition.variable
129- # ^^^^ variable.language
130- # ^^ variable.other.member
161+ # ^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell meta.function.powershell
162+ # ^^^^^^ keyword.control.flow.return.powershell
163+ # ^^^^^ variable.language.powershell
164+ # ^ punctuation.definition.variable.powershell
165+ # ^ punctuation.accessor.dot.powershell
166+ # ^^ variable.other.member.powershell
131167 }
132168}
133169
@@ -166,12 +202,15 @@ class Book {
166202 [string []] $Tags
167203 # Default constructor
168204 Book() { $this.Init (@ {}) }
205+ # @@@@ definition
169206# @@@@ reference
170207 # Convenience constructor from hashtable
171208 Book([hashtable ]$Properties ) { $this.Init ($Properties ) }
209+ # @@@@ definition
172210# @@@@ reference
173211 # Common constructor for title and author
174212 Book([string ]$Title , [string ]$Author ) {
213+ # @@@@ definition
175214 $this.Init (@ {Title = $Title ; Author = $Author })
176215# @@@@ reference
177216 }
@@ -336,6 +375,7 @@ class BookList {
336375 }
337376 # Find every book matching the filtering scriptblock.
338377 static [Book []] FindAll([scriptblock ]$Predicate ) {
378+ # @@@@@@@ definition
339379 [BookList ]::Initialize()
340380# @@@@@@@@@@ reference
341381 return [BookList ]::Books.FindAll($Predicate )
0 commit comments