Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2560323002: Simplify how patch files are specified to analyzer. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index c386bb4deda7aa4e45545d7959dd940a06d15f6f..edd2d55426c83f9db33d3be4efcb58f9b51ad3d8 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -25,6 +25,7 @@ import 'package:analyzer/src/dart/resolver/inheritance_manager.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/dart/sdk/patch.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/error/pending_error.dart';
import 'package:analyzer/src/generated/constant.dart';
@@ -4061,9 +4062,17 @@ class ParseDartTask extends SourceBasedAnalysisTask {
CompilationUnit unit = parser.parseCompilationUnit(tokenStream);
unit.lineInfo = lineInfo;
- if (options.patchPlatform != 0 && _source.uri.scheme == 'dart') {
- new SdkPatcher().patch(context.sourceFactory.dartSdk,
- options.patchPlatform, errorListener, _source, unit);
+ if (options.patchPaths.isNotEmpty && _source.uri.scheme == 'dart') {
+ var resourceProvider =
+ (context.sourceFactory.dartSdk as FolderBasedDartSdk)
scheglov 2016/12/09 22:54:06 Will this work for MockSdk(s)?
Paul Berry 2016/12/09 23:00:30 Probably not, but I think that's ok. We only use
+ .resourceProvider;
+ new SdkPatcher().patch(
+ resourceProvider,
+ context.analysisOptions.strongMode,
+ context.analysisOptions.patchPaths,
+ errorListener,
+ _source,
+ unit);
}
bool hasNonPartOfDirective = false;
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698