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

Unified Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 1737563002: Make add/remove type Quick Assists less obtrusive. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/assist_test.dart
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index 859f248baa46ee16edd68594218dac0a4ccdaf93..42513f362aedebce1c78491c0eb4e96d6de95e7b 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -390,6 +390,15 @@ main() {
await assertNoAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION);
}
+ test_addTypeAnnotation_local_BAD_onInitializer() async {
+ resolveTestUnit('''
+main() {
+ var abc = 0;
+}
+''');
+ await assertNoAssistAt('0;', DartAssistKind.ADD_TYPE_ANNOTATION);
+ }
+
test_addTypeAnnotation_local_BAD_unknown() async {
verifyNoTestUnitErrors = false;
resolveTestUnit('''
@@ -623,22 +632,6 @@ main() {
''');
}
- test_addTypeAnnotation_local_OK_onInitializer() async {
- resolveTestUnit('''
-main() {
- var v = 123;
-}
-''');
- await assertHasAssistAt(
- '23',
- DartAssistKind.ADD_TYPE_ANNOTATION,
- '''
-main() {
- int v = 123;
-}
-''');
- }
-
test_addTypeAnnotation_local_OK_onName() async {
resolveTestUnit('''
main() {
@@ -671,22 +664,6 @@ main() {
''');
}
- test_addTypeAnnotation_local_OK_onVariableDeclarationStatement() async {
- resolveTestUnit('''
-main() {
- var v = 123; // marker
-}
-''');
- await assertHasAssistAt(
- ' // marker',
- DartAssistKind.ADD_TYPE_ANNOTATION,
- '''
-main() {
- int v = 123; // marker
-}
-''');
- }
-
test_addTypeAnnotation_OK_privateType_sameLibrary() async {
resolveTestUnit('''
class _A {}
@@ -3283,6 +3260,15 @@ class A {
''');
}
+ test_removeTypeAnnotation_localVariable_BAD_onInitializer() async {
+ resolveTestUnit('''
+main() {
+ final int v = 1;
+}
+''');
+ await assertNoAssistAt('1;', DartAssistKind.REMOVE_TYPE_ANNOTATION);
+ }
+
test_removeTypeAnnotation_localVariable_OK() async {
resolveTestUnit('''
main() {
« 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