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

Unified Diff: pkg/analysis_services/test/completion/imported_type_computer_test.dart

Issue 460333003: do not suggest types when editing a name in a variable declaration (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 4 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_services/test/completion/imported_type_computer_test.dart
diff --git a/pkg/analysis_services/test/completion/imported_type_computer_test.dart b/pkg/analysis_services/test/completion/imported_type_computer_test.dart
index a6361f6437402462aadfaeadda001088403e1a3e..9df921fcf05af5ea177c3323ea561a97ccfeab35 100644
--- a/pkg/analysis_services/test/completion/imported_type_computer_test.dart
+++ b/pkg/analysis_services/test/completion/imported_type_computer_test.dart
@@ -130,6 +130,44 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
});
}
+ test_field_name() {
+ addSource('/testA.dart', 'class A { }');
+ addTestSource('import "/testA.dart"; class C {A ^}');
+ return computeFull().then((_) {
+ assertNotSuggested('A');
+ });
+ }
+
+ test_field_name2() {
+ addSource('/testA.dart', 'class A { }');
+ addTestSource('import "/testA.dart"; class C {var ^}');
+ return computeFull().then((_) {
+ // TODO (danrubel) should not be suggested
+ // but var ^ in this test
+ // parses differently than A ^ in test above
+ assertSuggestClass('A');
+ });
+ }
+
+ test_local_name() {
+ addSource('/testA.dart', 'var T1;');
+ addTestSource('import "/testA.dart"; class C {a() {C ^}}');
+ return computeFull().then((_) {
+ //TODO (danrubel) should not be suggested
+ // but C ^ in this test
+ // parses differently than var ^ in test below
+ assertSuggestTopLevelVar('T1');
+ });
+ }
+
+ test_local_name2() {
+ addSource('/testA.dart', 'var T1;');
+ addTestSource('import "/testA.dart"; class C {a() {var ^}}');
+ return computeFull().then((_) {
+ assertNotSuggested('T1');
+ });
+ }
+
test_topLevelVar() {
addSource('/testA.dart', 'var T1; var _T2;');
addTestSource('import "/testA.dart"; class C {foo(){^}}');
@@ -139,6 +177,25 @@ class ImportedTypeComputerTest extends AbstractCompletionTest {
});
}
+ test_topLevelVar_name() {
+ addSource('/testA.dart', 'class B { };');
+ addTestSource('import "/testA.dart"; class C {} B ^');
+ return computeFull().then((_) {
+ assertNotSuggested('B');
+ });
+ }
+
+ test_topLevelVar_name2() {
+ addSource('/testA.dart', 'class B { };');
+ addTestSource('import "/testA.dart"; class C {} var ^');
+ return computeFull().then((_) {
+ // TODO (danrubel) should not be suggested
+ // but var ^ in this test
+ // parses differently than B ^ in test above
+ assertSuggestClass('B');
+ });
+ }
+
test_topLevelVar_notImported() {
addSource('/testA.dart', 'var T1; var _T2;');
addTestSource('class C {foo(){^}}');

Powered by Google App Engine
This is Rietveld 408576698