| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library services.completion.dart.manager; | 5 library services.completion.dart.manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart' | 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart' |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return null; | 147 return null; |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Recompute the target for the newly resolved unit | 150 // Recompute the target for the newly resolved unit |
| 151 _target = new CompletionTarget.forOffset(resolvedUnit, offset); | 151 _target = new CompletionTarget.forOffset(resolvedUnit, offset); |
| 152 _haveResolveDeclarationsInScope = true; | 152 _haveResolveDeclarationsInScope = true; |
| 153 return resolvedUnit; | 153 return resolvedUnit; |
| 154 } | 154 } |
| 155 | 155 |
| 156 @override | 156 @override |
| 157 Future resolveIdentifier(SimpleIdentifier identifier) async { | 157 Future resolveExpression(Expression expression) async { |
| 158 if (identifier.bestElement != null) { | |
| 159 return; | |
| 160 } | |
| 161 | |
| 162 //TODO(danrubel) resolve the expression or containing method | 158 //TODO(danrubel) resolve the expression or containing method |
| 163 // rather than the entire complilation unit | 159 // rather than the entire complilation unit |
| 164 | 160 |
| 165 CompilationUnit unit = target.unit; | 161 CompilationUnit unit = target.unit; |
| 166 | 162 |
| 167 // Determine the library source | 163 // Determine the library source |
| 168 Source librarySource; | 164 Source librarySource; |
| 169 if (unit.directives.any((d) => d is PartOfDirective)) { | 165 if (unit.directives.any((d) => d is PartOfDirective)) { |
| 170 List<Source> libraries = context.getLibrariesContaining(source); | 166 List<Source> libraries = context.getLibrariesContaining(source); |
| 171 if (libraries.isEmpty) { | 167 if (libraries.isEmpty) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 190 // Gracefully degrade if unit cannot be resolved | 186 // Gracefully degrade if unit cannot be resolved |
| 191 if (resolvedUnit == null) { | 187 if (resolvedUnit == null) { |
| 192 return; | 188 return; |
| 193 } | 189 } |
| 194 | 190 |
| 195 // Recompute the target for the newly resolved unit | 191 // Recompute the target for the newly resolved unit |
| 196 _target = new CompletionTarget.forOffset(resolvedUnit, offset); | 192 _target = new CompletionTarget.forOffset(resolvedUnit, offset); |
| 197 _haveResolveDeclarationsInScope = true; | 193 _haveResolveDeclarationsInScope = true; |
| 198 } | 194 } |
| 199 } | 195 } |
| OLD | NEW |