Skip to content

Identifiers in dartdocs with parens /// [functionName()] do not generate navigation regions #47553

Open
@DanTup

Description

@DanTup

This came up at Dart-Code/Dart-Code#3611 and I was going to look at fixing in the analysis_server, but I think it may require parser changes (@bwilkerson?).

In the Effective Dart docs in the description of identifiers in doc comments it says:

Parentheses are optional, but can make it clearer when you’re referring to a method or constructor.

However given this code:

/**
 * [myFunction]
 * [myFunction()]
 */
myFunction() {}

The second reference does not generate a navigation target, so cannot be used to navigate to the function. I don't know if including parens is common, but since the docs suggest they're useful, it seems like this should work.

@bwilkerson I had a look thinking this might be something handled in the server, but I ended up in /pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart (parseCommentReferencesInText) so perhaps it needs supporting there (I'm less certain of the implications of making changes there, although happy to have a go if it should be straight-forward).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-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