Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/src/comment_references/model_comment_reference.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import 'package:dartdoc/src/comment_references/parser.dart';
/// A stripped down analyzer AST [CommentReference] containing only that
/// information needed for Dartdoc.
class ModelCommentReference {
final String codeRef;
final String _codeRef;

bool get hasCallableHint =>
parsed.isNotEmpty &&
((parsed.length > 1 && parsed.last.text == 'new') ||
parsed.last is CallableHintEndNode);
_parsed.isNotEmpty &&
((_parsed.length > 1 && _parsed.last.text == 'new') ||
_parsed.last is CallableHintEndNode);

List<String> get referenceBy => parsed
List<String> get referenceBy => _parsed
.whereType<IdentifierNode>()
.map<String>((i) => i.text)
.toList(growable: false);

/// Constructs a [ModelCommentReference] given a raw string.
ModelCommentReference(this.codeRef);
ModelCommentReference(this._codeRef);

late final List<CommentReferenceNode> parsed =
CommentReferenceParser(codeRef).parse();
late final List<CommentReferenceNode> _parsed =
CommentReferenceParser(_codeRef).parse();
}