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

proposal: dartdoc comment references should more flexible #49069

Open
bartekpacia opened this issue May 20, 2022 · 3 comments
Open

proposal: dartdoc comment references should more flexible #49069

bartekpacia opened this issue May 20, 2022 · 3 comments
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-fasta type-enhancement A request for a change that isn't a bug

Comments

@bartekpacia
Copy link

bartekpacia commented May 20, 2022

Description

I've often felt restricted by comment_references lint when writing doc comments for more complicated code. I sometimes find myself wanting to reference

/// Does important stuff.
///
/// If [data.someProperty1.someProperty2] is null, then blah blah blah.
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment_references
void complexAlgorithm(ImportantData data) {
  // ... 
}

I can't do this, because comment_references docs say:

two identifiers separated by a period where the first identifier is the name of a class that is in scope and the second is the name of a member declared in the class,

This also impacts model classes generated by freezed – we can't reference fields of the generated freezed class at all, because they mix-in the generated code. For a practical example of why this improvement would be very helpful, please see rrousselGit/freezed#624.

@bartekpacia bartekpacia changed the title proposal: comment_references should let referencing any number of identifiers separated by a period proposal: comment_references should more flexible May 20, 2022
@srawlins srawlins transferred this issue from dart-lang/linter May 20, 2022
@srawlins
Copy link
Member

Thanks for the suggestion. The lint rule actually just enforces that you have written comment references which can be interpreted in the IDE, and by dartdoc, to be references that they can point to. I've moved this over to the SDK, so it can be a request to change the parser to parse more content between [] as a reference, and then dartdoc and IDE tooling can also recognize it.

@srawlins srawlins added type-enhancement A request for a change that isn't a bug front-end-fasta area-front-end Use area-front-end for front end / CFE / kernel format related issues. and removed lint proposal status-pending labels May 20, 2022
@bartekpacia
Copy link
Author

@srawlins Yeah, the main purpose of why I raised this is to have the references in doc comments to be "clickable" in IDEs :)

@srawlins
Copy link
Member

Nice, that's excellent.

@srawlins srawlins changed the title proposal: comment_references should more flexible proposal: dartdoc comment references should more flexible May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-fasta type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants