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

Unified Diff: pkg/analysis_server/test/services/completion/optype_test.dart

Issue 1414653002: Disable completion of formal parameter names as *types*. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweaks Created 5 years, 2 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/test/services/completion/completion_test_util.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/completion/optype_test.dart
diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
index a2bf5c82c05c2963ffae9bba8cdd81ae8c679b88..7f203095bff9f14a292c43f8e4b2334b400e9639 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -631,7 +631,7 @@ class OpTypeTest {
test_FunctionDeclaration_inLineComment4() {
// Comment CompilationUnit
addTestSource('''
- // normal comment
+ // normal comment
// normal comment 2^
zoo(z) { } String name;''');
assertOpType();
@@ -952,7 +952,7 @@ class OpTypeTest {
// Comment ClassDeclaration CompilationUnit
addTestSource('''
class C2 {
- // normal comment
+ // normal comment
// normal comment 2^
zoo(z) { } String name; }''');
assertOpType();
@@ -1142,12 +1142,60 @@ class C2 {
assertOpType(returnValue: true, typeNames: true);
}
- test_SimpleFormalParameter() {
+ test_SimpleFormalParameter_closure() {
// SimpleIdentifier SimpleFormalParameter FormalParameterList
addTestSource('mth() { PNGS.sort((String a, Str^) => a.compareTo(b)); }');
assertOpType(typeNames: true);
}
+ test_SimpleFormalParameter_name1() {
+ // SimpleIdentifier SimpleFormalParameter FormalParameterList
+ addTestSource('m(String na^) {}');
+ assertOpType(typeNames: false);
+ }
+
+ test_SimpleFormalParameter_name2() {
+ // SimpleIdentifier SimpleFormalParameter FormalParameterList
+ addTestSource('m(int first, String na^) {}');
+ assertOpType(typeNames: false);
+ }
+
+ test_SimpleFormalParameter_type_optionalPositional() {
+ // SimpleIdentifier DefaultFormalParameter FormalParameterList
+ addTestSource('m([Str^]) {}');
+ assertOpType(typeNames: true);
+ }
+
+ test_SimpleFormalParameter_type_optionalNamed() {
+ // SimpleIdentifier DefaultFormalParameter FormalParameterList
+ addTestSource('m({Str^}) {}');
+ assertOpType(typeNames: true);
+ }
+
+ test_SimpleFormalParameter_type_withName() {
+ // SimpleIdentifier SimpleFormalParameter FormalParameterList
+ addTestSource('m(Str^ name) {}');
+ assertOpType(typeNames: true);
+ }
+
+ test_SimpleFormalParameter_type_withoutName1() {
+ // SimpleIdentifier SimpleFormalParameter FormalParameterList
+ addTestSource('m(Str^) {}');
+ assertOpType(typeNames: true);
+ }
+
+ test_SimpleFormalParameter_type_withoutName2() {
+ // FormalParameterList
+ addTestSource('m(^) {}');
+ assertOpType(typeNames: true);
+ }
+
+ test_SimpleFormalParameter_type_withoutName3() {
+ // SimpleIdentifier SimpleFormalParameter FormalParameterList
+ addTestSource('m(int first, Str^) {}');
+ assertOpType(typeNames: true);
+ }
+
test_SwitchCase_before() {
// SwitchCase SwitchStatement Block
addTestSource('main() {switch(k) {^case 1:}}');
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698