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.correction.assist; | 5 library test.services.correction.assist; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
10 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 10 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 | 868 |
869 test_convertDocumentationIntoBlock_BAD_notDocumentation() async { | 869 test_convertDocumentationIntoBlock_BAD_notDocumentation() async { |
870 resolveTestUnit(''' | 870 resolveTestUnit(''' |
871 // AAAA | 871 // AAAA |
872 class A {} | 872 class A {} |
873 '''); | 873 '''); |
874 await assertNoAssistAt( | 874 await assertNoAssistAt( |
875 'AAA', DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK); | 875 'AAA', DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK); |
876 } | 876 } |
877 | 877 |
| 878 test_convertDocumentationIntoBlock_OK_noSpaceBeforeText() async { |
| 879 resolveTestUnit(''' |
| 880 class A { |
| 881 /// AAAAA |
| 882 ///BBBBB |
| 883 /// |
| 884 /// CCCCC |
| 885 mmm() {} |
| 886 } |
| 887 '''); |
| 888 await assertHasAssistAt( |
| 889 'AAAAA', |
| 890 DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, |
| 891 ''' |
| 892 class A { |
| 893 /** |
| 894 * AAAAA |
| 895 *BBBBB |
| 896 * |
| 897 * CCCCC |
| 898 */ |
| 899 mmm() {} |
| 900 } |
| 901 '''); |
| 902 } |
| 903 |
878 test_convertDocumentationIntoBlock_OK_onReference() async { | 904 test_convertDocumentationIntoBlock_OK_onReference() async { |
879 resolveTestUnit(''' | 905 resolveTestUnit(''' |
880 /// AAAAAAA [int] AAAAAAA | 906 /// AAAAAAA [int] AAAAAAA |
881 class A {} | 907 class A {} |
882 '''); | 908 '''); |
883 await assertHasAssistAt( | 909 await assertHasAssistAt( |
884 'nt]', | 910 'nt]', |
885 DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, | 911 DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, |
886 ''' | 912 ''' |
887 /** | 913 /** |
(...skipping 3032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3920 positions.add(new Position(testFile, offset)); | 3946 positions.add(new Position(testFile, offset)); |
3921 } | 3947 } |
3922 return positions; | 3948 return positions; |
3923 } | 3949 } |
3924 | 3950 |
3925 void _setStartEndSelection() { | 3951 void _setStartEndSelection() { |
3926 offset = findOffset('// start\n') + '// start\n'.length; | 3952 offset = findOffset('// start\n') + '// start\n'.length; |
3927 length = findOffset('// end') - offset; | 3953 length = findOffset('// end') - offset; |
3928 } | 3954 } |
3929 } | 3955 } |
OLD | NEW |