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

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

Issue 1082913007: Move LibraryUnitTarget into API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 5 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/pubspec.yaml » ('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) 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/task/model.dart'; 13 import 'package:analyzer/task/model.dart';
13 14
14 /** 15 /**
15 * The analysis errors associated with a target. 16 * The analysis errors associated with a target.
16 * 17 *
17 * The value combines errors represented by multiple other results. 18 * The value combines errors represented by multiple other results.
18 */ 19 */
19 // TODO(brianwilkerson) If we want to associate errors with targets smaller than 20 // TODO(brianwilkerson) If we want to associate errors with targets smaller than
20 // a file, we will need other contribution points to collect them. In which case 21 // a file, we will need other contribution points to collect them. In which case
21 // we might want to rename this and/or document that it applies to files. 22 // we might want to rename this and/or document that it applies to files.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 /** 114 /**
114 * The sources of the Dart files that a library consists of. 115 * The sources of the Dart files that a library consists of.
115 * 116 *
116 * The list will include the source of the defining unit and [INCLUDED_PARTS]. 117 * The list will include the source of the defining unit and [INCLUDED_PARTS].
117 * So, it is never empty or `null`. 118 * So, it is never empty or `null`.
118 * 119 *
119 * The result is only available for targets representing a Dart library. 120 * The result is only available for targets representing a Dart library.
120 */ 121 */
121 final ListResultDescriptor<Source> UNITS = 122 final ListResultDescriptor<Source> UNITS =
122 new ListResultDescriptor<Source>('UNITS', Source.EMPTY_ARRAY); 123 new ListResultDescriptor<Source>('UNITS', Source.EMPTY_ARRAY);
124
125 /**
126 * A specific compilation unit in a specific library.
127 *
128 * This kind of target is associated with information about a compilation unit
129 * that differs based on the library that the unit is a part of. For example,
130 * the result of resolving a compilation unit depends on the imports, which can
131 * change if a single part is included in more than one library.
132 */
133 class LibrarySpecificUnit implements AnalysisTarget {
134 /**
135 * The defining compilation unit of the library in which the [unit]
136 * is analyzed.
137 */
138 final Source library;
139
140 /**
141 * The compilation unit which belongs to the [library].
142 */
143 final Source unit;
144
145 /**
146 * Initialize a newly created target for the [unit] in the [library].
147 */
148 LibrarySpecificUnit(this.library, this.unit);
149
150 @override
151 int get hashCode {
152 return JenkinsSmiHash.combine(library.hashCode, unit.hashCode);
153 }
154
155 @override
156 Source get source => unit;
157
158 @override
159 bool operator ==(other) {
160 return other is LibrarySpecificUnit &&
161 other.library == library &&
162 other.unit == unit;
163 }
164 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698