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

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

Issue 396693003: Use AnalysisServer.getResolvedCompilationUnits() helper in hovers. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domain_analysis.dart
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index added84dbfcea227d8124fbbf4fcd64517d1284b..c7ad5c4cbec7874d86e3e182c59512fcca4b2bdd 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -38,17 +38,9 @@ class AnalysisDomainHandler implements RequestHandler {
int offset = request.getRequiredParameter(OFFSET).asInt();
// prepare hovers
List<Hover> hovers = <Hover>[];
- {
- Source source = server.getSource(file);
- AnalysisContext context = server.getAnalysisContext(file);
- if (context != null) {
- List<Source> librarySources = context.getLibrariesContaining(source);
- for (Source librarySource in librarySources) {
- CompilationUnit unit = context.resolveCompilationUnit2(source,
- librarySource);
- hovers.add(new DartUnitHoverComputer(unit, offset).compute());
- }
- }
+ List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
+ for (CompilationUnit unit in units) {
+ hovers.add(new DartUnitHoverComputer(unit, offset).compute());
}
// send response
Response response = new Response(request.id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698