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

Side by Side Diff: lib/src/driver.dart

Issue 1398573002: Use task model for strong mode (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Update version Created 5 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer_cli.src.driver; 5 library analyzer_cli.src.driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 void _createAnalysisContext(CommandLineOptions options) { 359 void _createAnalysisContext(CommandLineOptions options) {
360 if (_canContextBeReused(options)) { 360 if (_canContextBeReused(options)) {
361 return; 361 return;
362 } 362 }
363 _previousOptions = options; 363 _previousOptions = options;
364 // Determine whether the new task model should be used. Note that strong 364 // Determine whether the new task model should be used. Note that strong
365 // mode currently requires the old task model, so we need to account for 365 // mode currently requires the old task model, so we need to account for
366 // that. 366 // that.
367 // TODO(paulberry): simplify this logic when strong mode supports the new 367 // TODO(paulberry): simplify this logic when strong mode supports the new
368 // task model. 368 // task model.
369 if (options.strongMode || options.disableNewTaskModel) { 369 if (options.disableNewTaskModel) {
370 AnalysisEngine.instance.useTaskModel = false; 370 AnalysisEngine.instance.useTaskModel = false;
371 } else { 371 } else {
372 AnalysisEngine.instance.useTaskModel = true; 372 AnalysisEngine.instance.useTaskModel = true;
373 } 373 }
374 // Choose a package resolution policy and a diet parsing policy based on 374 // Choose a package resolution policy and a diet parsing policy based on
375 // the command-line options. 375 // the command-line options.
376 SourceFactory sourceFactory = _chooseUriResolutionPolicy(options); 376 SourceFactory sourceFactory = _chooseUriResolutionPolicy(options);
377 AnalyzeFunctionBodiesPredicate dietParsingPolicy = 377 AnalyzeFunctionBodiesPredicate dietParsingPolicy =
378 _chooseDietParsingPolicy(options); 378 _chooseDietParsingPolicy(options);
379 // Create a context using these policies. 379 // Create a context using these policies.
(...skipping 23 matching lines...) Expand all
403 // Set context options. 403 // Set context options.
404 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); 404 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl();
405 contextOptions.cacheSize = _maxCacheSize; 405 contextOptions.cacheSize = _maxCacheSize;
406 contextOptions.hint = !options.disableHints; 406 contextOptions.hint = !options.disableHints;
407 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; 407 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks;
408 contextOptions.enableSuperMixins = options.enableSuperMixins; 408 contextOptions.enableSuperMixins = options.enableSuperMixins;
409 contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy; 409 contextOptions.analyzeFunctionBodiesPredicate = dietParsingPolicy;
410 contextOptions.generateImplicitErrors = options.showPackageWarnings; 410 contextOptions.generateImplicitErrors = options.showPackageWarnings;
411 contextOptions.generateSdkErrors = options.showSdkWarnings; 411 contextOptions.generateSdkErrors = options.showSdkWarnings;
412 contextOptions.lint = options.lints; 412 contextOptions.lint = options.lints;
413 contextOptions.strongMode = options.strongMode;
413 context.analysisOptions = contextOptions; 414 context.analysisOptions = contextOptions;
414 _context = context; 415 _context = context;
415 416
416 // Process analysis options file (and notify all interested parties). 417 // Process analysis options file (and notify all interested parties).
417 _processAnalysisOptions(options, context); 418 _processAnalysisOptions(options, context);
418 } 419 }
419 420
420 /// Return discovered packagespec, or `null` if none is found. 421 /// Return discovered packagespec, or `null` if none is found.
421 Packages _discoverPackagespec(Uri root) { 422 Packages _discoverPackagespec(Uri root) {
422 try { 423 try {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 for (var package in packages) { 615 for (var package in packages) {
615 var packageName = path.basename(package.path); 616 var packageName = path.basename(package.path);
616 var realPath = package.resolveSymbolicLinksSync(); 617 var realPath = package.resolveSymbolicLinksSync();
617 result[packageName] = [ 618 result[packageName] = [
618 PhysicalResourceProvider.INSTANCE.getFolder(realPath) 619 PhysicalResourceProvider.INSTANCE.getFolder(realPath)
619 ]; 620 ];
620 } 621 }
621 return result; 622 return result;
622 } 623 }
623 } 624 }
OLDNEW
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698