| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if (_opType == null) { | 197 if (_opType == null) { |
| 198 _opType = new OpType.forCompletion(target, offset); | 198 _opType = new OpType.forCompletion(target, offset); |
| 199 } | 199 } |
| 200 return _opType; | 200 return _opType; |
| 201 } | 201 } |
| 202 | 202 |
| 203 // For internal use only | 203 // For internal use only |
| 204 @override | 204 @override |
| 205 Future<List<Directive>> resolveDirectives() async { | 205 Future<List<Directive>> resolveDirectives() async { |
| 206 CompilationUnit libUnit; | 206 CompilationUnit libUnit; |
| 207 if (librarySource == source) { | 207 if (librarySource != null) { |
| 208 libUnit = target.unit; | |
| 209 } else if (librarySource != null) { | |
| 210 // TODO(danrubel) only resolve the directives | 208 // TODO(danrubel) only resolve the directives |
| 211 const RESOLVE_DIRECTIVES_TAG = 'resolve directives'; | 209 const RESOLVE_DIRECTIVES_TAG = 'resolve directives'; |
| 212 performance.logStartTime(RESOLVE_DIRECTIVES_TAG); | 210 performance.logStartTime(RESOLVE_DIRECTIVES_TAG); |
| 213 libUnit = await new AnalysisFutureHelper<CompilationUnit>( | 211 libUnit = await new AnalysisFutureHelper<CompilationUnit>( |
| 214 context, | 212 context, |
| 215 new LibrarySpecificUnit(librarySource, librarySource), | 213 new LibrarySpecificUnit(librarySource, librarySource), |
| 216 RESOLVED_UNIT3) | 214 RESOLVED_UNIT3) |
| 217 .computeAsync(); | 215 .computeAsync(); |
| 218 performance.logElapseTime(RESOLVE_DIRECTIVES_TAG); | 216 performance.logElapseTime(RESOLVE_DIRECTIVES_TAG); |
| 219 } | 217 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 // Replacement range for import URI | 398 // Replacement range for import URI |
| 401 return new ReplacementRange(start, end - start); | 399 return new ReplacementRange(start, end - start); |
| 402 } | 400 } |
| 403 } | 401 } |
| 404 } | 402 } |
| 405 } | 403 } |
| 406 } | 404 } |
| 407 return new ReplacementRange(requestOffset, 0); | 405 return new ReplacementRange(requestOffset, 0); |
| 408 } | 406 } |
| 409 } | 407 } |
| OLD | NEW |