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

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

Issue 2727343002: Calculate text ranges for default args. (Closed)
Patch Set: 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
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/completion_contributor_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/dart/local_reference_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
index 2d9156a4375fff35d5717458b886b9929d690dcb..31e96f7b3cd4cee9a8889a3a012589319702e8cd 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
@@ -4600,13 +4600,14 @@ class LocalReferenceContributorTest_Driver
test_ArgDefaults_function() async {
addTestSource('''
-bool hasLength(int expected, bool b) => false;
+bool hasLength(int a, bool b) => false;
void main() {h^}''');
await computeSuggestions();
assertSuggestFunction('hasLength', 'bool',
relevance: DART_RELEVANCE_LOCAL_FUNCTION,
- defaultArgListString: 'expected, b');
+ defaultArgListString: 'a, b',
+ defaultArgumentListTextRanges: [0, 1, 3, 1]);
}
test_ArgDefaults_function_none() async {
@@ -4616,7 +4617,9 @@ void main() {h^}''');
await computeSuggestions();
assertSuggestFunction('hasLength', 'bool',
- relevance: DART_RELEVANCE_LOCAL_FUNCTION, defaultArgListString: null);
+ relevance: DART_RELEVANCE_LOCAL_FUNCTION,
+ defaultArgListString: null,
+ defaultArgumentListTextRanges: null);
}
test_ArgDefaults_function_with_optional_positional() async {
@@ -4629,7 +4632,9 @@ void main() {h^}''');
await computeSuggestions();
assertSuggestFunction('foo', 'bool',
- relevance: DART_RELEVANCE_LOCAL_FUNCTION, defaultArgListString: 'bar');
+ relevance: DART_RELEVANCE_LOCAL_FUNCTION,
+ defaultArgListString: 'bar',
+ defaultArgumentListTextRanges: [0, 3]);
}
test_ArgDefaults_function_with_required_named() async {
@@ -4643,7 +4648,8 @@ void main() {h^}''');
assertSuggestFunction('foo', 'bool',
relevance: DART_RELEVANCE_LOCAL_FUNCTION,
- defaultArgListString: 'bar, baz: null');
+ defaultArgListString: 'bar, baz: null',
+ defaultArgumentListTextRanges: [0, 3, 10, 4]);
}
test_ArgDefaults_method_with_required_named() async {
@@ -4661,6 +4667,7 @@ class A {
assertSuggestMethod('foo', 'A', 'bool',
relevance: DART_RELEVANCE_LOCAL_METHOD,
- defaultArgListString: 'bar, baz: null');
+ defaultArgListString: 'bar, baz: null',
+ defaultArgumentListTextRanges: [0, 3, 10, 4]);
}
}
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698