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

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

Issue 2183263002: Fix for SearchEngine.searchMemberDeclarations() - search exact names. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/test/services/refactoring/rename_class_member_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) 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 library analysis_server.src.services.search.search_engine_internal; 5 library analysis_server.src.services.search.search_engine_internal;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/correction/source_range.dart'; 9 import 'package:analysis_server/src/services/correction/source_range.dart';
10 import 'package:analysis_server/src/services/index/index.dart'; 10 import 'package:analysis_server/src/services/index/index.dart';
(...skipping 17 matching lines...) Expand all
28 28
29 @override 29 @override
30 Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) async { 30 Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) async {
31 List<SearchMatch> matches = <SearchMatch>[]; 31 List<SearchMatch> matches = <SearchMatch>[];
32 await _addMatches( 32 await _addMatches(
33 matches, type, IndexRelationKind.IS_ANCESTOR_OF, MatchKind.DECLARATION); 33 matches, type, IndexRelationKind.IS_ANCESTOR_OF, MatchKind.DECLARATION);
34 return matches; 34 return matches;
35 } 35 }
36 36
37 @override 37 @override
38 Future<List<SearchMatch>> searchMemberDeclarations(String pattern) { 38 Future<List<SearchMatch>> searchMemberDeclarations(String name) {
39 String pattern = '^$name\$';
39 return _searchDefinedNames(pattern, IndexNameKind.classMember); 40 return _searchDefinedNames(pattern, IndexNameKind.classMember);
40 } 41 }
41 42
42 @override 43 @override
43 Future<List<SearchMatch>> searchMemberReferences(String name) async { 44 Future<List<SearchMatch>> searchMemberReferences(String name) async {
44 List<Location> locations = await _index.getUnresolvedMemberReferences(name); 45 List<Location> locations = await _index.getUnresolvedMemberReferences(name);
45 return locations.map((location) { 46 return locations.map((location) {
46 return _newMatchForLocation(location, null); 47 return _newMatchForLocation(location, null);
47 }).toList(); 48 }).toList();
48 } 49 }
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 _addMatch(node, kind); 406 _addMatch(node, kind);
406 } 407 }
407 } 408 }
408 409
409 void _addMatch(AstNode node, MatchKind kind) { 410 void _addMatch(AstNode node, MatchKind kind) {
410 bool isQualified = node is SimpleIdentifier && node.isQualified; 411 bool isQualified = node is SimpleIdentifier && node.isQualified;
411 matches.add(new SearchMatch(context, libraryUri, unitUri, kind, 412 matches.add(new SearchMatch(context, libraryUri, unitUri, kind,
412 rangeNode(node), true, isQualified)); 413 rangeNode(node), true, isQualified));
413 } 414 }
414 } 415 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698