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

Drop support of leading new in comment references. #3531

Closed
srawlins opened this issue Oct 16, 2023 · 0 comments · Fixed by #3529
Closed

Drop support of leading new in comment references. #3531

srawlins opened this issue Oct 16, 2023 · 0 comments · Fixed by #3529
Labels
P2 A bug or feature request we're likely to work on type-tech-debt Issues that slow or block desirable development paths for Dartdoc, or create such problems for users

Comments

@srawlins
Copy link
Member

With the introduction of constructor tear-offs and the Foo.new syntax, we deprecated support for writing /// [new Foo]. The analyzer warns about this deprecated syntax.

There is one purpose which new still serves, which is to disambiguate between an instance member and a constructor sharing the same name. [A.b] is ambiguous, but dartdoc chooses to point this to an instance member, if one exists. For the developer to disambiguate, they can write [new A.b] or [A.b()]. In order to align with the optional-new, new-is-not-idiomatic-any-more situations, dartdoc can drop support for the leading new word, and still offer to disambiguate with the parentheses.

Most importantly, we're aligning on a single resolution of comment references, in the analyzer. The analyzer has dropped support for the leading new , and I plan to add support for a trailing () as per dart-lang/sdk#47553.

@srawlins srawlins added P2 A bug or feature request we're likely to work on type-tech-debt Issues that slow or block desirable development paths for Dartdoc, or create such problems for users labels Oct 16, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 17, 2023
Cleanup for dart-lang/dartdoc#3531

This makes these comment references more idiomatic, I think
more readable, and supports dropping the leading `new ` syntax
in doc comments.

Change-Id: Id832ad14d9ea08fe03fe3125065755f49b1b93ed
CoreLibraryReviewExempt: doc comment only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330683
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
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-tech-debt Issues that slow or block desirable development paths for Dartdoc, or create such problems for users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant