Skip to content

Document analyzer-supported documentation imports #6140

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

Closed
parlough opened this issue Oct 10, 2024 · 1 comment · Fixed by #6538
Closed

Document analyzer-supported documentation imports #6140

parlough opened this issue Oct 10, 2024 · 1 comment · Fixed by #6538
Assignees
Labels
d.enhancement Improves docs with specific ask e2-days Can complete in < 5 days of normal, not dedicated, work p.references p2-medium Necessary but not urgent concern. Resolve when possible. t.cli-tools Relates to the dart command line tools t.diagnostics Relates to diagnostics, analysis, or linting of code

Comments

@parlough
Copy link
Member

parlough commented Oct 10, 2024

Topic

https://dart.dev/tools/doc-comments/references

Notes

Add Documentation imports section to Documentation comment references guide.

Feature reference: dart-lang/sdk#56186

Follow up to #6080.

\cc @srawlins CCing you so you can follow this issue. If you do end up wanting to work on these docs, feel free to assign yourself. Thanks for your work on the initial docs and this feature!!

Content from https://github.com/dart-lang/dartdoc/pull/3935/files

Documentation imports (/// @docImport)

Libraries that are only referenced in documentation comments ([Future]) can be imported with a
/// @docImport '<uri>' comment on the library element, like:

/// @docImport 'dart:async';
/// @docImport 'package:flutter/element.dart' show Element;
/// @docImport '../path/to/somwhere.dart';
/// @docImport 'dart:html' as 'html';
library;
/// We can now reference [Future] from dart:async, [Element] from Flutter's element library,
/// and [html.Element] from dart:html, even if none of these libraries are actually imported
/// by this library.
class Foo {}
@parlough parlough added d.enhancement Improves docs with specific ask p2-medium Necessary but not urgent concern. Resolve when possible. t.cli-tools Relates to the dart command line tools e2-days Can complete in < 5 days of normal, not dedicated, work t.diagnostics Relates to diagnostics, analysis, or linting of code labels Oct 10, 2024
@srawlins srawlins self-assigned this Oct 10, 2024
@srawlins
Copy link
Member

Yeah I'd love to write the doc-imports portion as well. Thanks!

@antfitch antfitch changed the title Expand doc comment reference page with doc imports Add Documentation imports Mar 5, 2025
@parlough parlough changed the title Add Documentation imports Document analyzer-supported documentation imports Apr 24, 2025
parlough added a commit that referenced this issue Apr 28, 2025
Add section on documentation imports to the [Documentation comment references](https://dart.dev/tools/doc-comments/references) guide.

Fixes #6140

Live link: https://dart.dev/tools/doc-comments/references/#doc-imports

---------

Co-authored-by: Amanda Fitch <[email protected]>
Co-authored-by: Parker Lougheed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d.enhancement Improves docs with specific ask e2-days Can complete in < 5 days of normal, not dedicated, work p.references p2-medium Necessary but not urgent concern. Resolve when possible. t.cli-tools Relates to the dart command line tools t.diagnostics Relates to diagnostics, analysis, or linting of code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants