Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 1518723002: Issue 25219. Fix for RangeError during converting empty lines in /// comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698