Index: pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart |
diff --git a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart |
index c33ec146443b169ac4ef0da50b0988a7786dcc35..b6b1dba6edf0b51f4dd27e37c601b9059b6fc913 100644 |
--- a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart |
+++ b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart |
@@ -20,10 +20,11 @@ import 'package:unittest/unittest.dart'; |
import '../../abstract_context.dart'; |
import '../../operation/operation_queue_test.dart'; |
+import '../../utils.dart'; |
import 'completion_test_util.dart'; |
main() { |
- groupSep = ' | '; |
+ initializeTestEnvironment(); |
defineReflectiveTests(ImportedReferenceContributorTest); |
} |
@@ -45,7 +46,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
*/ |
@override |
assertCachedCompute(_) { |
- if (!(contributor as ImportedReferenceContributor).shouldWaitForLowPrioritySuggestions) { |
+ if (!(contributor as ImportedReferenceContributor) |
+ .shouldWaitForLowPrioritySuggestions) { |
return null; |
} |
List<CompletionSuggestion> oldSuggestions = request.suggestions; |
@@ -125,7 +127,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
@override |
CompletionSuggestion assertSuggestImportedClass(String name, |
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, |
- int relevance: DART_RELEVANCE_DEFAULT, String importUri}) { |
+ int relevance: DART_RELEVANCE_DEFAULT, |
+ String importUri}) { |
return assertSuggestClass(name, |
relevance: relevance, kind: kind, importUri: importUri); |
} |
@@ -148,7 +151,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
CompletionSuggestion assertSuggestImportedFunction( |
String name, String returnType, |
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, |
- bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT, |
+ bool deprecated: false, |
+ int relevance: DART_RELEVANCE_DEFAULT, |
String importUri}) { |
return assertSuggestFunction(name, returnType, |
kind: kind, |
@@ -159,7 +163,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
@override |
CompletionSuggestion assertSuggestImportedFunctionTypeAlias( |
- String name, String returnType, [bool isDeprecated = false, |
+ String name, String returnType, |
+ [bool isDeprecated = false, |
int relevance = DART_RELEVANCE_DEFAULT, |
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION, |
String importUri]) { |
@@ -188,7 +193,8 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
@override |
CompletionSuggestion assertSuggestImportedTopLevelVar( |
- String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT, |
+ String name, String returnType, |
+ [int relevance = DART_RELEVANCE_DEFAULT, |
CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION, |
String importUri]) { |
return assertSuggestTopLevelVar( |
@@ -280,21 +286,29 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
test_Block_partial_results() { |
// Block BlockFunctionBody MethodDeclaration |
- addSource('/testAB.dart', ''' |
+ addSource( |
+ '/testAB.dart', |
+ ''' |
export "dart:math" hide max; |
class A {int x;} |
@deprecated D1() {int x;} |
class _B { }'''); |
- addSource('/testCD.dart', ''' |
+ addSource( |
+ '/testCD.dart', |
+ ''' |
String T1; |
var _T2; |
class C { } |
class D { }'''); |
- addSource('/testEEF.dart', ''' |
+ addSource( |
+ '/testEEF.dart', |
+ ''' |
class EE { } |
class F { }'''); |
addSource('/testG.dart', 'class G { }'); |
- addSource('/testH.dart', ''' |
+ addSource( |
+ '/testH.dart', |
+ ''' |
class H { } |
int T3; |
var _T4;'''); // not imported |
@@ -330,7 +344,9 @@ class ImportedReferenceContributorTest extends AbstractSelectorSuggestionTest { |
} |
test_function_parameters_mixed_required_and_named() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
void m(x, {int y}) {} |
'''); |
addTestSource(''' |
@@ -352,7 +368,9 @@ class B extends A { |
} |
test_function_parameters_mixed_required_and_positional() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
void m(x, [int y]) {} |
'''); |
addTestSource(''' |
@@ -374,7 +392,9 @@ class B extends A { |
} |
test_function_parameters_named() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
void m({x, int y}) {} |
'''); |
addTestSource(''' |
@@ -396,7 +416,9 @@ class B extends A { |
} |
test_function_parameters_none() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
void m() {} |
'''); |
addTestSource(''' |
@@ -416,7 +438,9 @@ class B extends A { |
} |
test_function_parameters_positional() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
void m([x, int y]) {} |
'''); |
addTestSource(''' |
@@ -438,7 +462,9 @@ class B extends A { |
} |
test_function_parameters_required() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
void m(x, int y) {} |
'''); |
addTestSource(''' |
@@ -460,7 +486,9 @@ class B extends A { |
} |
test_InstanceCreationExpression() { |
- addSource('/testA.dart', ''' |
+ addSource( |
+ '/testA.dart', |
+ ''' |
class A {foo(){var f; {var x;}}} |
class B {B(this.x, [String boo]) { } int x;} |
class C {C.bar({boo: 'hoo', int z: 0}) { } }'''); |
@@ -522,7 +550,9 @@ main() {new ^ String x = "hello";}'''); |
} |
test_method_parameters_mixed_required_and_named() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
void m(x, {int y}) {} |
} |
@@ -547,7 +577,9 @@ class B extends A { |
} |
test_method_parameters_mixed_required_and_positional() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
void m(x, [int y]) {} |
} |
@@ -572,7 +604,9 @@ class B extends A { |
} |
test_method_parameters_named() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
void m({x, int y}) {} |
} |
@@ -597,7 +631,9 @@ class B extends A { |
} |
test_method_parameters_none() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
void m() {} |
} |
@@ -620,7 +656,9 @@ class B extends A { |
} |
test_method_parameters_positional() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
void m([x, int y]) {} |
} |
@@ -645,7 +683,9 @@ class B extends A { |
} |
test_method_parameters_required() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
void m(x, int y) {} |
} |
@@ -670,7 +710,9 @@ class B extends A { |
} |
test_mixin_ordering() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class B {} |
class M1 { |
void m() {} |
@@ -696,7 +738,6 @@ class C extends B with M1, M2 { |
* Ensure that completions in one context don't appear in another |
*/ |
test_multiple_contexts() { |
- |
// Create a 2nd context with source |
var context2 = AnalysisEngine.instance.createAnalysisContext(); |
context2.sourceFactory = |
@@ -722,7 +763,9 @@ class C extends B with M1, M2 { |
} |
// Check that source in 2nd context does not appear in completion in 1st |
- addSource('/context1/libA.dart', ''' |
+ addSource( |
+ '/context1/libA.dart', |
+ ''' |
library libA; |
class ClassInLocalContext {int x;}'''); |
testFile = '/context1/completionTest.dart'; |
@@ -740,7 +783,9 @@ class C extends B with M1, M2 { |
} |
test_no_parameters_field() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
int x; |
} |
@@ -758,7 +803,9 @@ class B extends A { |
} |
test_no_parameters_getter() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
int get x => null; |
} |
@@ -776,7 +823,9 @@ class B extends A { |
} |
test_no_parameters_setter() { |
- addSource('/libA.dart', ''' |
+ addSource( |
+ '/libA.dart', |
+ ''' |
class A { |
set x(int value) {}; |
} |