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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; | 8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; |
9 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 9 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
10 import 'package:analysis_server/src/services/correction/assist.dart'; | 10 import 'package:analysis_server/src/services/correction/assist.dart'; |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 import 'my_lib.dart'; | 505 import 'my_lib.dart'; |
506 part 'test.dart'; | 506 part 'test.dart'; |
507 '''; | 507 '''; |
508 testCode = r''' | 508 testCode = r''' |
509 part of my_app; | 509 part of my_app; |
510 main() { | 510 main() { |
511 var v = getFutureInt(); | 511 var v = getFutureInt(); |
512 } | 512 } |
513 '''; | 513 '''; |
514 // add sources | 514 // add sources |
515 Source appSource = addSource('/app.dart', appCode); | 515 addSource('/app.dart', appCode); |
516 testSource = addSource('/test.dart', testCode); | 516 testSource = addSource('/test.dart', testCode); |
517 // resolve | 517 // resolve |
518 await resolveTestUnit(testCode); | 518 await resolveTestUnit(testCode); |
519 // prepare the assist | 519 // prepare the assist |
520 offset = findOffset('v = '); | 520 offset = findOffset('v = '); |
521 assist = await _assertHasAssist(DartAssistKind.ADD_TYPE_ANNOTATION); | 521 assist = await _assertHasAssist(DartAssistKind.ADD_TYPE_ANNOTATION); |
522 change = assist.change; | 522 change = assist.change; |
523 // verify | 523 // verify |
524 { | 524 { |
525 var testFileEdit = change.getFileEdit('/app.dart'); | 525 var testFileEdit = change.getFileEdit('/app.dart'); |
(...skipping 4230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4756 | 4756 |
4757 @override | 4757 @override |
4758 final AstProvider astProvider; | 4758 final AstProvider astProvider; |
4759 | 4759 |
4760 @override | 4760 @override |
4761 final CompilationUnit unit; | 4761 final CompilationUnit unit; |
4762 | 4762 |
4763 _DartAssistContextForValues(this.source, this.selectionOffset, | 4763 _DartAssistContextForValues(this.source, this.selectionOffset, |
4764 this.selectionLength, this.analysisDriver, this.astProvider, this.unit); | 4764 this.selectionLength, this.analysisDriver, this.astProvider, this.unit); |
4765 } | 4765 } |
OLD | NEW |