Skip to content

Commit 1a7d39b

Browse files
keertipcommit-bot@chromium.org
authored andcommitted
Do not compute hints for third party code
Change-Id: I4d9478fb9ebb92a26a98a9711e6fab1c0c39db59 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191464 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Keerti Parthasarathy <[email protected]>
1 parent c9ba99a commit 1a7d39b

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

pkg/analyzer/lib/src/dart/micro/resolve_file.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ class FileResolver {
617617
});
618618
}
619619

620+
if (isThirdParty) {
621+
options.hint = false;
622+
}
623+
620624
return options;
621625
}
622626

pkg/analyzer/test/src/dart/micro/file_resolution.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ class FileResolutionTest with ResourceProviderMixin, ResolutionTest {
6565

6666
@override
6767
Future<ResolvedUnitResult> resolveFile(String path) async {
68-
return fileResolver.resolve(path: path);
68+
result = fileResolver.resolve(path: path);
69+
return result;
6970
}
7071

7172
@override

pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,15 @@ import 'dart:math';
481481
]);
482482
}
483483

484+
test_hint_in_third_party() async {
485+
var aPath = convertPath('/workspace/third_party/dart/aaa/lib/a.dart');
486+
newFile(aPath, content: r'''
487+
import 'dart:math';
488+
''');
489+
await resolveFile(aPath);
490+
assertNoErrorsInResult();
491+
}
492+
484493
test_linkLibraries_getErrors() {
485494
addTestFile(r'''
486495
var a = b;

0 commit comments

Comments
 (0)