| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.test.src.mock_sdk; | 5 library analyzer.test.src.mock_sdk; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart' as resource; | 7 import 'package:analyzer/file_system/file_system.dart' as resource; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; | 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; |
| 9 import 'package:analyzer/src/context/context.dart'; | 9 import 'package:analyzer/src/context/context.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 provider.newFile(library.path, library.content); | 202 provider.newFile(library.path, library.content); |
| 203 }); | 203 }); |
| 204 } | 204 } |
| 205 | 205 |
| 206 @override | 206 @override |
| 207 AnalysisContext get context { | 207 AnalysisContext get context { |
| 208 if (_analysisContext == null) { | 208 if (_analysisContext == null) { |
| 209 _analysisContext = new SdkAnalysisContext(); | 209 _analysisContext = new SdkAnalysisContext(); |
| 210 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); | 210 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); |
| 211 _analysisContext.sourceFactory = factory; | 211 _analysisContext.sourceFactory = factory; |
| 212 ChangeSet changeSet = new ChangeSet(); | |
| 213 for (String uri in uris) { | |
| 214 Source source = factory.forUri(uri); | |
| 215 changeSet.addedSource(source); | |
| 216 } | |
| 217 _analysisContext.applyChanges(changeSet); | |
| 218 } | 212 } |
| 219 return _analysisContext; | 213 return _analysisContext; |
| 220 } | 214 } |
| 221 | 215 |
| 222 @override | 216 @override |
| 223 List<SdkLibrary> get sdkLibraries => LIBRARIES; | 217 List<SdkLibrary> get sdkLibraries => LIBRARIES; |
| 224 | 218 |
| 225 @override | 219 @override |
| 226 String get sdkVersion => throw unimplemented; | 220 String get sdkVersion => throw unimplemented; |
| 227 | 221 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 bool get isInternal => throw unimplemented; | 318 bool get isInternal => throw unimplemented; |
| 325 | 319 |
| 326 @override | 320 @override |
| 327 bool get isShared => throw unimplemented; | 321 bool get isShared => throw unimplemented; |
| 328 | 322 |
| 329 @override | 323 @override |
| 330 bool get isVmLibrary => throw unimplemented; | 324 bool get isVmLibrary => throw unimplemented; |
| 331 | 325 |
| 332 UnimplementedError get unimplemented => new UnimplementedError(); | 326 UnimplementedError get unimplemented => new UnimplementedError(); |
| 333 } | 327 } |
| OLD | NEW |