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

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

Issue 1319753002: exclude instance suggestions in static context - fixes #22932 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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 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 d3ff65dd97abadfe4a41c833c67b0ea8f9f7a175..efd355e5af3d5e1d390e099a12ec5ef5f2d5b156 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -43,19 +43,27 @@ class OpTypeTest {
visitor = new OpType.forCompletion(completionTarget, offset);
}
- void assertOpType({bool prefixed: false, bool returnValue: false,
- bool typeNames: false, bool voidReturn: false, bool statementLabel: false,
- bool caseLabel: false, bool constructors: false}) {
+ void assertOpType(
+ {bool caseLabel: false,
+ bool constructors: false,
+ bool prefixed: false,
+ bool returnValue: false,
+ bool statementLabel: false,
+ bool staticMethodBody: false,
+ bool typeNames: false,
+ bool voidReturn: false}) {
+ expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel');
+ expect(visitor.includeConstructorSuggestions, constructors,
+ reason: 'constructors');
expect(visitor.includeReturnValueSuggestions, returnValue,
reason: 'returnValue');
+ expect(visitor.includeStatementLabelSuggestions, statementLabel,
+ reason: 'statementLabel');
expect(visitor.includeTypeNameSuggestions, typeNames, reason: 'typeNames');
expect(visitor.includeVoidReturnSuggestions, voidReturn,
reason: 'voidReturn');
- expect(visitor.includeStatementLabelSuggestions, statementLabel,
- reason: 'statementLabel');
- expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel');
- expect(visitor.includeConstructorSuggestions, constructors,
- reason: 'constructors');
+ expect(visitor.inStaticMethodBody, staticMethodBody,
+ reason: 'staticMethodBody');
expect(visitor.isPrefixed, prefixed, reason: 'prefixed');
}
@@ -244,6 +252,15 @@ class OpTypeTest {
prefixed: true, returnValue: true, typeNames: true, voidReturn: true);
}
+ test_Block_static() {
+ addTestSource('class A {static foo() {^}}');
+ assertOpType(
+ returnValue: true,
+ typeNames: true,
+ staticMethodBody: true,
+ voidReturn: true);
+ }
+
test_Break_after_label() {
addTestSource('main() { foo: while (true) { break foo ^ ; } }');
assertOpType(/* No valid completions */);
« 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