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

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

Issue 996263003: completion for method return type after comment (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 067c14ecf913948137ca411cbd18df7bbc790381..8eeacac9a8357ffd78a37c71d10d5d68b36bda62 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -562,12 +562,6 @@ class OpTypeTest {
assertOpType(constructors: true);
}
- test_InstanceCreationExpression_trailingStmt() {
- // SimpleIdentifier TypeName ConstructorName InstanceCreationExpression
- addTestSource('class C {foo(){var f; {var x;} new ^ int x = 7;}}');
- assertOpType(constructors: true);
- }
-
test_InstanceCreationExpression_keyword() {
// InstanceCreationExpression ExpressionStatement Block
addTestSource('class C {foo(){var f; {var x;} new^ }}');
@@ -580,6 +574,12 @@ class OpTypeTest {
assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
+ test_InstanceCreationExpression_trailingStmt() {
+ // SimpleIdentifier TypeName ConstructorName InstanceCreationExpression
+ addTestSource('class C {foo(){var f; {var x;} new ^ int x = 7;}}');
+ assertOpType(constructors: true);
+ }
+
test_InterpolationExpression() {
// SimpleIdentifier InterpolationExpression StringInterpolation
addTestSource('main() {String name; print("hello \$^");}');
@@ -652,6 +652,153 @@ class OpTypeTest {
assertOpType(typeNames: true);
}
+ test_MethodDeclaration_inLineComment() {
+ // Comment ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ // normal comment ^
+ zoo(z) { } String name; }''');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inLineComment2() {
+ // Comment ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ // normal ^comment
+ zoo(z) { } String name; }''');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inLineComment3() {
+ // Comment ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ // normal comment ^
+ // normal comment 2
+ zoo(z) { } String name; }''');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inLineComment4() {
+ // Comment ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ // normal comment
+ // normal comment 2^
+ zoo(z) { } String name; }''');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inLineDocComment() {
+ // Comment MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ /// some dartdoc ^
+ zoo(z) { } String name; }''');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inLineDocComment2() {
+ // Comment MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ /// some ^dartdoc
+ zoo(z) { } String name; }''');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inStarComment() {
+ // Comment ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/* ^ */ zoo(z) {} String name;}');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inStarComment2() {
+ // Comment ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/* *^/ zoo(z) {} String name;}');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inStarDocComment() {
+ // Comment MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/** ^ */ zoo(z) { } String name; }');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_inStarDocComment2() {
+ // Comment MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/** *^/ zoo(z) { } String name; }');
+ assertOpType();
+ }
+
+ test_MethodDeclaration_returnType() {
+ // ClassDeclaration CompilationUnit
+ addTestSource('class C2 {^ zoo(z) { } String name; }');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterLineComment() {
+ // MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ // normal comment
+ ^ zoo(z) {} String name;}''');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterLineComment2() {
+ // MethodDeclaration ClassDeclaration CompilationUnit
+ // TOD(danrubel) left align all test source
+ addTestSource('''
+class C2 {
+ // normal comment
+^ zoo(z) {} String name;}''');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterLineDocComment() {
+ // SimpleIdentifier MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('''
+ class C2 {
+ /// some dartdoc
+ ^ zoo(z) { } String name; }''');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterLineDocComment2() {
+ // SimpleIdentifier MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('''
+class C2 {
+ /// some dartdoc
+^ zoo(z) { } String name; }''');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterStarComment() {
+ // ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/* */ ^ zoo(z) { } String name; }');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterStarComment2() {
+ // ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/* */^ zoo(z) { } String name; }');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterStarDocComment() {
+ // MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/** */ ^ zoo(z) { } String name; }');
+ assertOpType(typeNames: true);
+ }
+
+ test_MethodDeclaration_returnType_afterStarDocComment2() {
+ // MethodDeclaration ClassDeclaration CompilationUnit
+ addTestSource('class C2 {/** */^ zoo(z) { } String name; }');
+ assertOpType(typeNames: true);
+ }
+
test_MethodInvocation_no_semicolon() {
// MethodInvocation ExpressionStatement Block
addTestSource('''
« 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