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

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

Issue 2722253002: Calculate default args for local reference completions. (Closed)
Patch Set: Cleanup; added test. Created 3 years, 10 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
Index: pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
index 2a0bd251d315194173aab845aa0c2efed283284c..541ec8712463affea1f4931aa9b429f4b1d62d61 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart
@@ -114,7 +114,8 @@ abstract class DartCompletionContributorTest extends AbstractContextTest {
String elemFile,
int elemOffset,
String paramName,
- String paramType}) {
+ String paramType,
+ String defaultArgListString}) {
CompletionSuggestion cs =
getSuggest(completion: completion, csKind: csKind, elemKind: elemKind);
if (cs == null) {
@@ -151,6 +152,9 @@ abstract class DartCompletionContributorTest extends AbstractContextTest {
if (paramType != null) {
expect(cs.parameterType, paramType);
}
+ if (defaultArgListString != null) {
+ expect(cs.defaultArgumentListString, defaultArgListString);
+ }
return cs;
}
@@ -255,12 +259,14 @@ abstract class DartCompletionContributorTest extends AbstractContextTest {
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
bool isDeprecated: false,
int relevance: DART_RELEVANCE_DEFAULT,
- String importUri}) {
+ String importUri,
+ String defaultArgListString}) {
CompletionSuggestion cs = assertSuggest(name,
csKind: kind,
relevance: relevance,
importUri: importUri,
- isDeprecated: isDeprecated);
+ isDeprecated: isDeprecated,
+ defaultArgListString: defaultArgListString);
if (returnType != null) {
expect(cs.returnType, returnType);
} else if (isNullExpectedReturnTypeConsideredDynamic) {
@@ -347,12 +353,14 @@ abstract class DartCompletionContributorTest extends AbstractContextTest {
{int relevance: DART_RELEVANCE_DEFAULT,
String importUri,
CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
- bool isDeprecated: false}) {
+ bool isDeprecated: false,
+ String defaultArgListString}) {
CompletionSuggestion cs = assertSuggest(name,
csKind: kind,
relevance: relevance,
importUri: importUri,
- isDeprecated: isDeprecated);
+ isDeprecated: isDeprecated,
+ defaultArgListString: defaultArgListString);
expect(cs.declaringType, equals(declaringType));
expect(cs.returnType, returnType != null ? returnType : 'dynamic');
protocol.Element element = cs.element;

Powered by Google App Engine
This is Rietveld 408576698