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

Side by Side Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2703253006: Turn off `strong_mode_down_cast_composite` warnings by default in Flutter projects.
Patch Set: Remove newline. Created 3 years, 10 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 | pkg/analyzer/lib/src/context/source.dart » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.src.context.context_builder; 5 library analyzer.src.context.context_builder;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:core'; 8 import 'dart:core';
9 9
10 import 'package:analyzer/context/declared_variables.dart'; 10 import 'package:analyzer/context/declared_variables.dart';
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 if (optionsFile != null) { 381 if (optionsFile != null) {
382 try { 382 try {
383 optionMap = optionsProvider.getOptionsFromFile(optionsFile); 383 optionMap = optionsProvider.getOptionsFromFile(optionsFile);
384 } catch (_) { 384 } catch (_) {
385 // Ignore exceptions thrown while trying to load the options file. 385 // Ignore exceptions thrown while trying to load the options file.
386 } 386 }
387 } else { 387 } else {
388 // Search for the default analysis options 388 // Search for the default analysis options
389 Source source; 389 Source source;
390 // TODO(danrubel) determine if bazel or gn project depends upon flutter 390 // TODO(danrubel) determine if bazel or gn project depends upon flutter
391 if (workspace.hasFlutterDependency) { 391 if (sourceFactory.hasFlutterDependency) {
392 source = 392 source =
393 sourceFactory.forUri('package:flutter/analysis_options_user.yaml'); 393 sourceFactory.forUri('package:flutter/analysis_options_user.yaml');
394 } 394 }
395 if (source == null || !source.exists()) { 395 if (source == null || !source.exists()) {
396 source = 396 source =
397 sourceFactory.forUri('package:dart.analysis_options/default.yaml'); 397 sourceFactory.forUri('package:dart.analysis_options/default.yaml');
398 } 398 }
399 if (source.exists()) { 399 if (source.exists()) {
400 try { 400 try {
401 optionMap = optionsProvider.getOptionsFromSource(source); 401 optionMap = optionsProvider.getOptionsFromSource(source);
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 723
724 final ContextBuilder _builder; 724 final ContextBuilder _builder;
725 725
726 Map<String, List<Folder>> _packageMap; 726 Map<String, List<Folder>> _packageMap;
727 727
728 Packages _packages; 728 Packages _packages;
729 729
730 _BasicWorkspace._(this.provider, this.root, this._builder); 730 _BasicWorkspace._(this.provider, this.root, this._builder);
731 731
732 @override 732 @override
733 // Alternately, we could check the pubspec for "sdk: flutter"
734 bool get hasFlutterDependency => packageMap.containsKey('flutter');
735
736 @override
737 Map<String, List<Folder>> get packageMap { 733 Map<String, List<Folder>> get packageMap {
738 _packageMap ??= _builder.convertPackagesToMap(packages); 734 _packageMap ??= _builder.convertPackagesToMap(packages);
739 return _packageMap; 735 return _packageMap;
740 } 736 }
741 737
742 Packages get packages { 738 Packages get packages {
743 _packages ??= _builder.createPackageMap(root); 739 _packages ??= _builder.createPackageMap(root);
744 return _packages; 740 return _packages;
745 } 741 }
746 742
(...skipping 13 matching lines...) Expand all
760 } 756 }
761 757
762 /** 758 /**
763 * Find the basic workspace that contains the given [path]. 759 * Find the basic workspace that contains the given [path].
764 */ 760 */
765 static _BasicWorkspace find( 761 static _BasicWorkspace find(
766 ResourceProvider resourceProvider, String path, ContextBuilder builder) { 762 ResourceProvider resourceProvider, String path, ContextBuilder builder) {
767 return new _BasicWorkspace._(resourceProvider, path, builder); 763 return new _BasicWorkspace._(resourceProvider, path, builder);
768 } 764 }
769 } 765 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698