dart-lang/dartdoc

Mixing references of local class to the SDK class with the same name.

isoos opened this issue · 2 comments

package:file's documentation has multiple entries that link the (wrong) SDK API URLs, while at the same time they have the same class name in the library.
https://pub.dev/documentation/file/latest/file/file-library.html

One such example is RandomAccessFile:
https://pub.dev/documentation/file/latest/file/RandomAccessFile-class.html

even the page links to the SDK URL: https://api.dart.dev/stable/3.5.3/file/RandomAccessFile-class.html though it is the wrong one, the correct url is https://api.dart.dev/stable/3.5.3/dart-io/RandomAccessFile-class.html

Thanks for catching this one! This is a result of #3838

In the model, we have one instance of the Dart SDK's RandomAccessFile class. It is exported publicly by package:file. Because of the export, we have RandomAccessFile's library as dart:io, and RandomAccessFile's canonicalLibrary as package:file/file.dart, which is maybe bad... Anyway it leads to an incorrect calculation of dirName.

I think it is proper to link to the remote URL (the right one, not a broken one), but also, we are generating docs for RandomAccessFile, which then would not be linked to (and are currently not linked to). So we should stop generating those docs as well...