| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.services.completion.util; | 5 library test.services.completion.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol | 9 import 'package:analysis_server/src/protocol.dart' as protocol |
| 10 show Element, ElementKind; | 10 show Element, ElementKind; |
| 11 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; | 11 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; |
| 12 import 'package:analysis_server/src/services/completion/common_usage_computer.da
rt'; | 12 import 'package:analysis_server/src/services/completion/common_usage_computer.da
rt'; |
| 13 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 13 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
| 14 import 'package:analysis_server/src/services/completion/completion_target.dart'; |
| 14 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; | 15 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; |
| 15 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 16 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 16 import 'package:analysis_server/src/services/completion/imported_computer.dart'; | 17 import 'package:analysis_server/src/services/completion/imported_computer.dart'; |
| 17 import 'package:analysis_server/src/services/completion/invocation_computer.dart
'; | 18 import 'package:analysis_server/src/services/completion/invocation_computer.dart
'; |
| 18 import 'package:analysis_server/src/services/index/index.dart'; | 19 import 'package:analysis_server/src/services/index/index.dart'; |
| 19 import 'package:analysis_server/src/services/index/local_memory_index.dart'; | 20 import 'package:analysis_server/src/services/index/local_memory_index.dart'; |
| 20 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; | 21 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; |
| 21 import 'package:analyzer/src/generated/ast.dart'; | 22 import 'package:analyzer/src/generated/ast.dart'; |
| 22 import 'package:analyzer/src/generated/element.dart'; | 23 import 'package:analyzer/src/generated/element.dart'; |
| 23 import 'package:analyzer/src/generated/engine.dart'; | 24 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 List<Source> libSourceList = context.getLibrariesContaining(testSource); | 515 List<Source> libSourceList = context.getLibrariesContaining(testSource); |
| 515 if (libSourceList.length > 0) { | 516 if (libSourceList.length > 0) { |
| 516 LibraryElement library = context.getLibraryElement(libSourceList[0]); | 517 LibraryElement library = context.getLibraryElement(libSourceList[0]); |
| 517 if (library != null) { | 518 if (library != null) { |
| 518 CompilationUnit unit = | 519 CompilationUnit unit = |
| 519 context.getResolvedCompilationUnit(testSource, library); | 520 context.getResolvedCompilationUnit(testSource, library); |
| 520 if (unit != null) { | 521 if (unit != null) { |
| 521 request.unit = unit; | 522 request.unit = unit; |
| 522 request.node = | 523 request.node = |
| 523 new NodeLocator.con1(completionOffset).searchWithin(unit); | 524 new NodeLocator.con1(completionOffset).searchWithin(unit); |
| 525 request.target = |
| 526 new CompletionTarget.forOffset(unit, completionOffset); |
| 524 resolved = true; | 527 resolved = true; |
| 525 if (!fullAnalysis) { | 528 if (!fullAnalysis) { |
| 526 break; | 529 break; |
| 527 } | 530 } |
| 528 } | 531 } |
| 529 } | 532 } |
| 530 } | 533 } |
| 531 | 534 |
| 532 result = context.performAnalysisTask(); | 535 result = context.performAnalysisTask(); |
| 533 } | 536 } |
| (...skipping 3202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3736 assertNotSuggested('bar2'); | 3739 assertNotSuggested('bar2'); |
| 3737 assertNotSuggested('_B'); | 3740 assertNotSuggested('_B'); |
| 3738 assertSuggestLocalClass('Y'); | 3741 assertSuggestLocalClass('Y'); |
| 3739 assertSuggestLocalClass('C'); | 3742 assertSuggestLocalClass('C'); |
| 3740 assertSuggestLocalVariable('f', null); | 3743 assertSuggestLocalVariable('f', null); |
| 3741 assertNotSuggested('x'); | 3744 assertNotSuggested('x'); |
| 3742 assertNotSuggested('e'); | 3745 assertNotSuggested('e'); |
| 3743 }); | 3746 }); |
| 3744 } | 3747 } |
| 3745 } | 3748 } |
| OLD | NEW |