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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart

Issue 2682783002: Always add the target library to the store. (Closed)
Patch Set: 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/dart/analysis/library_context.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) 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 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/token.dart'; 6 import 'package:analyzer/dart/ast/token.dart';
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/error/error.dart'; 8 import 'package:analyzer/error/error.dart';
9 import 'package:analyzer/error/listener.dart'; 9 import 'package:analyzer/error/listener.dart';
10 import 'package:analyzer/src/context/context.dart'; 10 import 'package:analyzer/src/context/context.dart';
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 281
282 Parser parser = new Parser(file.source, errorListener); 282 Parser parser = new Parser(file.source, errorListener);
283 parser.parseGenericMethodComments = analysisOptions.strongMode; 283 parser.parseGenericMethodComments = analysisOptions.strongMode;
284 CompilationUnit unit = parser.parseCompilationUnit(token); 284 CompilationUnit unit = parser.parseCompilationUnit(token);
285 unit.lineInfo = lineInfo; 285 unit.lineInfo = lineInfo;
286 return unit; 286 return unit;
287 } 287 }
288 288
289 void _resolveFile(AnalysisContext analysisContext, FileState library, 289 void _resolveFile(AnalysisContext analysisContext, FileState library,
290 FileState file, CompilationUnit unit) { 290 FileState file, CompilationUnit unit) {
291 if (!file.exists) {
292 Source source = file.source;
293 var unitElement = new CompilationUnitElementImpl(source.shortName);
294 var libraryElement = new LibraryElementImpl(analysisContext, null, -1, 0);
295 unitElement.source = source;
296 unitElement.librarySource = source;
297 libraryElement.definingCompilationUnit = unitElement;
298 unit.element = unitElement;
299 return;
300 }
301
302 RecordingErrorListener errorListener = _getErrorListener(file); 291 RecordingErrorListener errorListener = _getErrorListener(file);
303 292
304 String libraryUri = library.uri.toString(); 293 String libraryUri = library.uri.toString();
305 String unitUri = file.uri.toString(); 294 String unitUri = file.uri.toString();
306 CompilationUnitElement unitElement = resynthesizer.getElement( 295 CompilationUnitElement unitElement = resynthesizer.getElement(
307 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); 296 new ElementLocationImpl.con3(<String>[libraryUri, unitUri]));
308 LibraryElement libraryElement = unitElement.library; 297 LibraryElement libraryElement = unitElement.library;
309 298
310 // TODO(scheglov) Hack: set types for top-level variables 299 // TODO(scheglov) Hack: set types for top-level variables
311 // Otherwise TypeResolverVisitor will set declared types, and because we 300 // Otherwise TypeResolverVisitor will set declared types, and because we
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 @override 552 @override
564 String setContents(Source source, String contents) { 553 String setContents(Source source, String contents) {
565 throw new UnimplementedError(); 554 throw new UnimplementedError();
566 } 555 }
567 556
568 FileState _getFileForSource(Source source) { 557 FileState _getFileForSource(Source source) {
569 String path = source.fullName; 558 String path = source.fullName;
570 return fsState.getFileForPath(path); 559 return fsState.getFileForPath(path);
571 } 560 }
572 } 561 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/library_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698