-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Expand analyzer's resolution of Dartdoc comment references #47444
Labels
analyzer-ux
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Comments
srawlins
added
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
analyzer-ux
labels
Oct 12, 2021
jcollins-g
added
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
labels
Oct 13, 2021
copybara-service bot
pushed a commit
that referenced
this issue
Oct 29, 2021
…a CommentReference * Replace `identifier` field with `expression`, which means deprecating `identifier`, redirecting users to `expression`. For now, `expression` always returns an Identifier. In a future breaking release, it will return other CommentReferableExpressions. * SimpleIdentifier, PrefixedIdentifier, PropertyAccess, ConstructorReference, FunctionReference, and TypeLiteral are all CommentReferableExpressions, but support is not implemented yet to parse CommentReferences with those contained expressions. Bug: #47444 Change-Id: I1905afecf3878cd7dca6e275ef0a2ab80500eb4d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216320 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Janice Collins <jcollins@google.com>
copybara-service bot
pushed a commit
that referenced
this issue
Dec 14, 2021
This expands the front_end's and analyzer's support for doc comment references to include `/// [a.b.c]`. Such a reference must be to a getter, setter, method, or constructor of a class or extension which is referenced with an import prefix, such as `[async.Future.value]`. In the existing support for two words, the two words are named "prefix" and "token". In a three-word reference, the _first_ word must be an import prefix, but I've chosen the new names, "leadingPrefix", "prefix", and "token", to minimize the change. If an improved change is desirable, considering the names from scratch, I might choose something like "prefix", "container", and "identifier". But these names will be applied to one-word and two-word references as well, so `[async.Future]`, a reference to the Future class provided by an import prefixed as 'async', would have a 'prefix' of null, a 'container' of 'async', and an identifier of 'Future'. Bug: #47444 Change-Id: I7758ec16872677221c456dd1dd6dc2a4df0f6102 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223661 Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
CC @bwilkerson for any comments. |
CC @eernstg who cited the spec in another recent issue about comment reference resolution. |
Right, that would be #56259 (comment). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
analyzer-ux
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Currently the set of allowed comment references is very very small. Something like:
foo.bar
), for an import prefix and library-level element pair, for a named constructor, and for a static methodWe'll expand the set to include:
foo.bar.baz
)foo<...>
)foo.bar<...>
), including constructor on a prefixed library-level elementfoo<...>
) for top-level functions and static methodsAll identifiers, including type arguments, should be hoverable and jumpable. Dartdoc's comment reference resolution is already separate from analyzer's and supports more expressions; it can be separately updated to match (or use) analyzer's resolution more closely.
This will be accomplished with a new interface,
CommentReferableExpression
, and a new member onCommentReference
, calledexpression
.Steps to get there:
CommentReferableExpression get expression
toCommentReference
; deprecateCommentReference.newKeyword
andCommentReference.identifier
; change implementation ofCommentReference.identifier
to returnexpression as Identifier
.expression
.CommentReference
s; removeCommentReference.newKeyword
andCommentReference.identifier
.The text was updated successfully, but these errors were encountered: