diff --git a/lib/src/element_type.dart b/lib/src/element_type.dart index 2a06a58da3..67162748fd 100644 --- a/lib/src/element_type.dart +++ b/lib/src/element_type.dart @@ -423,7 +423,7 @@ class GenericTypeAliasElementType extends TypeParameterElementType { extension on DartType { /// The dartdoc nullability suffix for this type in [library]. String nullabilitySuffixWithin(Library library) { - if (library.isNullSafety && !isVoid && !isBottom) { + if (!isVoid && !isBottom) { /// If a legacy type appears inside the public interface of a Null /// safety library, we pretend it is nullable for the purpose of /// documentation (since star-types are not supposed to be public). diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index 5c1e5801ee..272e57b4cd 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -5261,13 +5261,6 @@ class _Renderer_FeatureSet extends RendererBase { self.renderSimpleVariable(c, remainingNames, 'bool'), getBool: (CT_ c) => c.hasFeatureSet == true, ), - 'isNullSafety': Property( - getValue: (CT_ c) => c.isNullSafety, - renderVariable: (CT_ c, Property self, - List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'bool'), - getBool: (CT_ c) => c.isNullSafety == true, - ), 'library': Property( getValue: (CT_ c) => c.library, renderVariable: @@ -7826,13 +7819,6 @@ class _Renderer_Library extends RendererBase { self.renderSimpleVariable(c, remainingNames, 'bool'), getBool: (CT_ c) => c.isInSdk == true, ), - 'isNullSafety': Property( - getValue: (CT_ c) => c.isNullSafety, - renderVariable: (CT_ c, Property self, - List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'bool'), - getBool: (CT_ c) => c.isNullSafety == true, - ), 'isPublic': Property( getValue: (CT_ c) => c.isPublic, renderVariable: (CT_ c, Property self, diff --git a/lib/src/model/feature_set.dart b/lib/src/model/feature_set.dart index f3bbb58daf..01b47f58d1 100644 --- a/lib/src/model/feature_set.dart +++ b/lib/src/model/feature_set.dart @@ -13,18 +13,7 @@ mixin FeatureSet { /// A list of language features that both apply to this [ModelElement] and /// make sense to display in context. - Iterable get displayedLanguageFeatures sync* { - // TODO(jcollins-g): Implement mixed-mode handling and the tagging of - // legacy interfaces. - if (isNullSafety) { - yield LanguageFeature( - 'Null safety', packageGraph.rendererFactory.languageFeatureRenderer); - } - } + Iterable get displayedLanguageFeatures => const []; bool get hasFeatureSet => displayedLanguageFeatures.isNotEmpty; - - // TODO(jcollins-g): This is an approximation and not strictly true for - // inheritance/reexports. - bool get isNullSafety => library.isNullSafety; } diff --git a/lib/src/model/language_feature.dart b/lib/src/model/language_feature.dart index 753190d419..0813f2ac0e 100644 --- a/lib/src/model/language_feature.dart +++ b/lib/src/model/language_feature.dart @@ -4,13 +4,9 @@ import 'package:dartdoc/src/render/language_feature_renderer.dart'; -const Map _featureDescriptions = { - 'Null safety': 'Supports the null safety language feature.', -}; +const Map _featureDescriptions = {}; -const Map _featureUrls = { - 'Null safety': 'https://dart.dev/null-safety', -}; +const Map _featureUrls = {}; /// An abstraction for a language feature; used to render tags to notify /// the user that the documentation should be specially interpreted. diff --git a/lib/src/model/library.dart b/lib/src/model/library.dart index 6900a02c2c..8eed6440ad 100644 --- a/lib/src/model/library.dart +++ b/lib/src/model/library.dart @@ -208,17 +208,6 @@ class Library extends ModelElement with Categorization, TopLevelContainer { @override Scope get scope => element.scope; - /// Whether this library is in a package configured to be treated as using - /// null safety and itself uses null safety. - bool get _allowsNullSafety => element.isNonNullableByDefault; - - /// Whether this library should be documented as using null safety. - /// - /// A library may use null safety but not be documented that way. - @override - bool get isNullSafety => - config.enableExperiment.contains('non-nullable') && _allowsNullSafety; - bool get isInSdk => element.isInSdk; /// [allModelElements] resolved to their original names. diff --git a/test/end2end/model_test.dart b/test/end2end/model_test.dart index 356e1cdd7a..31e5fa70a1 100644 --- a/test/end2end/model_test.dart +++ b/test/end2end/model_test.dart @@ -314,10 +314,6 @@ void main() { equals('')); }); - test('isNullSafety is set correctly for libraries', () { - expect(lateFinalWithoutInitializer.isNullSafety, isTrue); - }); - test('method parameters with required', () { var m1 = b.instanceMethods.firstWhere((m) => m.name == 'm1'); var p1 = m1.parameters.firstWhere((p) => p.name == 'p1'); @@ -416,7 +412,6 @@ void main() { test('complex nullable elements are detected and rendered correctly', () { var complexNullableMembers = nullableElements.allClasses .firstWhere((c) => c.name == 'ComplexNullableMembers'); - expect(complexNullableMembers.isNullSafety, isTrue); expect( complexNullableMembers.nameWithGenerics, equals( @@ -430,7 +425,6 @@ void main() { .firstWhere((f) => f.name == 'methodWithNullables'); var operatorStar = nullableMembers.publicInstanceOperators .firstWhere((f) => f.name == 'operator *'); - expect(nullableMembers.isNullSafety, isTrue); expect( methodWithNullables.linkedParams, equals(