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

Unified Diff: pkg/analysis_server/lib/src/search/element_references.dart

Issue 402433003: Search only for potential name references to Class members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/search/element_references.dart
diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
index a03666137d1ca80ddd7c9d0df8cb8ed53ef8b3aa..436d05262d4f6862ec3c91d1c017e7f6f735c110 100644
--- a/pkg/analysis_server/lib/src/search/element_references.dart
+++ b/pkg/analysis_server/lib/src/search/element_references.dart
@@ -30,7 +30,7 @@ class ElementReferencesComputer {
// find element references
futureGroup.add(_findElementsReferences(element));
// add potential references
- if (withPotential) {
+ if (withPotential && _isMemberElement(element)) {
String name = element.displayName;
var matchesFuture = searchEngine.searchMemberReferences(name);
var resultsFuture = matchesFuture.then((List<SearchMatch> matches) {
@@ -105,6 +105,10 @@ class ElementReferencesComputer {
return new SearchResult.fromMatch(match);
}
+ static bool _isMemberElement(Element element) {
+ return element.enclosingElement is ClassElement;
+ }
+
static bool _isVariableLikeElement(Element element) {
if (element is LocalVariableElement) {
return true;

Powered by Google App Engine
This is Rietveld 408576698