Skip to content
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

What can be referenced in a documentation comment reference? #6076

Closed
1 task done
srawlins opened this issue Sep 4, 2024 · 2 comments · Fixed by #6080
Closed
1 task done

What can be referenced in a documentation comment reference? #6076

srawlins opened this issue Sep 4, 2024 · 2 comments · Fixed by #6080
Assignees
Labels
co.request Community ask for documentation d.enhancement Improves docs with specific ask e2-days Can complete in < 5 days of normal, not dedicated, work from.user Issue raised by user p2-medium Necessary but not urgent concern. Resolve when possible. t.diagnostics Relates to diagnostics, analysis, or linting of code

Comments

@srawlins
Copy link
Member

srawlins commented Sep 4, 2024

What information needs to be added?

There are some corners to what can be referenced in a doc comment reference (/// [...]). For example, an instance member can be referenced, qualified by it's enclosing class's name (e.g. [Future.then], even though that is not a static member).

A generic type can be referred to by it's "base" name ([List]) but not with type arguments ([List<int>]). For a comment on a function, the function's parameters are in-scope. An unnamed constructor can be referred to by it's tear-off name ([Completer.new]). Doc imports add a scope. Imported elements can be referenced by their import prefix, if they have one ([async.Future.value]). Etc.

CC @dart-lang/analyzer-team

Where should this new content appear?

As far as I can tell, outside of Effective Dart, there is only one sentence on comment references between square brackets: https://dart.dev/language/comments#documentation-comments. This page is short, so the content could be another section on the page, or a separate page.

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.
@srawlins srawlins added from.user Issue raised by user co.request Community ask for documentation labels Sep 4, 2024
@srawlins
Copy link
Member Author

srawlins commented Sep 5, 2024

This documentation specifically would be timely now as we're adding the "Documentation imports" feature for the analyzer and dartdoc: dart-lang/sdk#56186.

If this team indicates that documentation would be accepted, I can start working on a PR 😁

@parlough
Copy link
Member

parlough commented Sep 5, 2024

Yes this is something that I've long wanted, so it would definitely be accepted :D. There are some other dartdoc related things I'd like to document, so I'll give some thought on the best place for it.

Feel free to place the docs on their own page for now, perhaps under /src/content/tools.

@srawlins srawlins self-assigned this Sep 9, 2024
@parlough parlough added d.enhancement Improves docs with specific ask t.diagnostics Relates to diagnostics, analysis, or linting of code p2-medium Necessary but not urgent concern. Resolve when possible. e2-days Can complete in < 5 days of normal, not dedicated, work labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co.request Community ask for documentation d.enhancement Improves docs with specific ask e2-days Can complete in < 5 days of normal, not dedicated, work from.user Issue raised by user p2-medium Necessary but not urgent concern. Resolve when possible. t.diagnostics Relates to diagnostics, analysis, or linting of code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants