Skip to content

Write documentation for linking to non-trivial dart entities #1663

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

Open
lrhn opened this issue Apr 11, 2018 · 4 comments
Open

Write documentation for linking to non-trivial dart entities #1663

lrhn opened this issue Apr 11, 2018 · 4 comments
Labels
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

@lrhn
Copy link
Member

lrhn commented Apr 11, 2018

It's not documented anywhere how to link to non-trivial Dart entities.

Simple [prefix.class.member] references, or relative [nameInScope] are easy (which scope is used should be documented, though), but it's not clear how to link to:

  • Unnamed constructors: [C] refers to the class, the constructor has no other name.
  • Operators: [==] or [operator ==]? [unary-]? In another class it's [C.==] or [C.operator==]? [[]] or [operator[]] or ?
  • Setters: [foo=]?

Can you refer to a parameter of a function? [foo.paramName]? (You can refer to it with a relative name in the doc for the function itself, so it's not clear whether you can refer to it from the outside).

Can you refer to a library (if inside it and using its name? If outside it?)

(I've been writing Dart libraries for years, and I can't answer these questions, so please help me) :)

@jcollins-g
Copy link
Contributor

jcollins-g commented Apr 11, 2018

@lhrn I want to write a design doc to define this before implementing #1402 (comment), which is likely to change how all this works pretty dramatically. What we currently do has many exceptions and corner cases where it doesn't work (including #1402, #1285, and more that people just haven't found yet). Still, it's a real bug that this isn't documented.

@jcollins-g jcollins-g added the P2 A bug or feature request we're likely to work on label Apr 11, 2018
@jcollins-g
Copy link
Contributor

I'll add that the fact that case by case I still have to experiment to tell someone what will and won't work is a symptom of the general problem of dartdoc's old, buggy table-based implementation being the specification here.

@jcollins-g
Copy link
Contributor

An incomplete document that we can expand on: https://github.com/dart-lang/dartdoc/wiki/dartdoc-comment-references

@jcollins-g jcollins-g changed the title Please document how to link to Dart entities. Link comment references to import prefixes May 6, 2020
@jcollins-g jcollins-g changed the title Link comment references to import prefixes Write documentation for linking to non-trivial dart entities May 6, 2020
@jcollins-g
Copy link
Contributor

Underlying this is that comment references in dartdoc are an unspecified language defined by dartdoc's implementation; we can do better here and as the implementation becomes more consistent I'll try to make this more of a priority.

@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants