因为我们可以通过/** + Enter
在 Android Studio 中输入 Kotlin / Java 函数来添加标题注释。是否有任何快捷方式或插件可用于生成颤动飞镖的评论?
不幸的是,Dart 没有遵循与 Java/Kotlin 相同的约定。
有一个关于 Effective Dart 的关于文档的指南指出:
Dart 中的约定是将其集成到方法的描述中,并使用方括号突出显示参数。
其中,字是指"...verbose tags and sections to describe what the parameters and returns of a method are"
。文档应该写成散文。
所以这个Java方法文档:
/// Defines a flag with the given name and abbreviation.
///
/// @param name The name of the flag.
/// @param abbr The abbreviation for the flag.
/// @returns The new flag.
/// @throws ArgumentError If there is already an option with
/// the given name or abbreviation.
Flag addFlag(String name, String abbr) => ...
在 Dart 中相当于:
/// Defines a flag.
///
/// Throws an [ArgumentError] if there is already an option named [name] or
/// there is already an option using abbreviation [abbr]. Returns the new flag.
Flag addFlag(String name, String abbr) => ...
要使用 Dart文档注释,请键入///
并按Enter。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句