| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 checkAborted(); | 279 checkAborted(); |
| 280 if (_resolvedImports != null) { | 280 if (_resolvedImports != null) { |
| 281 return _resolvedImports; | 281 return _resolvedImports; |
| 282 } | 282 } |
| 283 LibraryElement libElem = libraryElement; | 283 LibraryElement libElem = libraryElement; |
| 284 if (libElem == null) { | 284 if (libElem == null) { |
| 285 return null; | 285 return null; |
| 286 } | 286 } |
| 287 _resolvedImports = <ImportElement>[]; | 287 _resolvedImports = <ImportElement>[]; |
| 288 for (ImportElement importElem in libElem.imports) { | 288 for (ImportElement importElem in libElem.imports) { |
| 289 if (importElem.importedLibrary.exportNamespace == null) { | 289 if (importElem.importedLibrary?.exportNamespace == null) { |
| 290 await _computeAsync(this, importElem.importedLibrary.source, | 290 await _computeAsync(this, importElem.importedLibrary.source, |
| 291 LIBRARY_ELEMENT4, performance, 'resolve imported library'); | 291 LIBRARY_ELEMENT4, performance, 'resolve imported library'); |
| 292 checkAborted(); | 292 checkAborted(); |
| 293 } | 293 } |
| 294 _resolvedImports.add(importElem); | 294 _resolvedImports.add(importElem); |
| 295 } | 295 } |
| 296 return _resolvedImports; | 296 return _resolvedImports; |
| 297 } | 297 } |
| 298 | 298 |
| 299 @override | 299 @override |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 if (start <= requestOffset && requestOffset <= end) { | 493 if (start <= requestOffset && requestOffset <= end) { |
| 494 // Replacement range for import URI | 494 // Replacement range for import URI |
| 495 return new ReplacementRange(start, end - start); | 495 return new ReplacementRange(start, end - start); |
| 496 } | 496 } |
| 497 } | 497 } |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 return new ReplacementRange(requestOffset, 0); | 500 return new ReplacementRange(requestOffset, 0); |
| 501 } | 501 } |
| 502 } | 502 } |
| OLD | NEW |