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

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

Issue 646773002: include imported elements in interpolation suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/completion_test_util.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 1440e0d04b920b4b3af5fcdaa0ac0c1dac0e0928..a90cb28599aa48ba859ac863cd287875daf11d1d 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -989,6 +989,48 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_InterpolationExpression() {
+ // SimpleIdentifier InterpolationExpression StringInterpolation
+ addTestSource('main() {String name; print("hello \$^");}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalVariable('name', 'String');
+ assertSuggestImportedClass('Object');
+ });
+ }
+
+ test_InterpolationExpression_block() {
+ // SimpleIdentifier InterpolationExpression StringInterpolation
+ addTestSource('main() {String name; print("hello \${n^}");}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalVariable('name', 'String');
+ assertSuggestImportedClass('Object');
+ });
+ }
+
+ test_InterpolationExpression_prefix_selector() {
+ // SimpleIdentifier PrefixedIdentifier InterpolationExpression
+ addTestSource('main() {String name; print("hello \${name.^}");}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestInvocationGetter('length', 'int');
+ assertNotSuggested('name');
+ assertNotSuggested('Object');
+ });
+ }
+
+ test_InterpolationExpression_prefix_target() {
+ // SimpleIdentifier PrefixedIdentifier InterpolationExpression
+ addTestSource('main() {String name; print("hello \${nam^e.length}");}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalVariable('name', 'String');
+ assertSuggestImportedClass('Object');
+ assertNotSuggested('length');
+ });
+ }
+
test_IsExpression() {
// SimpleIdentifier TypeName IsExpression IfStatement
addSource('/testB.dart', '''
@@ -1072,17 +1114,6 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
- test_PrefixedIdentifier_interpolation() {
- // SimpleIdentifier PrefixedIdentifier InterpolationExpression
- addTestSource('main() {String name; print("hello \${name.^}");}');
- computeFast();
- return computeFull(true).then((_) {
- assertSuggestInvocationGetter('length', 'int');
- assertNotSuggested('name');
- assertNotSuggested('Object');
- });
- }
-
test_PrefixedIdentifier_library() {
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
addSource('/testB.dart', '''
@@ -1142,17 +1173,6 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
- test_PrefixedIdentifier_prefix_interpolation() {
- // SimpleIdentifier PrefixedIdentifier InterpolationExpression
- addTestSource('main() {String name; print("hello \${nam^e.length}");}');
- computeFast();
- return computeFull(true).then((_) {
- assertSuggestLocalVariable('name', 'String');
- assertSuggestImportedClass('Object');
- assertNotSuggested('length');
- });
- }
-
test_TopLevelVariableDeclaration_typed_name() {
// SimpleIdentifier VariableDeclaration VariableDeclarationList
// TopLevelVariableDeclaration

Powered by Google App Engine
This is Rietveld 408576698