Skip to content

Commit cfbd61e

Browse files
committed
Fix lints and tests.
1 parent f1fe177 commit cfbd61e

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/src/model/canonicalization.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ final class _Canonicalization {
8989
Element2? ancestor = element;
9090
while (ancestor != null) {
9191
if (ancestor is LibraryElement2) {
92-
components.insert(0, ancestor.identifier);
92+
components.insert(0, ancestor.uri.toString());
9393
} else {
9494
components.insert(0, ancestor.name3!);
9595
}

lib/src/model/model_element.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,12 @@ abstract class ModelElement
412412
return false;
413413
}
414414

415-
if (element case LibraryElement2(:var identifier, :var firstFragment)) {
415+
if (element case LibraryElement2(:var uri, :var firstFragment)) {
416+
final url = uri.toString();
416417
// Private Dart SDK libraries are not public.
417-
if (identifier.startsWith('dart:_') ||
418-
identifier.startsWith('dart:nativewrappers/') ||
419-
'dart:nativewrappers' == identifier) {
418+
if (url.startsWith('dart:_') ||
419+
url.startsWith('dart:nativewrappers/') ||
420+
url == 'dart:nativewrappers') {
420421
return false;
421422
}
422423
// Package-private libraries are not public.

test/end2end/dartdoc_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void main() {
110110
expect(
111111
useSomethingInAnotherPackage.modelType.linkedName,
112112
matches(
113-
r'<a class="deprecated" href="https://pub.dev/documentation/meta/[^"]*/meta/Required-class.html">Required</a>'));
113+
r'<a href="https://pub.dev/documentation/meta/[^"]*/meta/Required-class.html">Required</a>\?'));
114114
var link = RegExp('/dart-core/String-class.html">String</a>');
115115
expect(useSomethingInTheSdk.modelType.linkedName, contains(link));
116116
});

0 commit comments

Comments
 (0)