dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.08k stars 1.56k forks source link

`@docImport`s should support `as` imports #56527

Open goderbauer opened 3 weeks ago

goderbauer commented 3 weeks ago

Something like this should work:

/// @docImport 'dart:io' as io;
library;

/// You can use [io.Stdin] to...
void foo() {
  // intentionally left blank
}
dart-github-bot commented 3 weeks ago

Summary: The @docImport annotation currently doesn't support the as keyword for aliasing imported libraries, making it difficult to reference imported symbols in documentation comments. This issue proposes adding support for as imports within @docImport annotations.