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

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

Issue 1770953002: Implement searchMemberDeclarations() / searchTopLevelDeclarations(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/search/search_engine_internal2.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:analyzer/src/summary/format.dart'; 10 import 'package:analyzer/src/summary/format.dart';
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 String unitLibraryUri = null; 341 String unitLibraryUri = null;
342 String unitUnitUri = null; 342 String unitUnitUri = null;
343 for (int i = 0; i < unitIndex.definedNames.length; i++) { 343 for (int i = 0; i < unitIndex.definedNames.length; i++) {
344 if (unitIndex.definedNameKinds[i] == kind) { 344 if (unitIndex.definedNameKinds[i] == kind) {
345 int nameIndex = unitIndex.definedNames[i]; 345 int nameIndex = unitIndex.definedNames[i];
346 String name = packageRequester.index.strings[nameIndex]; 346 String name = packageRequester.index.strings[nameIndex];
347 if (regExp.matchAsPrefix(name) != null) { 347 if (regExp.matchAsPrefix(name) != null) {
348 unitLibraryUri ??= packageRequester.getUnitLibraryUri(unitIndex.unit); 348 unitLibraryUri ??= packageRequester.getUnitLibraryUri(unitIndex.unit);
349 unitUnitUri ??= packageRequester.getUnitUnitUri(unitIndex.unit); 349 unitUnitUri ??= packageRequester.getUnitUnitUri(unitIndex.unit);
350 locations.add(new Location(unitLibraryUri, unitUnitUri, 350 locations.add(new Location(unitLibraryUri, unitUnitUri,
351 unitIndex.definedNameOffsets[i], 0, false)); 351 unitIndex.definedNameOffsets[i], name.length, false));
352 } 352 }
353 } 353 }
354 } 354 }
355 return locations; 355 return locations;
356 } 356 }
357 357
358 /** 358 /**
359 * Return a list of locations where an element with the given [elementId] has 359 * Return a list of locations where an element with the given [elementId] has
360 * relation of the given [kind]. 360 * relation of the given [kind].
361 */ 361 */
(...skipping 18 matching lines...) Expand all
380 unitLibraryUri, 380 unitLibraryUri,
381 unitUnitUri, 381 unitUnitUri,
382 unitIndex.usedElementOffsets[i], 382 unitIndex.usedElementOffsets[i],
383 unitIndex.usedElementLengths[i], 383 unitIndex.usedElementLengths[i],
384 unitIndex.usedElementIsQualifiedFlags[i])); 384 unitIndex.usedElementIsQualifiedFlags[i]));
385 } 385 }
386 } 386 }
387 return locations; 387 return locations;
388 } 388 }
389 } 389 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/search/search_engine_internal2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698