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

Unified Diff: pkg/analysis_services/test/completion/local_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
« no previous file with comments | « pkg/analysis_services/test/completion/imported_type_computer_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_services/test/completion/local_computer_test.dart
diff --git a/pkg/analysis_services/test/completion/local_computer_test.dart b/pkg/analysis_services/test/completion/local_computer_test.dart
index 47a8ca9c8984443fb89f4aae94b6c7c2002b85c1..eb0a7f97126f1a960d7f0f75b8b81d249f0598fd 100644
--- a/pkg/analysis_services/test/completion/local_computer_test.dart
+++ b/pkg/analysis_services/test/completion/local_computer_test.dart
@@ -59,6 +59,21 @@ class LocalComputerTest extends AbstractCompletionTest {
assertSuggestLibraryPrefix('x');
}
+ test_field_name() {
+ addTestSource('class A {B ^}}');
+ expect(computeFast(), isTrue);
+ assertNotSuggested('A');
+ }
+
+ test_field_name2() {
+ addTestSource('class A {var ^}}');
+ expect(computeFast(), isTrue);
+ //TODO (danrubel) should not be suggested
+ // but var ^ in this test
+ // parses differently than B ^ in test above
+ assertSuggestClass('A');
+ }
+
test_for() {
addTestSource('main(args) {for (int i; i < 10; ++i) {^}}');
expect(computeFast(), isTrue);
@@ -79,6 +94,25 @@ class LocalComputerTest extends AbstractCompletionTest {
assertSuggestParameter('b');
}
+ test_local_name() {
+ addTestSource('class A {a() {var f; A ^}}');
+ expect(computeFast(), isTrue);
+ //TODO (danrubel) should not be suggested
+ // but A ^ in this test
+ // parses differently than var ^ in test below
+ assertSuggestClass('A');
+ assertSuggestMethodName('a');
+ assertSuggestVariable('f');
+ }
+
+ test_local_name2() {
+ addTestSource('class A {a() {var f; var ^}}');
+ expect(computeFast(), isTrue);
+ assertNotSuggested('A');
+ assertNotSuggested('a');
+ assertNotSuggested('f');
+ }
+
test_members() {
addTestSource('class A {var f; a() {^} var g;}');
expect(computeFast(), isTrue);
@@ -103,6 +137,21 @@ class LocalComputerTest extends AbstractCompletionTest {
assertSuggestParameter('y');
}
+ test_topLevelVar_name() {
+ addTestSource('class A {} B ^');
+ expect(computeFast(), isTrue);
+ assertNotSuggested('A');
+ }
+
+ test_topLevelVar_name2() {
+ addTestSource('class A {} var ^');
+ expect(computeFast(), isTrue);
+ // TODO (danrubel) should not be suggested
+ // but var ^ in this test
+ // parses differently than B ^ in test above
+ assertSuggestClass('A');
+ }
+
test_variableDeclaration() {
addTestSource('main() {int a = 1, b = 2 + ^;}');
expect(computeFast(), isTrue);
@@ -110,4 +159,3 @@ class LocalComputerTest extends AbstractCompletionTest {
assertNotSuggested('b');
}
}
-
« no previous file with comments | « pkg/analysis_services/test/completion/imported_type_computer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698