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

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

Issue 2829253002: Add support for external summaries bundle in AnalysisDriver. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 8 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
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/context/declared_variables.dart'; 5 import 'package:analyzer/context/declared_variables.dart';
6 import 'package:analyzer/dart/ast/ast.dart'; 6 import 'package:analyzer/dart/ast/ast.dart';
7 import 'package:analyzer/dart/ast/visitor.dart'; 7 import 'package:analyzer/dart/ast/visitor.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/error/error.dart'; 9 import 'package:analyzer/error/error.dart';
10 import 'package:analyzer/error/listener.dart'; 10 import 'package:analyzer/error/listener.dart';
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 throw new UnimplementedError(); 751 throw new UnimplementedError();
752 } 752 }
753 753
754 @override 754 @override
755 String getContents(Source source) { 755 String getContents(Source source) {
756 return _getFileForSource(source).content; 756 return _getFileForSource(source).content;
757 } 757 }
758 758
759 @override 759 @override
760 bool getExists(Source source) { 760 bool getExists(Source source) {
761 if (fsState.externalSummaries != null) {
762 String uriStr = source.uri.toString();
763 if (fsState.externalSummaries.hasUnlinkedUnit(uriStr)) {
764 return true;
765 }
766 }
761 return _getFileForSource(source).exists; 767 return _getFileForSource(source).exists;
762 } 768 }
763 769
764 @override 770 @override
765 int getModificationStamp(Source source) { 771 int getModificationStamp(Source source) {
766 return _getFileForSource(source).exists ? 0 : -1; 772 return _getFileForSource(source).exists ? 0 : -1;
767 } 773 }
768 774
769 @override 775 @override
770 String setContents(Source source, String contents) { 776 String setContents(Source source, String contents) {
771 throw new UnimplementedError(); 777 throw new UnimplementedError();
772 } 778 }
773 779
774 FileState _getFileForSource(Source source) { 780 FileState _getFileForSource(Source source) {
775 String path = source.fullName; 781 String path = source.fullName;
776 return fsState.getFileForPath(path); 782 return fsState.getFileForPath(path);
777 } 783 }
778 } 784 }
779 785
780 /** 786 /**
781 * Either the name or the source associated with a part-of directive. 787 * Either the name or the source associated with a part-of directive.
782 */ 788 */
783 class _NameOrSource { 789 class _NameOrSource {
784 final String name; 790 final String name;
785 final Source source; 791 final Source source;
786 _NameOrSource(this.name, this.source); 792 _NameOrSource(this.name, this.source);
787 } 793 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/file_tracker.dart ('k') | pkg/analyzer/lib/src/dart/analysis/library_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698