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

Side by Side Diff: pkg/analysis_server/lib/src/services/index/index_contributor.dart

Issue 946023003: Fix for searching constructor references. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/analysis_server/lib/src/services/refactoring/rename_constructor.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 services.src.index.index_contributor; 5 library services.src.index.index_contributor;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import 'package:analysis_server/src/services/correction/namespace.dart'; 9 import 'package:analysis_server/src/services/correction/namespace.dart';
10 import 'package:analysis_server/src/services/index/index.dart'; 10 import 'package:analysis_server/src/services/index/index.dart';
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 if (_libraryElement != null) { 213 if (_libraryElement != null) {
214 return super.visitCompilationUnit(node); 214 return super.visitCompilationUnit(node);
215 } 215 }
216 } 216 }
217 return null; 217 return null;
218 } 218 }
219 219
220 @override 220 @override
221 Object visitConstructorDeclaration(ConstructorDeclaration node) { 221 Object visitConstructorDeclaration(ConstructorDeclaration node) {
222 ConstructorElement element = node.element; 222 ConstructorElement element = node.element;
223 // define
224 {
225 Location location;
226 if (node.name != null) {
227 int start = node.period.offset;
228 int end = node.name.end;
229 location = _createLocationForOffset(start, end - start);
230 } else {
231 int start = node.returnType.end;
232 location = _createLocationForOffset(start, 0);
233 }
234 recordRelationship(element, IndexConstants.NAME_IS_DEFINED_BY, location);
235 }
236 // visit children
237 enterScope(element); 223 enterScope(element);
238 try { 224 try {
239 return super.visitConstructorDeclaration(node); 225 return super.visitConstructorDeclaration(node);
240 } finally { 226 } finally {
241 _exitScope(); 227 _exitScope();
242 } 228 }
243 } 229 }
244 230
245 @override 231 @override
246 Object visitConstructorName(ConstructorName node) { 232 Object visitConstructorName(ConstructorName node) {
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 } 799 }
814 800
815 /** 801 /**
816 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node ". 802 * @return `true` if given "node" is part of [PrefixedIdentifier] "prefix.node ".
817 */ 803 */
818 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) { 804 static bool _isIdentifierInPrefixedIdentifier(SimpleIdentifier node) {
819 AstNode parent = node.parent; 805 AstNode parent = node.parent;
820 return parent is PrefixedIdentifier && parent.identifier == node; 806 return parent is PrefixedIdentifier && parent.identifier == node;
821 } 807 }
822 } 808 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698