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

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

Issue 982983003: remove type suggestion when interpolation completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 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/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 67ffd11d8c4e68762d26be306d84c58ebb517304..270f72d4623432892db7eae3ce6878f16137c02b 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -2285,18 +2285,76 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
test_InterpolationExpression() {
// SimpleIdentifier InterpolationExpression StringInterpolation
- addTestSource('main() {String name; print("hello \$^");}');
+ addSource('/testA.dart', '''
+ int T1;
+ F1() { }
+ typedef D1();
+ class C1 {C1(this.x) { } int x;}''');
+ addTestSource('''
+ import "/testA.dart";
+ int T2;
+ F2() { }
+ typedef D2();
+ class C2 { }
+ main() {String name; print("hello \$^");}''');
computeFast();
return computeFull((bool result) {
expect(request.replacementOffset, completionOffset);
expect(request.replacementLength, 0);
+ assertNotSuggested('Object');
+ // TODO(danrubel) should return top level var rather than getter
+ if (computer is ImportedComputer) {
+ //assertSuggestImportedTopLevelVar('T1', 'int');
+ assertSuggestGetter('T1', 'int');
+ }
+ assertSuggestImportedFunction('F1', null);
+ assertNotSuggested('D1');
+ assertNotSuggested('C1');
+ assertSuggestLocalTopLevelVar('T2', 'int');
+ assertSuggestLocalFunction('F2', null);
+ assertNotSuggested('D2');
+ assertNotSuggested('C2');
assertSuggestLocalVariable('name', 'String');
- assertSuggestImportedClass('Object');
});
}
test_InterpolationExpression_block() {
// SimpleIdentifier InterpolationExpression StringInterpolation
+ addSource('/testA.dart', '''
+ int T1;
+ F1() { }
+ typedef D1();
+ class C1 {C1(this.x) { } int x;}''');
+ addTestSource('''
+ import "/testA.dart";
+ int T2;
+ F2() { }
+ typedef D2();
+ class C2 { }
+ main() {String name; print("hello \${^}");}''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset);
+ expect(request.replacementLength, 0);
+ assertSuggestImportedClass('Object');
+ // TODO(danrubel) should return top level var rather than getter
+ if (computer is ImportedComputer) {
+ //assertSuggestImportedTopLevelVar('T1', 'int');
+ assertSuggestGetter('T1', 'int');
+ }
+ assertSuggestImportedFunction('F1', null);
+ assertSuggestImportedFunctionTypeAlias('D1', null);
+ assertSuggestImportedClass('C1');
+ assertSuggestLocalTopLevelVar('T2', 'int');
+ assertSuggestLocalFunction('F2', null);
+ assertSuggestLocalFunctionTypeAlias('D2', null);
+ assertSuggestLocalClass('C2');
+ assertSuggestLocalVariable('name', 'String');
+ });
+ }
+
+ test_InterpolationExpression_block2() {
+ // SimpleIdentifier InterpolationExpression StringInterpolation
addTestSource('main() {String name; print("hello \${n^}");}');
computeFast();
return computeFull((bool result) {

Powered by Google App Engine
This is Rietveld 408576698