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

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

Issue 1764553002: Make SearchMatch usable for the new index - remove the element field. (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/refactoring/refactoring_internal.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 search.element_references; 5 library search.element_references;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/collections.dart'; 9 import 'package:analysis_server/src/collections.dart';
10 import 'package:analysis_server/src/protocol_server.dart' 10 import 'package:analysis_server/src/protocol_server.dart'
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Future<Iterable<Element>> _getRefElements(Element element) { 84 Future<Iterable<Element>> _getRefElements(Element element) {
85 if (element is ClassMemberElement) { 85 if (element is ClassMemberElement) {
86 return getHierarchyMembers(searchEngine, element); 86 return getHierarchyMembers(searchEngine, element);
87 } 87 }
88 return new Future.value([element]); 88 return new Future.value([element]);
89 } 89 }
90 90
91 SearchResult _newDeclarationResult(Element refElement) { 91 SearchResult _newDeclarationResult(Element refElement) {
92 int nameOffset = refElement.nameOffset; 92 int nameOffset = refElement.nameOffset;
93 int nameLength = refElement.nameLength; 93 int nameLength = refElement.nameLength;
94 SearchMatch searchMatch = new SearchMatch(MatchKind.DECLARATION, refElement, 94 SearchMatch searchMatch = new SearchMatch(
95 new SourceRange(nameOffset, nameLength), true, false); 95 refElement.context,
96 refElement.library.source.uri.toString(),
97 refElement.source.uri.toString(),
98 MatchKind.DECLARATION,
99 new SourceRange(nameOffset, nameLength),
100 true,
101 false);
96 return newSearchResult_fromMatch(searchMatch); 102 return newSearchResult_fromMatch(searchMatch);
97 } 103 }
98 104
99 static SearchResult toResult(SearchMatch match) { 105 static SearchResult toResult(SearchMatch match) {
100 return newSearchResult_fromMatch(match); 106 return newSearchResult_fromMatch(match);
101 } 107 }
102 108
103 static bool _isDeclarationInteresting(Element element) { 109 static bool _isDeclarationInteresting(Element element) {
104 if (element is LabelElement) { 110 if (element is LabelElement) {
105 return true; 111 return true;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 * Adds a [Future] or an [E] value to results. 148 * Adds a [Future] or an [E] value to results.
143 */ 149 */
144 void add(value) { 150 void add(value) {
145 if (value is Future) { 151 if (value is Future) {
146 _futures.add(value); 152 _futures.add(value);
147 } else { 153 } else {
148 _futures.add(new Future.value(<E>[value])); 154 _futures.add(new Future.value(<E>[value]));
149 } 155 }
150 } 156 }
151 } 157 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/refactoring_internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698