Skip to content

Privatize ModelCommentReference.codeRef and .parsed #3764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2024
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();
}
Loading