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

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

Issue 2986903002: Add assist to convert part-of directives (Closed)
Patch Set: reworked Created 3 years, 4 months 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 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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 body: new Center( 1035 body: new Center(
1036 /*caret*/children: <Widget>[new GestureDetector()], 1036 /*caret*/children: <Widget>[new GestureDetector()],
1037 key: null, 1037 key: null,
1038 ), 1038 ),
1039 // end 1039 // end
1040 ); 1040 );
1041 } 1041 }
1042 '''); 1042 ''');
1043 } 1043 }
1044 1044
1045 test_convertPartOfToUri_file_nonSibling() async {
1046 addSource('/pkg/lib/foo.dart', '''
1047 library foo;
1048 part 'src/bar.dart';
1049 ''');
1050 testFile = provider.convertPath('/pkg/lib/src/bar.dart');
1051 await resolveTestUnit('''
1052 part of foo;
1053 ''');
1054 await assertHasAssistAt('foo', DartAssistKind.CONVERT_PART_OF_TO_URI, '''
1055 part of '../foo.dart';
1056 ''');
1057 }
1058
1059 test_convertPartOfToUri_file_sibling() async {
1060 addSource('/pkg/foo.dart', '''
1061 library foo;
1062 part 'bar.dart';
1063 ''');
1064 testFile = provider.convertPath('/pkg/bar.dart');
1065 await resolveTestUnit('''
1066 part of foo;
1067 ''');
1068 await assertHasAssistAt('foo', DartAssistKind.CONVERT_PART_OF_TO_URI, '''
1069 part of 'foo.dart';
1070 ''');
1071 }
1072
1045 test_convertToBlockBody_BAD_noEnclosingFunction() async { 1073 test_convertToBlockBody_BAD_noEnclosingFunction() async {
1046 await resolveTestUnit(''' 1074 await resolveTestUnit('''
1047 var v = 123; 1075 var v = 123;
1048 '''); 1076 ''');
1049 await assertNoAssistAt('v =', DartAssistKind.CONVERT_INTO_BLOCK_BODY); 1077 await assertNoAssistAt('v =', DartAssistKind.CONVERT_INTO_BLOCK_BODY);
1050 } 1078 }
1051 1079
1052 test_convertToBlockBody_BAD_notExpressionBlock() async { 1080 test_convertToBlockBody_BAD_notExpressionBlock() async {
1053 await resolveTestUnit(''' 1081 await resolveTestUnit('''
1054 fff() { 1082 fff() {
(...skipping 3318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4373 4401
4374 @override 4402 @override
4375 final AstProvider astProvider; 4403 final AstProvider astProvider;
4376 4404
4377 @override 4405 @override
4378 final CompilationUnit unit; 4406 final CompilationUnit unit;
4379 4407
4380 _DartAssistContextForValues(this.source, this.selectionOffset, 4408 _DartAssistContextForValues(this.source, this.selectionOffset,
4381 this.selectionLength, this.analysisDriver, this.astProvider, this.unit); 4409 this.selectionLength, this.analysisDriver, this.astProvider, this.unit);
4382 } 4410 }
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