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

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

Issue 1266483003: format with dart_style 0.2.0-rc.3 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 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 | « lib/runtime/messages_widget.dart ('k') | lib/src/codegen/ast_builder.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) 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 dev_compiler.src.analysis_context; 5 library dev_compiler.src.analysis_context;
6 6
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/java_io.dart' show JavaFile; 8 import 'package:analyzer/src/generated/java_io.dart' show JavaFile;
9 import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk; 9 import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
10 import 'package:analyzer/src/generated/source.dart' show DartUriResolver; 10 import 'package:analyzer/src/generated/source.dart' show DartUriResolver;
(...skipping 20 matching lines...) Expand all
31 AnalysisContext createAnalysisContext(StrongModeOptions options) { 31 AnalysisContext createAnalysisContext(StrongModeOptions options) {
32 AnalysisContextImpl res = AnalysisEngine.instance.createAnalysisContext(); 32 AnalysisContextImpl res = AnalysisEngine.instance.createAnalysisContext();
33 enableDevCompilerInference(res, options); 33 enableDevCompilerInference(res, options);
34 return res; 34 return res;
35 } 35 }
36 36
37 /// Enables dev_compiler inference rules. 37 /// Enables dev_compiler inference rules.
38 // TODO(jmesserly): is there a cleaner way to plug this in? 38 // TODO(jmesserly): is there a cleaner way to plug this in?
39 void enableDevCompilerInference( 39 void enableDevCompilerInference(
40 AnalysisContextImpl context, StrongModeOptions options) { 40 AnalysisContextImpl context, StrongModeOptions options) {
41 context.libraryResolverFactory = 41 context.libraryResolverFactory = (c) =>
42 (c) => new LibraryResolverWithInference(c, options); 42 new LibraryResolverWithInference(c, options);
43 } 43 }
44 44
45 /// Creates a SourceFactory configured by the [options]. 45 /// Creates a SourceFactory configured by the [options].
46 /// 46 ///
47 /// Use [options.useMockSdk] to specify the SDK mode, or use [sdkResolver] 47 /// Use [options.useMockSdk] to specify the SDK mode, or use [sdkResolver]
48 /// to entirely override the DartUriResolver. 48 /// to entirely override the DartUriResolver.
49 /// 49 ///
50 /// If supplied, [fileResolvers] will override the default `file:` and 50 /// If supplied, [fileResolvers] will override the default `file:` and
51 /// `package:` URI resolvers. 51 /// `package:` URI resolvers.
52 SourceFactory createSourceFactory(SourceResolverOptions options, 52 SourceFactory createSourceFactory(SourceResolverOptions options,
(...skipping 19 matching lines...) Expand all
72 ? new MultiPackageResolver(options.packagePaths) 72 ? new MultiPackageResolver(options.packagePaths)
73 : new PackageUriResolver([new JavaFile(options.packageRoot)]) 73 : new PackageUriResolver([new JavaFile(options.packageRoot)])
74 ]; 74 ];
75 } 75 }
76 76
77 /// Creates a [DartUriResolver] that uses a mock 'dart:' library contents. 77 /// Creates a [DartUriResolver] that uses a mock 'dart:' library contents.
78 DartUriResolver createMockSdkResolver(Map<String, String> mockSources) => 78 DartUriResolver createMockSdkResolver(Map<String, String> mockSources) =>
79 new MockDartSdk(mockSources, reportMissing: true).resolver; 79 new MockDartSdk(mockSources, reportMissing: true).resolver;
80 80
81 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath]. 81 /// Creates a [DartUriResolver] that uses the SDK at the given [sdkPath].
82 DartUriResolver createSdkPathResolver(String sdkPath) => new DartUriResolver( 82 DartUriResolver createSdkPathResolver(String sdkPath) =>
83 new DirectoryBasedDartSdk( 83 new DartUriResolver(new DirectoryBasedDartSdk(
84 new JavaFile(sdkPath), /*useDart2jsPaths:*/ true)); 84 new JavaFile(sdkPath), /*useDart2jsPaths:*/ true));
OLDNEW
« no previous file with comments | « lib/runtime/messages_widget.dart ('k') | lib/src/codegen/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698