Open
Description
Currently the set of allowed comment references is very very small. Something like:
- simple identifier (one word)
- prefixed identifier (
foo.bar
), for an import prefix and library-level element pair, for a named constructor, and for a static method
We'll expand the set to include:
- static method or constructor on a prefixed library element (
foo.bar.baz
) - type literal with type arguments (
foo<...>
) - constructor tear-offs with type arguments (
foo.bar<...>
), including constructor on a prefixed library-level element - function tear-offs with type arguments (
foo<...>
) for top-level functions and static methods
All 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 on CommentReference
, called expression
.
Steps to get there:
- Add new node; update Identifier, PropertyAccess, TypeLiteral, ConstructorReference, FunctionReference to implement new node; add
CommentReferableExpression get expression
toCommentReference
; deprecateCommentReference.newKeyword
andCommentReference.identifier
; change implementation ofCommentReference.identifier
to returnexpression as Identifier
. - Publish and update clients to use
expression
. - Update resolution to resolve more comment text to resolve to
CommentReference
s; removeCommentReference.newKeyword
andCommentReference.identifier
.