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

Side by Side Diff: pkg/analyzer/lib/task/dart.dart

Issue 1133513003: Cache flushing implementation for the task model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.task.dart; 5 library analyzer.task.dart;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/error.dart'; 9 import 'package:analyzer/src/generated/error.dart';
10 import 'package:analyzer/src/generated/scanner.dart'; 10 import 'package:analyzer/src/generated/scanner.dart';
11 import 'package:analyzer/src/generated/source.dart'; 11 import 'package:analyzer/src/generated/source.dart';
12 import 'package:analyzer/src/generated/utilities_general.dart'; 12 import 'package:analyzer/src/generated/utilities_general.dart';
13 import 'package:analyzer/src/task/dart.dart';
13 import 'package:analyzer/task/model.dart'; 14 import 'package:analyzer/task/model.dart';
14 15
15 /** 16 /**
16 * The analysis errors associated with a target. 17 * The analysis errors associated with a target.
17 * 18 *
18 * The value combines errors represented by multiple other results. 19 * The value combines errors represented by multiple other results.
19 */ 20 */
20 // TODO(brianwilkerson) If we want to associate errors with targets smaller than 21 // TODO(brianwilkerson) If we want to associate errors with targets smaller than
21 // a file, we will need other contribution points to collect them. In which case 22 // a file, we will need other contribution points to collect them. In which case
22 // we might want to rename this and/or document that it applies to files. 23 // we might want to rename this and/or document that it applies to files.
23 final CompositeResultDescriptor<List<AnalysisError>> DART_ERRORS = 24 final CompositeResultDescriptor<List<AnalysisError>> DART_ERRORS =
24 new CompositeResultDescriptor<List<AnalysisError>>('DART_ERRORS'); 25 new CompositeResultDescriptor<List<AnalysisError>>('DART_ERRORS');
25 26
26 /** 27 /**
27 * The sources of the libraries that are explicitly imported into a library. 28 * The sources of the libraries that are explicitly imported into a library.
28 * 29 *
29 * The list will be empty if there are no explicit imports, but will not be 30 * The list will be empty if there are no explicit imports, but will not be
30 * `null`. 31 * `null`.
31 * 32 *
32 * The result is only available for targets representing a Dart library. 33 * The result is only available for targets representing a Dart library.
33 */ 34 */
34 final ListResultDescriptor<Source> EXPLICITLY_IMPORTED_LIBRARIES = 35 final ListResultDescriptor<Source> EXPLICITLY_IMPORTED_LIBRARIES =
35 new ListResultDescriptor<Source>('EXPLICITLY_IMPORTED_LIBRARIES', Source.EMP TY_ARRAY); 36 new ListResultDescriptor<Source>(
37 'EXPLICITLY_IMPORTED_LIBRARIES', Source.EMPTY_ARRAY);
36 38
37 /** 39 /**
38 * The sources of the libraries that are exported from a library. 40 * The sources of the libraries that are exported from a library.
39 * 41 *
40 * The list will be empty if there are no exported libraries, but will not be 42 * The list will be empty if there are no exported libraries, but will not be
41 * `null`. 43 * `null`.
42 * 44 *
43 * The result is only available for targets representing a Dart library. 45 * The result is only available for targets representing a Dart library.
44 */ 46 */
45 final ListResultDescriptor<Source> EXPORTED_LIBRARIES = 47 final ListResultDescriptor<Source> EXPORTED_LIBRARIES =
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 new ResultDescriptor<LibraryElement>('LIBRARY_ELEMENT', null); 96 new ResultDescriptor<LibraryElement>('LIBRARY_ELEMENT', null);
95 97
96 /** 98 /**
97 * The compilation unit AST produced while parsing a compilation unit. 99 * The compilation unit AST produced while parsing a compilation unit.
98 * 100 *
99 * The AST structure will not have resolution information associated with it. 101 * The AST structure will not have resolution information associated with it.
100 * 102 *
101 * The result is only available for targets representing a Dart compilation unit . 103 * The result is only available for targets representing a Dart compilation unit .
102 */ 104 */
103 final ResultDescriptor<CompilationUnit> PARSED_UNIT = 105 final ResultDescriptor<CompilationUnit> PARSED_UNIT =
104 new ResultDescriptor<CompilationUnit>('PARSED_UNIT', null); 106 new ResultDescriptor<CompilationUnit>('PARSED_UNIT', null,
107 cachingPolicy: AST_CACHING_POLICY);
105 108
106 /** 109 /**
107 * The resolved [CompilationUnit] associated with a unit. 110 * The resolved [CompilationUnit] associated with a unit.
108 * 111 *
109 * The result is only available for targets representing a unit. 112 * The result is only available for targets representing a unit.
110 */ 113 */
111 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT = 114 final ResultDescriptor<CompilationUnit> RESOLVED_UNIT =
112 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT', null); 115 new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT', null,
116 cachingPolicy: AST_CACHING_POLICY);
113 117
114 /** 118 /**
115 * The token stream produced while scanning a compilation unit. 119 * The token stream produced while scanning a compilation unit.
116 * 120 *
117 * The value is the first token in the file, or the special end-of-file marker 121 * The value is the first token in the file, or the special end-of-file marker
118 * at the end of the stream if the file does not contain any tokens. 122 * at the end of the stream if the file does not contain any tokens.
119 * 123 *
120 * The result is only available for targets representing a Dart compilation unit . 124 * The result is only available for targets representing a Dart compilation unit .
121 */ 125 */
122 final ResultDescriptor<Token> TOKEN_STREAM = 126 final ResultDescriptor<Token> TOKEN_STREAM = new ResultDescriptor<Token>(
123 new ResultDescriptor<Token>('TOKEN_STREAM', null); 127 'TOKEN_STREAM', null, cachingPolicy: TOKEN_STREAM_CACHING_POLICY);
124 128
125 /** 129 /**
126 * The sources of the Dart files that a library consists of. 130 * The sources of the Dart files that a library consists of.
127 * 131 *
128 * The list will include the source of the defining unit and [INCLUDED_PARTS]. 132 * The list will include the source of the defining unit and [INCLUDED_PARTS].
129 * So, it is never empty or `null`. 133 * So, it is never empty or `null`.
130 * 134 *
131 * The result is only available for targets representing a Dart library. 135 * The result is only available for targets representing a Dart library.
132 */ 136 */
133 final ListResultDescriptor<Source> UNITS = 137 final ListResultDescriptor<Source> UNITS =
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 @override 173 @override
170 bool operator ==(other) { 174 bool operator ==(other) {
171 return other is LibrarySpecificUnit && 175 return other is LibrarySpecificUnit &&
172 other.library == library && 176 other.library == library &&
173 other.unit == unit; 177 other.unit == unit;
174 } 178 }
175 179
176 @override 180 @override
177 String toString() => '$unit in $library'; 181 String toString() => '$unit in $library';
178 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698