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

Side by Side Diff: pkg/analyzer/test/src/mock_sdk.dart

Issue 1625273003: Don't add sources to DartSdk contexts. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698