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

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

Issue 1131053002: Don't update offsets for elements of 'part' and 'part of' directives. (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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/incremental_element_builder_test.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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/incremental_element_builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698