-
Notifications
You must be signed in to change notification settings - Fork 130
Refactor how Object and Pragma are discovered and handled #3929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,6 @@ import 'package:dartdoc/src/model/model.dart'; | |
| import 'package:dartdoc/src/model_utils.dart' as utils; | ||
| import 'package:dartdoc/src/package_meta.dart' | ||
| show PackageMeta, PackageMetaProvider; | ||
| import 'package:dartdoc/src/special_elements.dart'; | ||
| import 'package:dartdoc/src/tool_definition.dart'; | ||
| import 'package:dartdoc/src/tool_runner.dart'; | ||
| import 'package:dartdoc/src/warnings.dart'; | ||
|
|
@@ -118,29 +117,6 @@ class PackageGraph with CommentReferable, Nameable { | |
| bool _shouldIncludeLibrary(LibraryElement libraryElement) => | ||
| config.include.isEmpty || config.include.contains(libraryElement.name); | ||
|
|
||
| /// Adds [resolvedLibrary] as a special library to the package graph, which | ||
| /// adds the library to [_allLibraries], but does not add it to any [Package]'s | ||
| /// list of libraries. | ||
| /// | ||
| /// Call during initialization to add a library possibly containing | ||
| /// special/non-documented elements to this [PackageGraph]. Must be called | ||
| /// after any normal libraries. | ||
| void addSpecialLibraryToGraph(DartDocResolvedLibrary resolvedLibrary) { | ||
| allLibrariesAdded = true; | ||
| assert(!_localDocumentationBuilt); | ||
| final libraryElement = resolvedLibrary.element.library; | ||
| _allLibraries.putIfAbsent( | ||
| libraryElement.source.fullName, | ||
| () => Library.fromLibraryResult( | ||
| resolvedLibrary, | ||
| this, | ||
| Package.fromPackageMeta( | ||
| packageMetaProvider.fromElement(libraryElement, config.sdkDir)!, | ||
| packageGraph), | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| /// Call after all libraries are added. | ||
| Future<void> initializePackageGraph() async { | ||
| assert(!_localDocumentationBuilt); | ||
|
|
@@ -170,9 +146,6 @@ class PackageGraph with CommentReferable, Nameable { | |
| } | ||
| allImplementersAdded = true; | ||
| allExtensionsAdded = true; | ||
|
|
||
| // We should have found all special classes by now. | ||
| specialClasses.assertSpecials(); | ||
| } | ||
|
|
||
| /// Generate a list of futures for any docs that actually require precaching. | ||
|
|
@@ -230,8 +203,8 @@ class PackageGraph with CommentReferable, Nameable { | |
| // more than once for them. | ||
| final Map<Element, ModelNode> _modelNodes = {}; | ||
|
|
||
| /// The collection of "special" classes for which we need some special access. | ||
| final specialClasses = SpecialClasses(); | ||
| /// The Object class declared in the Dart SDK's 'dart:core' library. | ||
| late InheritingContainer objectClass; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this broke dartdoc analysis for certain packages (looks like when mixins are used). See #3947 |
||
|
|
||
| /// Populate's [_modelNodes] with elements in [resolvedLibrary]. | ||
| /// | ||
|
|
@@ -706,14 +679,9 @@ class PackageGraph with CommentReferable, Nameable { | |
| ?.linkedName ?? | ||
| 'Object'; | ||
|
|
||
| /// The set of [Class] objects that are similar to 'pragma' in that we should | ||
| /// never count them as documentable annotations. | ||
| late final Set<Class> _invisibleAnnotations = { | ||
| if (specialClasses[SpecialClass.pragma] case var pragma?) pragma, | ||
| }; | ||
|
|
||
| bool isAnnotationVisible(Class class_) => | ||
| !_invisibleAnnotations.contains(class_); | ||
| class_.element.name == 'pragma' && | ||
| class_.element.library.name == 'dart.core'; | ||
|
|
||
| @override | ||
| String toString() { | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.