Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 6 additions & 8 deletions lib/src/markdown_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,12 @@ md.Node _makeLinkNode(String codeRef, Warnable warnable) {
// else this would be linkedElement.linkedName, but link bodies are slightly
// different for doc references, so fall out.
} else {
if (result.warn) {
// Avoid claiming documentation is inherited when it comes from the
// current element.
warnable.warn(PackageWarning.unresolvedDocReference,
message: codeRef,
referredFrom:
warnable.documentationIsLocal ? [] : warnable.documentationFrom);
}
// Avoid claiming documentation is inherited when it comes from the
// current element.
warnable.warn(PackageWarning.unresolvedDocReference,
message: codeRef,
referredFrom:
warnable.documentationIsLocal ? [] : warnable.documentationFrom);
}

return md.Element.text('code', textContent);
Expand Down
16 changes: 7 additions & 9 deletions lib/src/matching_link_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@ import 'package:dartdoc/src/model/model.dart';

class MatchingLinkResult {
final CommentReferable? commentReferable;
final bool warn;

MatchingLinkResult(this.commentReferable, {this.warn = true});
MatchingLinkResult(this.commentReferable);

@override
bool operator ==(Object other) {
return other is MatchingLinkResult &&
commentReferable == other.commentReferable &&
warn == other.warn;
}
bool operator ==(Object other) =>
other is MatchingLinkResult && commentReferable == other.commentReferable;

@override
int get hashCode => Object.hash(commentReferable, warn);
int get hashCode => commentReferable.hashCode;

@override
String toString() {
return 'element: [${commentReferable is Constructor ? 'new ' : ''}${commentReferable?.fullyQualifiedName}] warn: $warn';
// TODO(srawlins): Scrap the 'new' keyword?
final newKeyword = commentReferable is Constructor ? 'new ' : '';
return 'element: [$newKeyword${commentReferable?.fullyQualifiedName}]';
}
}
2 changes: 1 addition & 1 deletion test/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ MatchingLinkResult definingLinkResult(MatchingLinkResult originalResult) {

if (definingReferable != null &&
definingReferable != originalResult.commentReferable) {
return MatchingLinkResult(definingReferable, warn: originalResult.warn);
return MatchingLinkResult(definingReferable);
}
return originalResult;
}
Expand Down