Skip to content

Commit 4e2daf5

Browse files
authored
Rename LanguageFeature and remove FeatureSet mixin (#4099)
`LanguageFeature` was introduced in #2221 for chips indicating null safety. Since we now use chips for other purposes, such as class modifiers, the name is no longer descriptive. This change renames it to `Tag` to better model the general concept of a highlightable tag on an element. This is somewhat related to`Attribute` , and the two could potentially be merged in a future step. Furthermore, `FeatureSet` is removed and its functionality is inlined into `ModelElement`. Finally `ContainerModifier` is extended to store the class modifier description and URL directly, instead of in separate top level maps .
1 parent ecc48d0 commit 4e2daf5

29 files changed

+2132
-2265
lines changed

lib/resources/docs.dart.js

Lines changed: 1702 additions & 1654 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resources/docs.dart.js.map

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/generator/templates.aot_renderers_for_html.dart

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ String renderClass(ClassTemplateData context0) {
291291
buffer.write('''</span> ''');
292292
buffer.writeEscaped(context1.kind.toString());
293293
buffer.write(' ');
294-
buffer.write(_renderClass_partial_feature_set_2(context1));
294+
buffer.write(_renderClass_partial_tags_2(context1));
295295
buffer.write(' ');
296296
buffer.write(
297297
__renderCategory_partial_container_3_partial_categorization_0(context1),
@@ -393,7 +393,7 @@ String renderConstructor(ConstructorTemplateData context0) {
393393
buffer.write('''</span> ''');
394394
buffer.writeEscaped(context1.kind.toString());
395395
buffer.write(' ');
396-
buffer.write(_renderConstructor_partial_feature_set_2(context1));
396+
buffer.write(_renderConstructor_partial_tags_2(context1));
397397
buffer.write('''</h1></div>''');
398398
buffer.writeln();
399399
var context2 = context0.constructor;
@@ -469,7 +469,7 @@ String renderEnum(EnumTemplateData context0) {
469469
''');
470470
buffer.writeEscaped(context1.kind.toString());
471471
buffer.write(' ');
472-
buffer.write(_renderEnum_partial_feature_set_2(context1));
472+
buffer.write(_renderEnum_partial_tags_2(context1));
473473
buffer.write(' ');
474474
buffer.write(
475475
__renderCategory_partial_container_3_partial_categorization_0(context1),
@@ -624,7 +624,7 @@ String renderExtension<T extends Extension>(ExtensionTemplateData<T> context0) {
624624
buffer.write('''</span> ''');
625625
buffer.writeEscaped(context1.kind.toString());
626626
buffer.write(' ');
627-
buffer.write(_renderExtension_partial_feature_set_2(context1));
627+
buffer.write(_renderExtension_partial_tags_2(context1));
628628
buffer.write(' ');
629629
buffer.write(
630630
__renderCategory_partial_container_3_partial_categorization_0(context1),
@@ -712,7 +712,7 @@ String renderExtensionType<T extends ExtensionType>(
712712
''');
713713
buffer.writeEscaped(context1.kind.toString());
714714
buffer.write(' ');
715-
buffer.write(_renderExtensionType_partial_feature_set_2(context1));
715+
buffer.write(_renderExtensionType_partial_tags_2(context1));
716716
buffer.write(' ');
717717
buffer.write(
718718
__renderCategory_partial_container_3_partial_categorization_0(context1),
@@ -820,7 +820,7 @@ String renderFunction(FunctionTemplateData context0) {
820820
buffer.write('''</span> ''');
821821
buffer.writeEscaped(context1.kind.toString());
822822
buffer.write(' ');
823-
buffer.write(_renderFunction_partial_feature_set_2(context1));
823+
buffer.write(_renderFunction_partial_tags_2(context1));
824824
buffer.write(' ');
825825
buffer.write(
826826
__renderCategory_partial_callable_8_partial_categorization_0(context1),
@@ -990,7 +990,7 @@ String renderLibrary(LibraryTemplateData context0) {
990990
''');
991991
buffer.writeEscaped(context1.kind.toString());
992992
buffer.write(' ');
993-
buffer.write(_renderLibrary_partial_feature_set_2(context1));
993+
buffer.write(_renderLibrary_partial_tags_2(context1));
994994
buffer.write(' ');
995995
buffer.write(
996996
__renderCategory_partial_library_2_partial_categorization_0(context1),
@@ -1259,7 +1259,7 @@ String renderMethod(MethodTemplateData context0) {
12591259
buffer.write('''</span> ''');
12601260
buffer.writeEscaped(context1.fullkind);
12611261
buffer.write(' ');
1262-
buffer.write(_renderMethod_partial_feature_set_2(context1));
1262+
buffer.write(_renderMethod_partial_tags_2(context1));
12631263
buffer.write('''</h1></div>''');
12641264
buffer.writeln();
12651265
var context2 = context0.method;
@@ -1337,7 +1337,7 @@ String renderMixin(MixinTemplateData context0) {
13371337
buffer.write('''</span> ''');
13381338
buffer.writeEscaped(context1.kind.toString());
13391339
buffer.write(' ');
1340-
buffer.write(_renderMixin_partial_feature_set_2(context1));
1340+
buffer.write(_renderMixin_partial_tags_2(context1));
13411341
buffer.write(' ');
13421342
buffer.write(
13431343
__renderCategory_partial_container_3_partial_categorization_0(context1),
@@ -1451,7 +1451,7 @@ String renderProperty(PropertyTemplateData context0) {
14511451
buffer.write('''</span> ''');
14521452
buffer.writeEscaped(context1.kind.toString());
14531453
buffer.write(' ');
1454-
buffer.write(_renderProperty_partial_feature_set_2(context1));
1454+
buffer.write(_renderProperty_partial_tags_2(context1));
14551455
buffer.write('''</h1></div>''');
14561456
buffer.writeln();
14571457
var context2 = context0.self;
@@ -1922,7 +1922,7 @@ String renderTopLevelProperty(TopLevelPropertyTemplateData context0) {
19221922
buffer.write('''</span> ''');
19231923
buffer.writeEscaped(context1.kind.toString());
19241924
buffer.write(' ');
1925-
buffer.write(_renderTopLevelProperty_partial_feature_set_2(context1));
1925+
buffer.write(_renderTopLevelProperty_partial_tags_2(context1));
19261926
buffer.write(' ');
19271927
buffer.write(
19281928
__renderCategory_partial_constant_6_partial_categorization_0(context1),
@@ -2003,7 +2003,7 @@ String renderTypedef(TypedefTemplateData context0) {
20032003
buffer.write('''</span> ''');
20042004
buffer.writeEscaped(context1.kind.toString());
20052005
buffer.write(' ');
2006-
buffer.write(_renderTypedef_partial_feature_set_2(context1));
2006+
buffer.write(_renderTypedef_partial_tags_2(context1));
20072007
buffer.write(' ');
20082008
buffer.write(
20092009
___renderCategory_partial_typedef_10_partial_type_2_partial_categorization_0(
@@ -2356,20 +2356,6 @@ String _deduplicated__documentation(Warnable context0) {
23562356
return buffer.toString();
23572357
}
23582358

2359-
String _deduplicated__feature_set(ModelElement context0) {
2360-
final buffer = StringBuffer();
2361-
if (context0.hasFeatureSet) {
2362-
var context1 = context0.displayedLanguageFeatures;
2363-
for (var context2 in context1) {
2364-
buffer.write('\n ');
2365-
buffer.write(context2.featureLabel);
2366-
}
2367-
}
2368-
buffer.writeln();
2369-
2370-
return buffer.toString();
2371-
}
2372-
23732359
String _deduplicated__footer(TemplateDataBase context0) {
23742360
final buffer = StringBuffer();
23752361
buffer.write('''</main>
@@ -2927,6 +2913,20 @@ String _deduplicated__super_chain(InheritingContainer context0) {
29272913
return buffer.toString();
29282914
}
29292915

2916+
String _deduplicated__tags(ModelElement context0) {
2917+
final buffer = StringBuffer();
2918+
if (context0.hasTags) {
2919+
var context1 = context0.tags;
2920+
for (var context2 in context1) {
2921+
buffer.write('\n ');
2922+
buffer.write(context2.label);
2923+
}
2924+
}
2925+
buffer.writeln();
2926+
2927+
return buffer.toString();
2928+
}
2929+
29302930
String _renderCategory_partial_callable_8(ModelFunctionTyped context2) {
29312931
final buffer = StringBuffer();
29322932
buffer.write('''<dt id="''');
@@ -3394,9 +3394,6 @@ String _renderClass_partial_container_annotations_9(Class context1) =>
33943394
String _renderClass_partial_documentation_4(Class context1) =>
33953395
_deduplicated__documentation(context1);
33963396

3397-
String _renderClass_partial_feature_set_2(Class context1) =>
3398-
_deduplicated__feature_set(context1);
3399-
34003397
String _renderClass_partial_footer_18(ClassTemplateData context0) =>
34013398
_deduplicated__footer(context0);
34023399

@@ -3457,15 +3454,15 @@ String _renderClass_partial_static_properties_14(Class context1) =>
34573454
String _renderClass_partial_super_chain_5(Class context1) =>
34583455
_deduplicated__super_chain(context1);
34593456

3457+
String _renderClass_partial_tags_2(Class context1) =>
3458+
_deduplicated__tags(context1);
3459+
34603460
String _renderConstructor_partial_annotations_3(Constructor context1) =>
34613461
_deduplicated__annotations(context1);
34623462

34633463
String _renderConstructor_partial_documentation_4(Constructor context1) =>
34643464
_deduplicated__documentation(context1);
34653465

3466-
String _renderConstructor_partial_feature_set_2(Constructor context1) =>
3467-
_deduplicated__feature_set(context1);
3468-
34693466
String _renderConstructor_partial_footer_7(ConstructorTemplateData context0) =>
34703467
_deduplicated__footer(context0);
34713468

@@ -3482,6 +3479,9 @@ String _renderConstructor_partial_source_code_5(Constructor context1) =>
34823479
String _renderConstructor_partial_source_link_1(Constructor context1) =>
34833480
_deduplicated__source_link(context1);
34843481

3482+
String _renderConstructor_partial_tags_2(Constructor context1) =>
3483+
_deduplicated__tags(context1);
3484+
34853485
String _renderEnum_partial_available_extensions_8(Enum context1) =>
34863486
_deduplicated__available_extensions(context1);
34873487

@@ -3491,9 +3491,6 @@ String _renderEnum_partial_container_annotations_9(Enum context1) =>
34913491
String _renderEnum_partial_documentation_4(Enum context1) =>
34923492
_deduplicated__documentation(context1);
34933493

3494-
String _renderEnum_partial_feature_set_2(Enum context1) =>
3495-
_deduplicated__feature_set(context1);
3496-
34973494
String _renderEnum_partial_footer_18(EnumTemplateData context0) =>
34983495
_deduplicated__footer(context0);
34993496

@@ -3554,6 +3551,9 @@ String _renderEnum_partial_static_properties_14(Enum context1) =>
35543551
String _renderEnum_partial_super_chain_5(Enum context1) =>
35553552
_deduplicated__super_chain(context1);
35563553

3554+
String _renderEnum_partial_tags_2(Enum context1) =>
3555+
_deduplicated__tags(context1);
3556+
35573557
String _renderError_partial_footer_3(PackageTemplateData context0) =>
35583558
_deduplicated__footer(context0);
35593559

@@ -3580,9 +3580,6 @@ String _renderExtensionType_partial_container_annotations_7(
35803580
String _renderExtensionType_partial_documentation_4(ExtensionType context1) =>
35813581
_deduplicated__documentation(context1);
35823582

3583-
String _renderExtensionType_partial_feature_set_2(ExtensionType context1) =>
3584-
_deduplicated__feature_set(context1);
3585-
35863583
String _renderExtensionType_partial_footer_16<T extends ExtensionType>(
35873584
ExtensionTypeTemplateData<T> context0,
35883585
) => _deduplicated__footer(context0);
@@ -3623,15 +3620,15 @@ String _renderExtensionType_partial_static_properties_12(
36233620
ExtensionType context1,
36243621
) => _deduplicated__static_properties(context1);
36253622

3623+
String _renderExtensionType_partial_tags_2(ExtensionType context1) =>
3624+
_deduplicated__tags(context1);
3625+
36263626
String _renderExtension_partial_container_annotations_5(Extension context1) =>
36273627
_deduplicated__container_annotations(context1);
36283628

36293629
String _renderExtension_partial_documentation_4(Extension context1) =>
36303630
_deduplicated__documentation(context1);
36313631

3632-
String _renderExtension_partial_feature_set_2(Extension context1) =>
3633-
_deduplicated__feature_set(context1);
3634-
36353632
String _renderExtension_partial_footer_13<T extends Extension>(
36363633
ExtensionTemplateData<T> context0,
36373634
) => _deduplicated__footer(context0);
@@ -3665,6 +3662,9 @@ String _renderExtension_partial_static_methods_10(Extension context1) =>
36653662
String _renderExtension_partial_static_properties_9(Extension context1) =>
36663663
_deduplicated__static_properties(context1);
36673664

3665+
String _renderExtension_partial_tags_2(Extension context1) =>
3666+
_deduplicated__tags(context1);
3667+
36683668
String _renderFunction_partial_callable_multiline_4(ModelFunction context1) {
36693669
final buffer = StringBuffer();
36703670
buffer.write(
@@ -3696,9 +3696,6 @@ String _renderFunction_partial_callable_multiline_4(ModelFunction context1) {
36963696
String _renderFunction_partial_documentation_6(ModelFunction context1) =>
36973697
_deduplicated__documentation(context1);
36983698

3699-
String _renderFunction_partial_feature_set_2(ModelFunction context1) =>
3700-
_deduplicated__feature_set(context1);
3701-
37023699
String _renderFunction_partial_footer_9(FunctionTemplateData context0) =>
37033700
_deduplicated__footer(context0);
37043701

@@ -3715,6 +3712,9 @@ String _renderFunction_partial_source_code_7(ModelFunction context1) =>
37153712
String _renderFunction_partial_source_link_1(ModelFunction context1) =>
37163713
_deduplicated__source_link(context1);
37173714

3715+
String _renderFunction_partial_tags_2(ModelFunction context1) =>
3716+
_deduplicated__tags(context1);
3717+
37183718
String _renderIndex_partial_documentation_1(Package context1) =>
37193719
_deduplicated__documentation(context1);
37203720

@@ -3748,9 +3748,6 @@ String _renderLibrary_partial_extension_type_8(ExtensionType context3) {
37483748
return buffer.toString();
37493749
}
37503750

3751-
String _renderLibrary_partial_feature_set_2(Library context1) =>
3752-
_deduplicated__feature_set(context1);
3753-
37543751
String _renderLibrary_partial_footer_17(LibraryTemplateData context0) =>
37553752
_deduplicated__footer(context0);
37563753

@@ -3766,6 +3763,9 @@ String _renderLibrary_partial_search_sidebar_15(LibraryTemplateData context0) =>
37663763
String _renderLibrary_partial_source_link_1(Library context1) =>
37673764
_deduplicated__source_link(context1);
37683765

3766+
String _renderLibrary_partial_tags_2(Library context1) =>
3767+
_deduplicated__tags(context1);
3768+
37693769
String _renderMethod_partial_callable_multiline_3(Method context1) {
37703770
final buffer = StringBuffer();
37713771
buffer.write(
@@ -3795,9 +3795,6 @@ String _renderMethod_partial_callable_multiline_3(Method context1) {
37953795
String _renderMethod_partial_documentation_5(Method context1) =>
37963796
_deduplicated__documentation(context1);
37973797

3798-
String _renderMethod_partial_feature_set_2(Method context1) =>
3799-
_deduplicated__feature_set(context1);
3800-
38013798
String _renderMethod_partial_footer_8(MethodTemplateData context0) =>
38023799
_deduplicated__footer(context0);
38033800

@@ -3813,6 +3810,9 @@ String _renderMethod_partial_source_code_6(Method context1) =>
38133810
String _renderMethod_partial_source_link_1(Method context1) =>
38143811
_deduplicated__source_link(context1);
38153812

3813+
String _renderMethod_partial_tags_2(Method context1) =>
3814+
_deduplicated__tags(context1);
3815+
38163816
String _renderMixin_partial_annotations_8(Mixin context1) =>
38173817
_deduplicated__annotations(context1);
38183818

@@ -3822,9 +3822,6 @@ String _renderMixin_partial_available_extensions_7(Mixin context1) =>
38223822
String _renderMixin_partial_documentation_4(Mixin context1) =>
38233823
_deduplicated__documentation(context1);
38243824

3825-
String _renderMixin_partial_feature_set_2(Mixin context1) =>
3826-
_deduplicated__feature_set(context1);
3827-
38283825
String _renderMixin_partial_footer_16(MixinTemplateData context0) =>
38293826
_deduplicated__footer(context0);
38303827

@@ -3861,6 +3858,9 @@ String _renderMixin_partial_static_properties_12(Mixin context1) =>
38613858
String _renderMixin_partial_super_chain_5(Mixin context1) =>
38623859
_deduplicated__super_chain(context1);
38633860

3861+
String _renderMixin_partial_tags_2(Mixin context1) =>
3862+
_deduplicated__tags(context1);
3863+
38643864
String _renderProperty_partial_accessor_getter_8(Field context1) =>
38653865
_deduplicated__accessor_getter(context1);
38663866

@@ -3873,9 +3873,6 @@ String _renderProperty_partial_annotations_3(Field context1) =>
38733873
String _renderProperty_partial_documentation_6(Field context1) =>
38743874
_deduplicated__documentation(context1);
38753875

3876-
String _renderProperty_partial_feature_set_2(Field context1) =>
3877-
_deduplicated__feature_set(context1);
3878-
38793876
String _renderProperty_partial_footer_11(PropertyTemplateData context0) =>
38803877
_deduplicated__footer(context0);
38813878

@@ -3895,6 +3892,9 @@ String _renderProperty_partial_source_code_7(Field context1) =>
38953892
String _renderProperty_partial_source_link_1(Field context1) =>
38963893
_deduplicated__source_link(context1);
38973894

3895+
String _renderProperty_partial_tags_2(Field context1) =>
3896+
_deduplicated__tags(context1);
3897+
38983898
String _renderSidebarForContainer_partial_container_sidebar_item_0(
38993899
Field context2,
39003900
) {
@@ -3967,10 +3967,6 @@ String _renderTopLevelProperty_partial_documentation_7(
39673967
TopLevelVariable context1,
39683968
) => _deduplicated__documentation(context1);
39693969

3970-
String _renderTopLevelProperty_partial_feature_set_2(
3971-
TopLevelVariable context1,
3972-
) => _deduplicated__feature_set(context1);
3973-
39743970
String _renderTopLevelProperty_partial_footer_12(
39753971
TopLevelPropertyTemplateData context0,
39763972
) => _deduplicated__footer(context0);
@@ -3995,12 +3991,12 @@ String _renderTopLevelProperty_partial_source_link_1(
39953991
TopLevelVariable context1,
39963992
) => _deduplicated__source_link(context1);
39973993

3994+
String _renderTopLevelProperty_partial_tags_2(TopLevelVariable context1) =>
3995+
_deduplicated__tags(context1);
3996+
39983997
String _renderTypedef_partial_documentation_5(Typedef context1) =>
39993998
_deduplicated__documentation(context1);
40003999

4001-
String _renderTypedef_partial_feature_set_2(Typedef context1) =>
4002-
_deduplicated__feature_set(context1);
4003-
40044000
String _renderTypedef_partial_footer_8(TypedefTemplateData context0) =>
40054001
_deduplicated__footer(context0);
40064002

@@ -4016,6 +4012,9 @@ String _renderTypedef_partial_source_code_6(Typedef context1) =>
40164012
String _renderTypedef_partial_source_link_1(Typedef context1) =>
40174013
_deduplicated__source_link(context1);
40184014

4015+
String _renderTypedef_partial_tags_2(Typedef context1) =>
4016+
_deduplicated__tags(context1);
4017+
40194018
String _renderTypedef_partial_typedef_multiline_4(Typedef context1) {
40204019
final buffer = StringBuffer();
40214020
if (context1.isCallable) {

0 commit comments

Comments
 (0)