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

Initial documentation for doc comment references #6080

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

srawlins
Copy link
Member

@srawlins srawlins commented Sep 9, 2024

Work towards #6076

This does not discuss "doc imports"; I'd like that to be a separate addition.

Staged: https://dart-dev--pr6080-doc-comment-references-37rf6iwi.web.app/tools/doc-comment-references

@srawlins
Copy link
Member Author

srawlins commented Sep 9, 2024

CC @dart-lang/analyzer-team for any comments.

@dart-github-bot
Copy link
Collaborator

dart-github-bot commented Sep 9, 2024

Visit the preview URL for this PR (updated for commit 478d7c7):

https://dart-dev--pr6080-doc-comment-references-cx0x9ulm.web.app

@parlough parlough self-requested a review September 9, 2024 21:49
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
@srawlins
Copy link
Member Author

This is lovely that it is staged at https://dart-dev--pr6080-doc-comment-references-37rf6iwi.web.app/tools/doc-comment-references.

@srawlins
Copy link
Member Author

Ready for review.

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @srawlins! It's super exciting to finally have this officially documented.

These docs look great to me and could land in the current state if you prefer, but I have a few comments, questions, and enhancements for you to consider. The main thing is that big blocks of text can be intimidating and are often skipped over, especially if someone knows something exists and just wants to know the syntax of it.

Feel free to push back on any of my comments or defer them for later (or for me).

I'll try to open a separate PR this week to explore how we can layout this page alongside other doc-comment related pages.

src/content/tools/doc-comment-references.md Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
src/content/tools/doc-comment-references.md Outdated Show resolved Hide resolved
description: Learn about doc comment references and their syntax.
---

Doc comments can contain references to various code elements. A library member
Copy link
Member

@parlough parlough Sep 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describing doc comment references as referring to "elements" makes sense to me and I believe is what we've always said, but is that because of its implementation ties to the analyzer and our familiarity with it? I'm not necessarily saying we shouldn't use the term, but I just want to make sure it's the best term to use.

I can find very few cases in user-facing docs where we use the term "element" like this. Never do we say "code element". In fact, we are careful to use the term as it already has a few meanings (elements in a collection, collection literal elements, HTML elements, etc).

As a side note, comment_references lint docs use "in-scope identifiers".

@bwilkerson for your thoughts, particularly based on writing diagnostic messages.

\cc @eernstg For your insight :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll stick to "identifiers" instead of "code elements" for now. Good call. I think "element" might be more correct in other cases. For example, an identifier is not referred to, a class is, via it's identifier. It is messy though.

src/content/tools/doc-comment-references.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants