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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/search.dart

Issue 2529473002: Implement search for other local elements. (Closed)
Patch Set: Created 4 years, 1 month 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/analyzer/lib/src/dart/analysis/search.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/search.dart b/pkg/analyzer/lib/src/dart/analysis/search.dart
index 1dfe7b3600bfc871370795e51bb8a8d6bc4a4cd4..4ae3000734beda13f6818dfb2bda32163e1615f2 100644
--- a/pkg/analyzer/lib/src/dart/analysis/search.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart
@@ -29,8 +29,15 @@ class Search {
}
ElementKind kind = element.kind;
- if (kind == ElementKind.LABEL || kind == ElementKind.LOCAL_VARIABLE) {
+ if (kind == ElementKind.FUNCTION || kind == ElementKind.METHOD) {
+ if (element.enclosingElement is ExecutableElement) {
+ return _searchReferences_Local(element, (n) => n is Block);
+ }
+// return _searchReferences_Function(element);
+ } else if (kind == ElementKind.LABEL || kind == ElementKind.LOCAL_VARIABLE) {
return _searchReferences_Local(element, (n) => n is Block);
+ } else if (kind == ElementKind.TYPE_PARAMETER) {
+ return _searchReferences_Local(element, (n) => n is ClassDeclaration);
}
// TODO(scheglov) support other kinds
return const <SearchResult>[];
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | pkg/analyzer/test/src/dart/analysis/search_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698