首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Dart反射镜反射评论?

Dart反射镜反射评论?
EN

Stack Overflow用户
提问于 2018-03-20 22:03:27
回答 1查看 65关注 0票数 0

在mirrors.dart源代码中,您可以找到以下内容:

代码语言:javascript
复制
/**
 * Class used for encoding comments as metadata annotations.
 */
class Comment {
  /**
   * The comment text as written in the source text.
   */
  final String text;

  /**
   * The comment text without the start, end, and padding text.
   *
   * For example, if [text] is [: /** Comment text. */ :] then the [trimmedText]
   * is [: Comment text. :].
   */
  final String trimmedText;

  /**
   * Is [:true:] if this comment is a documentation comment.
   *
   * That is, that the comment is either enclosed in [: /** ... */ :] or starts
   * with [: /// :].
   */
  final bool isDocComment;

  const Comment(this.text, this.trimmedText, this.isDocComment);
}

但是,该类不在其他地方使用。我们如何才能利用这种功能?我想查阅一下菲尔德的资料。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-27 20:42:01

Doc注释不能通过dart:mirrors获得。

不过,您可以使用package:analyzer来访问它们。

请参阅https://pub.dartlang.org/documentation/analyzer/0.31.1/analyzer.dart.element.element/Element/documentationComment.html

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49394855

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档