Skip to content

Commit bfe273d

Browse files
committed
Fix inconsistencies in #1581
1 parent 88b7624 commit bfe273d

File tree

569 files changed

+1273
-699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

569 files changed

+1273
-699
lines changed

lib/src/model.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,9 +1474,9 @@ class Field extends ModelElement
14741474
bool get isInherited => _isInherited;
14751475

14761476
@override
1477-
String get kind => 'property';
1477+
String get kind => isConst ? 'constant' : 'property';
14781478

1479-
String get typeName => "property";
1479+
String get typeName => kind;
14801480

14811481
@override
14821482
List<String> get annotations {
@@ -4806,7 +4806,7 @@ class TopLevelVariable extends ModelElement
48064806
}
48074807

48084808
@override
4809-
String get kind => 'top-level property';
4809+
String get kind => isConst ? 'top-level constant' : 'top-level property';
48104810

48114811
@override
48124812
Set<String> get features => super.features..addAll(comboFeatures);

test/model_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,12 @@ void main() {
797797

798798
test('get constants', () {
799799
expect(Apple.publicConstants, hasLength(1));
800+
expect(Apple.publicConstants.first.kind, equals('constant'));
800801
});
801802

802803
test('get instance fields', () {
803804
expect(Apple.publicInstanceProperties, hasLength(3));
805+
expect(Apple.publicInstanceProperties.first.kind, equals('property'));
804806
});
805807

806808
test('get inherited properties, including properties of Object', () {
@@ -1910,6 +1912,10 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
19101912
expect(greenConstant.fullyQualifiedName, 'ex.COLOR_GREEN');
19111913
});
19121914

1915+
test('has the correct kind', () {
1916+
expect(greenConstant.kind, equals('top-level constant'));
1917+
});
1918+
19131919
test('has enclosing element', () {
19141920
expect(greenConstant.enclosingElement.name, equals(exLibrary.name));
19151921
});

testing/test_package_docs/anonymous_library/doesStuff.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ <h1>doesStuff function</h1>
5454

5555
<section class="multi-line-signature">
5656
<span class="returntype">String</span>
57-
<span class="name ">doesStuff</span>(<wbr>)
57+
<span class="name ">doesStuff</span>
58+
(<wbr>)
5859
</section>
5960

6061

testing/test_package_docs/another_anonymous_lib/greeting.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ <h1>greeting function</h1>
5454

5555
<section class="multi-line-signature">
5656
<span class="returntype">String</span>
57-
<span class="name ">greeting</span>(<wbr>)
57+
<span class="name ">greeting</span>
58+
(<wbr>)
5859
</section>
5960

6061

testing/test_package_docs/css/theOnlyThingInTheLibrary.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ <h1>theOnlyThingInTheLibrary top-level property</h1>
5454

5555
<section class="multi-line-signature">
5656
<span class="returntype">String</span>
57-
<span class="name ">theOnlyThingInTheLibrary</span> <div class="features">read / write</div>
57+
<span class="name ">theOnlyThingInTheLibrary</span>
58+
<div class="features">read / write</div>
5859
</section>
5960

6061

testing/test_package_docs/ex/Animal-class.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ <h2>Constants</h2>
121121
<dl class="properties">
122122
<dt id="CAT" class="constant">
123123
<span class="name ">CAT</span>
124-
<span class="signature">&#8594; <a href="ex/Animal-class.html">Animal</a></span>
124+
<span class="signature">&#8594; const <a href="ex/Animal-class.html">Animal</a></span>
125125
</dt>
126126
<dd>
127127
<p>Single line docs.</p>
@@ -132,7 +132,7 @@ <h2>Constants</h2>
132132
</dd>
133133
<dt id="DOG" class="constant">
134134
<span class="name ">DOG</span>
135-
<span class="signature">&#8594; <a href="ex/Animal-class.html">Animal</a></span>
135+
<span class="signature">&#8594; const <a href="ex/Animal-class.html">Animal</a></span>
136136
</dt>
137137
<dd>
138138
<p>Multi line docs.</p>
@@ -144,7 +144,7 @@ <h2>Constants</h2>
144144
</dd>
145145
<dt id="HORSE" class="constant">
146146
<span class="name ">HORSE</span>
147-
<span class="signature">&#8594; <a href="ex/Animal-class.html">Animal</a></span>
147+
<span class="signature">&#8594; const <a href="ex/Animal-class.html">Animal</a></span>
148148
</dt>
149149
<dd>
150150

@@ -155,7 +155,7 @@ <h2>Constants</h2>
155155
</dd>
156156
<dt id="values" class="constant">
157157
<span class="name ">values</span>
158-
<span class="signature">&#8594; List<span class="signature">&lt;<a href="ex/Animal-class.html">Animal</a>&gt;</span></span>
158+
<span class="signature">&#8594; const List<span class="signature">&lt;<a href="ex/Animal-class.html">Animal</a>&gt;</span></span>
159159
</dt>
160160
<dd>
161161
<p>A constant List of the values in this enum, in order of their declaration.</p>

testing/test_package_docs/ex/Animal/hashCode.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ <h1>hashCode property</h1>
7272

7373
<section class="multi-line-signature">
7474
<span class="returntype">int</span>
75-
<span class="name ">hashCode</span> <div class="features">inherited</div>
75+
<span class="name ">hashCode</span>
76+
<div class="features">inherited</div>
7677
</section>
7778

7879

testing/test_package_docs/ex/Animal/noSuchMethod.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ <h1>noSuchMethod method</h1>
6969

7070
<section class="multi-line-signature">
7171
<span class="returntype">dynamic</span>
72-
<span class="name ">noSuchMethod</span>(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation">Invocation</span> <span class="parameter-name">invocation</span></span>)
72+
<span class="name ">noSuchMethod</span>
73+
(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation">Invocation</span> <span class="parameter-name">invocation</span></span>)
7374
</section>
7475

7576

testing/test_package_docs/ex/Animal/operator_equals.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ <h1>operator == method</h1>
6969

7070
<section class="multi-line-signature">
7171
<span class="returntype">bool</span>
72-
<span class="name ">operator ==</span>(<wbr><span class="parameter" id="==-param-other"><span class="parameter-name">other</span></span>)
72+
<span class="name ">operator ==</span>
73+
(<wbr><span class="parameter" id="==-param-other"><span class="parameter-name">other</span></span>)
7374
</section>
7475

7576

testing/test_package_docs/ex/Animal/runtimeType.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ <h1>runtimeType property</h1>
7272

7373
<section class="multi-line-signature">
7474
<span class="returntype">Type</span>
75-
<span class="name ">runtimeType</span> <div class="features">inherited</div>
75+
<span class="name ">runtimeType</span>
76+
<div class="features">inherited</div>
7677
</section>
7778

7879

0 commit comments

Comments
 (0)