OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/file_system/file_system.dart'; | 8 import 'package:analyzer/file_system/file_system.dart'; |
9 import 'package:analyzer/src/context/context.dart'; | 9 import 'package:analyzer/src/context/context.dart'; |
10 import 'package:analyzer/src/dart/analysis/driver.dart' as driver; | 10 import 'package:analyzer/src/dart/analysis/driver.dart' as driver; |
11 import 'package:analyzer/src/dart/analysis/file_state.dart'; | 11 import 'package:analyzer/src/dart/analysis/file_state.dart'; |
12 import 'package:analyzer/src/generated/engine.dart'; | 12 import 'package:analyzer/src/generated/engine.dart'; |
13 import 'package:analyzer/src/generated/sdk.dart'; | 13 import 'package:analyzer/src/generated/sdk.dart'; |
14 import 'package:analyzer/src/generated/source.dart'; | 14 import 'package:analyzer/src/generated/source.dart'; |
15 import 'package:analyzer/src/summary/idl.dart'; | 15 import 'package:analyzer/src/summary/idl.dart'; |
16 import 'package:analyzer/src/util/absolute_path.dart'; | 16 import 'package:analyzer/src/util/absolute_path.dart'; |
17 import 'package:front_end/incremental_resolved_ast_generator.dart'; | 17 import 'package:front_end/incremental_resolved_ast_generator.dart'; |
18 import 'package:front_end/src/base/file_repository.dart'; | 18 import 'package:front_end/src/base/file_repository.dart'; |
| 19 import 'package:front_end/src/base/performace_logger.dart'; |
19 import 'package:front_end/src/base/processed_options.dart'; | 20 import 'package:front_end/src/base/processed_options.dart'; |
20 import 'package:front_end/src/base/resolve_relative_uri.dart'; | 21 import 'package:front_end/src/base/resolve_relative_uri.dart'; |
21 import 'package:front_end/src/base/source.dart'; | 22 import 'package:front_end/src/base/source.dart'; |
22 import 'package:front_end/src/dependency_grapher_impl.dart'; | 23 import 'package:front_end/src/dependency_grapher_impl.dart'; |
23 import 'package:front_end/src/incremental/byte_store.dart'; | 24 import 'package:front_end/src/incremental/byte_store.dart'; |
24 import 'package:path/src/context.dart'; | 25 import 'package:path/src/context.dart'; |
25 | 26 |
26 dynamic unimplemented() { | 27 dynamic unimplemented() { |
27 // TODO(paulberry): get rid of this. | 28 // TODO(paulberry): get rid of this. |
28 throw new UnimplementedError(); | 29 throw new UnimplementedError(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 libraries[libraryUri] = units; | 102 libraries[libraryUri] = units; |
102 } | 103 } |
103 } | 104 } |
104 _driver.addFile(_fileRepository.pathForUri(_source)); | 105 _driver.addFile(_fileRepository.pathForUri(_source)); |
105 // TODO(paulberry): stop the scheduler | 106 // TODO(paulberry): stop the scheduler |
106 return new DeltaLibraries(libraries); | 107 return new DeltaLibraries(libraries); |
107 } | 108 } |
108 | 109 |
109 Future<Null> init() async { | 110 Future<Null> init() async { |
110 // TODO(paulberry): can we just use null? | 111 // TODO(paulberry): can we just use null? |
111 var performanceLog = new driver.PerformanceLog(new _NullStringSink()); | 112 var performanceLog = new PerformanceLog(new _NullStringSink()); |
112 _scheduler = new driver.AnalysisDriverScheduler(performanceLog); | 113 _scheduler = new driver.AnalysisDriverScheduler(performanceLog); |
113 _resourceProvider = new _ResourceProviderProxy(_fileRepository); | 114 _resourceProvider = new _ResourceProviderProxy(_fileRepository); |
114 // TODO(paulberry): MemoryByteStore leaks memory (it never discards data). | 115 // TODO(paulberry): MemoryByteStore leaks memory (it never discards data). |
115 // Do something better here. | 116 // Do something better here. |
116 var byteStore = new MemoryByteStore(); | 117 var byteStore = new MemoryByteStore(); |
117 // TODO(paulberry): can we just use null? | 118 // TODO(paulberry): can we just use null? |
118 var fileContentOverlay = new FileContentOverlay(); | 119 var fileContentOverlay = new FileContentOverlay(); |
119 var sdkContext = new AnalysisContextImpl(); | 120 var sdkContext = new AnalysisContextImpl(); |
120 var sdkBundle = await _options.getSdkSummary(); | 121 var sdkBundle = await _options.getSdkSummary(); |
121 var dartSdk = new _DartSdkProxy(sdkBundle, sdkContext, _fileRepository); | 122 var dartSdk = new _DartSdkProxy(sdkBundle, sdkContext, _fileRepository); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 class _SourceProxy extends BasicSource { | 294 class _SourceProxy extends BasicSource { |
294 @override | 295 @override |
295 final String fullName; | 296 final String fullName; |
296 | 297 |
297 _SourceProxy(Uri uri, this.fullName) : super(uri); | 298 _SourceProxy(Uri uri, this.fullName) : super(uri); |
298 | 299 |
299 int get modificationStamp => 0; | 300 int get modificationStamp => 0; |
300 | 301 |
301 noSuchMethod(Invocation invocation) => unimplemented(); | 302 noSuchMethod(Invocation invocation) => unimplemented(); |
302 } | 303 } |
OLD | NEW |