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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart

Issue 1692273003: rework LocalLibraryContributor to resolve referenced units (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/services/completion/dart/completion_manager.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index 5cfdacef0120bf9de9db13431207ad612a3c9b19..f9665c5ba07c1af3fc40f728f18e509f0464fff0 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -267,6 +267,27 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
_updateTargets(resolvedUnit);
}
+ @override
+ Future<List<CompilationUnitElement>> resolveUnits() async {
+ checkAborted();
+ LibraryElement libElem = libraryElement;
+ if (libElem == null) {
+ return null;
+ }
+ List<CompilationUnitElement> resolvedUnits = <CompilationUnitElement>[];
+ for (CompilationUnitElement unresolvedUnit in libElem.units) {
+ CompilationUnit unit = await _computeAsync(
+ this,
+ new LibrarySpecificUnit(libElem.source, unresolvedUnit.source),
+ RESOLVED_UNIT3,
+ performance,
+ 'resolve library unit');
Brian Wilkerson 2016/02/12 20:42:07 Do we want to checkAborted() after returning from
danrubel 2016/02/12 20:54:23 Good catch! Done.
+ CompilationUnitElement resolvedUnit = unit?.element;
+ resolvedUnits.add(resolvedUnit);
Brian Wilkerson 2016/02/12 20:42:07 Do we want to check for null before adding the uni
danrubel 2016/02/12 20:54:23 Good idea. Done.
+ }
+ return resolvedUnits;
+ }
+
/**
* Update the completion [target] and [dotTarget] based on the given [unit].
*/

Powered by Google App Engine
This is Rietveld 408576698