Move the filterNonDocumented
and filterNonPublic
functions as extension getters
#3699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
filterNonPublic
becomes an extension getter,wherePublic
, andfilterNonDocumented
becomes an extension getter,whereDocumented
.Nameable now implements Privacy. Privacy is now an abstract interface class.
Changing all the call sites highlights a number of ModelElement getters that are superfluous. For example,
Container.publicInstanceMethods
. This was a getter that now boils down toinstanceMethods.wherePublic
, and it really is unneccessary to keep this; there are many such methods that are removed here:publicInstanceMethods
,publicInstanceOperators
,publicInstanceFields
,publicConstantFields
,publicSuperChain
,publicInheritedFields
,publicInheritedMethods
,publicLibraries
,documentedCategories
,documentedExtensions
,publicClasses
,publicExtensions
,publicExtensionTypes
,publicConstants
,publicEnums
,_publicExceptions
,publicFunctions
,publicMixins
,publicProperties
,publicTypedefs
.Additionally, this change highlights some small inefficiency in some
hasX
methods. For example,hasPublicInstanceMethods
used to enumerate all of the public instance methods, then ask if the list is empty. Now we can ask ifany
of theinstanceMethods
arepublic
.hasPublicInstanceMethods
,hasPublicInstanceOperators
,hasPublicInstanceFields
,hasPublicConstantFields
,hasPublicVariableStaticFields
,hasPublicStaticMethods
,hasPublicEnumValues
,hasPublicInheritedMethods
,hasPublicSuperChainReversed
,hasPublicMixedInTypes
,hasPublicLibraries
,hasDocumentedCategories
,hasPublicClasses
,hasPublicExtensions
,hasPublicExtensionTypes
,hasPublicConstants
,hasPublicEnums
,hasPublicExceptions
,hasPublicFunctions
,hasPublicMixins
,hasPublicProperties
,hasPublicTypedefs
.Because the field
InheritingContaier.publicSuperChain
is removed, I changesuperChain
from a getter to a field, sort of the point of caching.Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.