Skip to content

Expand analyzer's resolution of Dartdoc comment references #47444

Open
@srawlins

Description

@srawlins

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:

  1. Add new node; update Identifier, PropertyAccess, TypeLiteral, ConstructorReference, FunctionReference to implement new node; add CommentReferableExpression get expression to CommentReference; deprecate CommentReference.newKeyword and CommentReference.identifier; change implementation of CommentReference.identifier to return expression as Identifier.
  2. Publish and update clients to use expression.
  3. Update resolution to resolve more comment text to resolve to CommentReferences; remove CommentReference.newKeyword and CommentReference.identifier.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxtype-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions