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 3976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3987 ), | 3987 ), |
3988 ), | 3988 ), |
3989 ), | 3989 ), |
3990 // end | 3990 // end |
3991 ); | 3991 ); |
3992 } | 3992 } |
3993 } | 3993 } |
3994 '''); | 3994 '''); |
3995 } | 3995 } |
3996 | 3996 |
| 3997 test_reparentFlutterWidget_OK_multiLines_eol2() async { |
| 3998 _configureFlutterPkg({ |
| 3999 'src/widgets/framework.dart': flutter_framework_code, |
| 4000 }); |
| 4001 await resolveTestUnit(''' |
| 4002 import 'package:flutter/src/widgets/framework.dart';\r |
| 4003 class FakeFlutter {\r |
| 4004 main() {\r |
| 4005 return new Container(\r |
| 4006 // start\r |
| 4007 child: new /*caret*/DefaultTextStyle(\r |
| 4008 child: new Row(\r |
| 4009 children: <Widget>[\r |
| 4010 new Container(\r |
| 4011 ),\r |
| 4012 ],\r |
| 4013 ),\r |
| 4014 ),\r |
| 4015 // end\r |
| 4016 );\r |
| 4017 }\r |
| 4018 }\r |
| 4019 '''); |
| 4020 _setCaretLocation(); |
| 4021 await assertHasAssist( |
| 4022 DartAssistKind.REPARENT_FLUTTER_WIDGET, |
| 4023 ''' |
| 4024 import 'package:flutter/src/widgets/framework.dart';\r |
| 4025 class FakeFlutter {\r |
| 4026 main() {\r |
| 4027 return new Container(\r |
| 4028 // start\r |
| 4029 child: new widget(\r |
| 4030 child: new /*caret*/DefaultTextStyle(\r |
| 4031 child: new Row(\r |
| 4032 children: <Widget>[\r |
| 4033 new Container(\r |
| 4034 ),\r |
| 4035 ],\r |
| 4036 ),\r |
| 4037 ),\r |
| 4038 ),\r |
| 4039 // end\r |
| 4040 );\r |
| 4041 }\r |
| 4042 }\r |
| 4043 '''); |
| 4044 } |
| 4045 |
3997 test_reparentFlutterWidget_OK_singleLine1() async { | 4046 test_reparentFlutterWidget_OK_singleLine1() async { |
3998 _configureFlutterPkg({ | 4047 _configureFlutterPkg({ |
3999 'src/widgets/framework.dart': flutter_framework_code, | 4048 'src/widgets/framework.dart': flutter_framework_code, |
4000 }); | 4049 }); |
4001 await resolveTestUnit(''' | 4050 await resolveTestUnit(''' |
4002 import 'package:flutter/src/widgets/framework.dart'; | 4051 import 'package:flutter/src/widgets/framework.dart'; |
4003 class FakeFlutter { | 4052 class FakeFlutter { |
4004 main() { | 4053 main() { |
4005 // start | 4054 // start |
4006 return /*caret*/new Container(); | 4055 return /*caret*/new Container(); |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4732 | 4781 |
4733 @override | 4782 @override |
4734 final AstProvider astProvider; | 4783 final AstProvider astProvider; |
4735 | 4784 |
4736 @override | 4785 @override |
4737 final CompilationUnit unit; | 4786 final CompilationUnit unit; |
4738 | 4787 |
4739 _DartAssistContextForValues(this.source, this.selectionOffset, | 4788 _DartAssistContextForValues(this.source, this.selectionOffset, |
4740 this.selectionLength, this.analysisContext, this.astProvider, this.unit); | 4789 this.selectionLength, this.analysisContext, this.astProvider, this.unit); |
4741 } | 4790 } |
OLD | NEW |