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

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

Issue 2539263002: Fix for constructor search. (Closed)
Patch Set: Created 4 years 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 f39948c4e0f77723607b417c136de495fab5e597..e975148af3652d4b079e81a0580534282f8f71ad 100644
--- a/pkg/analyzer/lib/src/dart/analysis/search.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart
@@ -84,6 +84,9 @@ class Search {
// TODO(scheglov) optimize for private elements
String name = element.displayName;
+ if (element is ConstructorElement) {
+ name = element.enclosingElement.displayName;
+ }
// Prepare the list of files that reference the element name.
List<String> files = await _driver.getFilesReferencingName(name);

Powered by Google App Engine
This is Rietveld 408576698