Skip to content

Document @docImport in README.md #3935

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Document @docImport in README.md #3935

wants to merge 1 commit into from

Conversation

jonasfj
Copy link
Member

@jonasfj jonasfj commented Nov 25, 2024

Implemented in dart-lang/sdk#56186 (credits @@srawlins).

We should probably document this on dart.dev too. But I figured it would be harmless to add it to dartdoc. This is certainly one of the placed I went to look for it 🤣

@srawlins
Copy link
Member

Thanks for the PR! I'd like to put this off until the implementation is a little bit tidied. There are a few items I hope to finish this quarter before "releasing" the feature:

  • prefixes (@docImport 'foo' as foo;)
  • reporting unused doc-imports
  • reporting imports that could be doc-imports

@FMorschel
Copy link

@srawlins, what about this PR now that we have https://dart.dev/tools/doc-comments/references#doc-imports?

@srawlins
Copy link
Member

Oh wow, blast from the past 😅 yes I'll review this anew.


```dart
/// @docImport 'dart:async';
/// @docImport 'package:flutter/element.dart' show Element;
Copy link
Member

Choose a reason for hiding this comment

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

'show' is not supported. (yet?)

Choose a reason for hiding this comment

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

Exactly. Noting the umbrella issue for it does mention this was a goal dart-lang/sdk#56186.

/// @docImport 'dart:async';
/// @docImport 'package:flutter/element.dart' show Element;
/// @docImport '../path/to/somwhere.dart';
/// @docImport 'dart:html' as 'html';
Copy link
Member

Choose a reason for hiding this comment

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

'as' is not supported. (yet?)

Choose a reason for hiding this comment

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

Exactly. Noting we have an issue for it dart-lang/sdk#56527 and the umbrella issue for it does mention this was a goal dart-lang/sdk#56186.

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.

3 participants