OLD | NEW |
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.src.task.incremental_element_builder; | 5 library analyzer.src.task.incremental_element_builder; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 if (node is TopLevelVariableDeclaration) { | 155 if (node is TopLevelVariableDeclaration) { |
156 VariableDeclarationList variableList = node.variables; | 156 VariableDeclarationList variableList = node.variables; |
157 if (variableList != null) { | 157 if (variableList != null) { |
158 for (VariableDeclaration variable in variableList.variables) { | 158 for (VariableDeclaration variable in variableList.variables) { |
159 TopLevelVariableElement element = variable.element; | 159 TopLevelVariableElement element = variable.element; |
160 elements.add(element); | 160 elements.add(element); |
161 elements.add(element.getter); | 161 elements.add(element.getter); |
162 elements.add(element.setter); | 162 elements.add(element.setter); |
163 } | 163 } |
164 } | 164 } |
| 165 } else if (node is PartDirective || node is PartOfDirective) { |
165 } else if (node is Directive && node.element != null) { | 166 } else if (node is Directive && node.element != null) { |
166 elements.add(node.element); | 167 elements.add(node.element); |
167 } else if (node is Declaration && node.element != null) { | 168 } else if (node is Declaration && node.element != null) { |
168 Element element = node.element; | 169 Element element = node.element; |
169 elements.add(element); | 170 elements.add(element); |
170 if (element is PropertyAccessorElement) { | 171 if (element is PropertyAccessorElement) { |
171 elements.add(element.variable); | 172 elements.add(element.variable); |
172 } | 173 } |
173 } | 174 } |
174 return elements; | 175 return elements; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 283 } |
283 int oldOffset = element.nameOffset; | 284 int oldOffset = element.nameOffset; |
284 int newOffset = map[oldOffset]; | 285 int newOffset = map[oldOffset]; |
285 assert(newOffset != null); | 286 assert(newOffset != null); |
286 (element as ElementImpl).nameOffset = newOffset; | 287 (element as ElementImpl).nameOffset = newOffset; |
287 if (element is! LibraryElement) { | 288 if (element is! LibraryElement) { |
288 super.visitElement(element); | 289 super.visitElement(element); |
289 } | 290 } |
290 } | 291 } |
291 } | 292 } |
OLD | NEW |