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

Support @docImports #3798

Open
srawlins opened this issue Jun 26, 2024 · 3 comments
Open

Support @docImports #3798

srawlins opened this issue Jun 26, 2024 · 3 comments
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@srawlins
Copy link
Member

There is much work to do, and this is more of an umbrella ticket.

@srawlins srawlins added type-enhancement A request for a change that isn't a bug P2 A bug or feature request we're likely to work on labels Jun 26, 2024
srawlins added a commit that referenced this issue Jun 26, 2024
This is work towards #3798.

The analyzer is now tagging Comment nodes with references with various static elements, all backed by the new @docImport syntax, via a new DocImportScope (see https://dart-review.googlesource.com/c/sdk/+/345361 and https://dart-review.googlesource.com/c/sdk/+/353232). But they're not available in the element model. So while we have the syntax nodes, in PackageGraph, we must "side-car" the data, by storing it in separate classes (with no references to any AST nodes).

So in this change we introduce the CommentReferenceData class, attach instances to ModelNode.
@matanlurey
Copy link

Maybe worth mentioning here or a separate bug:

Sometimes @docImport shows up in the generated docs, and I need to comment it out:

/// <!--
/// @docImport 'library.dart';
/// -->
library;

@srawlins
Copy link
Member Author

srawlins commented Oct 7, 2024

Ooh that "sometimes" would be good to know.

@matanlurey
Copy link

The next time I have to do it, you'll be the first to know :)

Ooh that "sometimes" would be good to know.

Looks like it happened here:

https://github.com/matanlurey/pxl.dart/blob/c379ef6ed22e14307e5fc3af5d1dc833aa226069/lib/pxl.dart#L11

And here:

https://github.com/matanlurey/pub.lurey.dev/blob/b4836f5588ce2525a7a67d2635f02a41aa81b11e/packages/proc/lib/proc.dart#L71

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-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants