-
Notifications
You must be signed in to change notification settings - Fork 118
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
Names of anonymous libraries in 'Flutter' package are not stripped of 'package' prefix #3882
Comments
I just gave this another try in flutter/flutter#159445 with dartdoc 8.3.0 and I am running into the same problem: Generated URL: |
@srawlins Did you remove the library name from
[1] https://github.com/flutter/flutter/pull/159445/files#diff-4175a2d5dc31762727066811624f7d7c4a9127cba08df196fcb184bb4acc2833 |
I did not! 🤣 thanks for the tip 😁 |
Hmm I'm not sure how this should work. I don't think we can strip the package name from the path, because then we could have collisions. For example, the vm_service package has a library called "utils" and it's maybe a miracle that no other package at api.flutter.dev has a top-level library named "utils". I see on the main channel flutter docs, we have package prefixes, like:
And for a named library, we have the un-namespaced URL, just hoping it won't collide I guess, like: It's unfortunate that a path like WDYT, @goderbauer ? I think maybe we just leave libraries named if we want a short URL for them at api.flutter.dev. |
I am ok with leaving them named, but then I think the |
We can add a comment to the |
As @goderbauer found earlier, when removing the name portion of a library directive, e.g.
s/library widgets;/library;
changes the URI of the generated docs for the widgets library.It turns out this should have worked; there is code in
Library.dirName
that picks a "dir name" for an anonymous library. That code should strip the package prefix from libraries in the "default package." When generating docs for the Flutter SDK, the Flutter "package" is considered "default," but it's name is capitalized: "Flutter." Because of this, the stripping behavior does not work.This issue prevents the flutter SDK from adopting the
unnecessary_library_names
lint rule.The text was updated successfully, but these errors were encountered: