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

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

Issue 1910263004: Code completion progress part one of fix to https://github.com/dart-lang/sdk/issues/24254, addition… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: comment from danr, rebase with master Created 4 years, 8 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/completion/dart/optype.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/dart/optype_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/optype_test.dart b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
index 455495cf63baac764120f1a11c3842593a56c53c..971ed026efa04ae4c8b2959f3c0c3e91a1fb2ce3 100644
--- a/pkg/analysis_server/test/services/completion/dart/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/optype_test.dart
@@ -54,6 +54,7 @@ class OpTypeTest {
bool statementLabel: false,
bool staticMethodBody: false,
bool typeNames: false,
+ bool varNames: false,
bool voidReturn: false,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION}) {
expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel');
@@ -66,6 +67,7 @@ class OpTypeTest {
expect(visitor.includeStatementLabelSuggestions, statementLabel,
reason: 'statementLabel');
expect(visitor.includeTypeNameSuggestions, typeNames, reason: 'typeNames');
+ expect(visitor.includeVarNameSuggestions, varNames, reason: 'varNames');
expect(visitor.includeVoidReturnSuggestions, voidReturn,
reason: 'voidReturn');
expect(visitor.inStaticMethodBody, staticMethodBody,
@@ -149,7 +151,7 @@ class OpTypeTest {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// VariableDeclarationStatement Block
addTestSource('class A {} main() {int a; int ^b = 1;}');
- assertOpType();
+ assertOpType(varNames: true);
}
test_AssignmentExpression_RHS() {
@@ -544,7 +546,25 @@ class OpTypeTest {
test_ExpressionStatement_name() {
// ExpressionStatement Block BlockFunctionBody MethodDeclaration
addTestSource('class C {a() {C ^}}');
- assertOpType();
+ assertOpType(varNames: true);
+ }
+
+ test_ExpressionStatement_name_semicolon() {
+ // ExpressionStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('class C {a() {C ^;}}');
+ assertOpType(varNames: true);
+ }
+
+ test_ExpressionStatement_prefixed_name() {
+ // ExpressionStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('class C {a() {x.Y ^}}');
+ assertOpType(varNames: true);
+ }
+
+ test_ExpressionStatement_prefixed_name_semicolon() {
+ // ExpressionStatement Block BlockFunctionBody MethodDeclaration
+ addTestSource('class C {a() {x.Y ^;}}');
+ assertOpType(varNames: true);
}
test_ExtendsClause() {
@@ -557,7 +577,7 @@ class OpTypeTest {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// FieldDeclaration
addTestSource('class C {A ^}');
- assertOpType();
+ assertOpType(varNames: true);
}
test_FieldDeclaration_name_var() {
@@ -1408,7 +1428,7 @@ class C2 {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// TopLevelVariableDeclaration
addTestSource('class A {} B ^');
- assertOpType();
+ assertOpType(varNames: true);
}
test_TopLevelVariableDeclaration_untyped_name() {
@@ -1453,14 +1473,14 @@ class C2 {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// VariableDeclarationStatement Block
addTestSource('main() {List<int> m^}');
- assertOpType();
+ assertOpType(varNames: true);
}
test_VariableDeclaration_name_hasSome_simpleType() {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// VariableDeclarationStatement Block
addTestSource('main() {String m^}');
- assertOpType();
+ assertOpType(varNames: true);
}
test_VariableDeclarationList_final() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/dart/optype.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698