Chromium Code Reviews| 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]. |
| */ |