| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 LibraryElement libElem = libraryElement; | 293 LibraryElement libElem = libraryElement; |
| 294 if (libElem == null) { | 294 if (libElem == null) { |
| 295 return null; | 295 return null; |
| 296 } | 296 } |
| 297 _resolvedUnits = <CompilationUnitElement>[]; | 297 _resolvedUnits = <CompilationUnitElement>[]; |
| 298 for (CompilationUnitElement unresolvedUnit in libElem.units) { | 298 for (CompilationUnitElement unresolvedUnit in libElem.units) { |
| 299 CompilationUnit unit = await _computeAsync( | 299 CompilationUnit unit = await _computeAsync( |
| 300 this, | 300 this, |
| 301 new LibrarySpecificUnit(libElem.source, unresolvedUnit.source), | 301 new LibrarySpecificUnit(libElem.source, unresolvedUnit.source), |
| 302 RESOLVED_UNIT3, | 302 RESOLVED_UNIT4, |
| 303 performance, | 303 performance, |
| 304 'resolve library unit'); | 304 'resolve library unit'); |
| 305 checkAborted(); | 305 checkAborted(); |
| 306 CompilationUnitElement resolvedUnit = unit?.element; | 306 CompilationUnitElement resolvedUnit = unit?.element; |
| 307 if (resolvedUnit != null) { | 307 if (resolvedUnit != null) { |
| 308 _resolvedUnits.add(resolvedUnit); | 308 _resolvedUnits.add(resolvedUnit); |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 return _resolvedUnits; | 311 return _resolvedUnits; |
| 312 } | 312 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 } else { | 370 } else { |
| 371 libSource = source; | 371 libSource = source; |
| 372 } | 372 } |
| 373 | 373 |
| 374 // Most (all?) contributors need declarations in scope to be resolved | 374 // Most (all?) contributors need declarations in scope to be resolved |
| 375 if (libSource != null) { | 375 if (libSource != null) { |
| 376 unit = await _computeAsync( | 376 unit = await _computeAsync( |
| 377 request, | 377 request, |
| 378 new LibrarySpecificUnit(libSource, source), | 378 new LibrarySpecificUnit(libSource, source), |
| 379 resultDescriptor ?? RESOLVED_UNIT3, | 379 resultDescriptor ?? RESOLVED_UNIT4, |
| 380 performance, | 380 performance, |
| 381 'resolve declarations'); | 381 'resolve declarations'); |
| 382 } | 382 } |
| 383 | 383 |
| 384 DartCompletionRequestImpl dartRequest = new DartCompletionRequestImpl._( | 384 DartCompletionRequestImpl dartRequest = new DartCompletionRequestImpl._( |
| 385 request.context, | 385 request.context, |
| 386 request.resourceProvider, | 386 request.resourceProvider, |
| 387 request.searchEngine, | 387 request.searchEngine, |
| 388 libSource, | 388 libSource, |
| 389 request.source, | 389 request.source, |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 // Replacement range for import URI | 484 // Replacement range for import URI |
| 485 return new ReplacementRange(start, end - start); | 485 return new ReplacementRange(start, end - start); |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 return new ReplacementRange(requestOffset, 0); | 491 return new ReplacementRange(requestOffset, 0); |
| 492 } | 492 } |
| 493 } | 493 } |
| OLD | NEW |