-
Notifications
You must be signed in to change notification settings - Fork 125
Frame for merging scoped lookups #2661
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
Conversation
lib/src/model/comment_referable.dart
Outdated
recurseChildrenAndFilter( | ||
referenceLookup, referenceChildren[referenceLookup.lookup], filter); | ||
|
||
/// Assuming we found a [result], recurse through children, skipping over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems to presuppose some other action. Would it make more sense for this to be private, and refer to [lookupViaScope]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since implementations from other files will probably need to call it (since any of this working will depend on at least Library
overriding lookupViaScope
to deal with PrefixElement
s), making it private will not work. Made that more explicit in the comment.
lib/src/model/comment_referable.dart
Outdated
bool Function(CommentReferable) filter) { | ||
assert(result != null); | ||
if (referenceLookup.remaining.isNotEmpty) { | ||
result = result?.referenceBy(referenceLookup.remaining, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ?.
is not necessary with the above assert, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, fixed
Making the maximum use of the analyzer's code for looking up symbols will require using the analyzer's
Scope
andlookup
code. Since we don't preserve the AST, construct them ourselves on demand and prioritize the analyzer's lookup, when available, with dartdoc's customizations isolated and added on.