Skip to content

Commit 95a45b1

Browse files
authored
Remove string substitution-based const value links (#1548)
* Flatten changes one last time * Get rid of the problematic const linking. * Fix tests post analyzer update * Review comments * Disable travis temporarily
1 parent 3076a2e commit 95a45b1

File tree

7 files changed

+10
-16
lines changed

7 files changed

+10
-16
lines changed

lib/src/model.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,15 +1561,9 @@ abstract class GetterSetterCombo implements ModelElement {
15611561
return _constantValueBase;
15621562
}
15631563

1564-
String linkifyWithModelType(String text) {
1565-
RegExp r = new RegExp("\\b${modelType.name}\\b");
1566-
return text?.replaceAll(r, modelType.linkedName);
1567-
}
1568-
1569-
String get constantValue => linkifyWithModelType(constantValueBase);
1564+
String get constantValue => constantValueBase;
15701565

1571-
String get constantValueTruncated =>
1572-
linkifyWithModelType(truncateString(constantValueBase, 200));
1566+
String get constantValueTruncated => truncateString(constantValueBase, 200);
15731567

15741568
/// Returns true if both accessors are synthetic.
15751569
bool get hasSyntheticAccessors {

test/model_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,9 +1902,9 @@ String topLevelFunction(int param1, bool param2, Cool coolBeans,
19021902
"const <String> [COLOR_GREEN, COLOR_ORANGE, 'blue']");
19031903
});
19041904

1905-
test('MY_CAT is linked', () {
1905+
test('MY_CAT is not linked', () {
19061906
expect(cat.constantValue,
1907-
'const <a href="ex/ConstantCat-class.html">ConstantCat</a>(&#39;tabby&#39;)');
1907+
'const ConstantCat(&#39;tabby&#39;)');
19081908
});
19091909

19101910
test('exported property', () {

testing/test_package_docs/ex/MY_CAT-constant.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h5>library ex</h5>
110110

111111
<section class="multi-line-signature">
112112
<span class="name ">MY_CAT</span> =
113-
<span class="constant-value">const <a href="ex/ConstantCat-class.html">ConstantCat</a>(&#39;tabby&#39;)</span>
113+
<span class="constant-value">const ConstantCat(&#39;tabby&#39;)</span>
114114

115115
</section>
116116

testing/test_package_docs/ex/deprecated-constant.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h5>library ex</h5>
110110

111111
<section class="multi-line-signature">
112112
<span class="name ">deprecated</span> =
113-
<span class="constant-value">const <a href="ex/Deprecated-class.html">Deprecated</a>(&quot;next release&quot;)</span>
113+
<span class="constant-value">const Deprecated(&quot;next release&quot;)</span>
114114

115115
</section>
116116

testing/test_package_docs/ex/ex-library.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ <h2>Constants</h2>
293293

294294

295295
<div>
296-
<span class="signature"><code>const <a href="ex/Deprecated-class.html">Deprecated</a>(&quot;next release&quot;)</code></span>
296+
<span class="signature"><code>const Deprecated(&quot;next release&quot;)</code></span>
297297
</div>
298298
</dd>
299299
<dt id="incorrectDocReference" class="constant">
@@ -326,7 +326,7 @@ <h2>Constants</h2>
326326

327327

328328
<div>
329-
<span class="signature"><code>const <a href="ex/ConstantCat-class.html">ConstantCat</a>(&#39;tabby&#39;)</code></span>
329+
<span class="signature"><code>const ConstantCat(&#39;tabby&#39;)</code></span>
330330
</div>
331331
</dd>
332332
<dt id="PRETTY_COLORS" class="constant">

testing/test_package_docs/fake/CUSTOM_CLASS-constant.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ <h5>library fake</h5>
126126

127127
<section class="multi-line-signature">
128128
<span class="name ">CUSTOM_CLASS</span> =
129-
<span class="constant-value">const <a href="fake/ConstantClass-class.html">ConstantClass</a>(&#39;custom&#39;)</span>
129+
<span class="constant-value">const ConstantClass(&#39;custom&#39;)</span>
130130

131131
</section>
132132

testing/test_package_docs/fake/fake-library.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ <h2>Constants</h2>
243243

244244

245245
<div>
246-
<span class="signature"><code>const <a href="fake/ConstantClass-class.html">ConstantClass</a>(&#39;custom&#39;)</code></span>
246+
<span class="signature"><code>const ConstantClass(&#39;custom&#39;)</code></span>
247247
</div>
248248
</dd>
249249
<dt id="DOWN" class="constant">

0 commit comments

Comments
 (0)