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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 640333002: Improve import prefix search results UI. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 7a9b2b320ec9f3f71c069130a9a8fa414e701542..c97e96cd954f8e35c5bff902e033159da1f2553e 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -341,7 +341,14 @@ List<Element> _computePath(engine.Element element) {
List<Element> path = <Element>[];
while (element != null) {
path.add(newElement_fromEngine(element));
- element = element.enclosingElement;
+ // go up
+ if (element is engine.PrefixElement) {
+ // imports are library children, but they are physically in the unit
+ engine.LibraryElement library = element.enclosingElement;
+ element = library.definingCompilationUnit;
+ } else {
+ element = element.enclosingElement;
+ }
}
return path;
}

Powered by Google App Engine
This is Rietveld 408576698