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

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

Issue 643803002: suppress suggestions in string literals (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/local_computer.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/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 2ed4cd5a682a1638dcf7c602e3660a391f46993f..6d8d7b7e4ca427b2b2ecbdd19e5edeb2915e8e62 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -538,6 +538,56 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_AssignmentExpression_RHS() {
+ // SimpleIdentifier VariableDeclaration VariableDeclarationList
+ // VariableDeclarationStatement Block
+ addTestSource('class A {} main() {int a; int b = ^}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalVariable('a', 'int');
+ assertSuggestLocalFunction('main', null);
+ assertSuggestLocalClass('A');
+ assertSuggestImportedClass('Object');
+ });
+ }
+
+ test_AssignmentExpression_name() {
+ // SimpleIdentifier VariableDeclaration VariableDeclarationList
+ // VariableDeclarationStatement Block
+ addTestSource('class A {} main() {int a; int ^b = 1;}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertNoSuggestions();
+ });
+ }
+
+ test_AssignmentExpression_type() {
+ // SimpleIdentifier TypeName VariableDeclarationList
+ // VariableDeclarationStatement Block
+ addTestSource('class A {} main() {int a; int^ b = 1;}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalClass('A');
+ assertSuggestImportedClass('int');
+ assertNotSuggested('a');
+ assertNotSuggested('main');
+ });
+ }
+
+ test_AwaitExpression() {
+ // SimpleIdentifier AwaitExpression ExpressionStatement
+ addTestSource('''
+ class A {int x; int y() => 0;}
+ main(){A a; await ^}''');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalVariable('a', 'A');
+ assertSuggestLocalFunction('main', null);
+ assertSuggestLocalClass('A');
+ assertSuggestImportedClass('Object');
+ });
+ }
+
test_BinaryExpression_LHS() {
// SimpleIdentifier BinaryExpression VariableDeclaration
// VariableDeclarationList VariableDeclarationStatement
@@ -590,7 +640,7 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
int T5;
var _T6;
Z D2() {int x;}
- class X {a() {var f; {var x;} ^ var r;} Z b() { }}
+ class X {a() {var f; {var x;} ^ var r;} void b() { }}
class Z { }''');
computeFast();
return computeFull(true).then((_) {
@@ -598,7 +648,7 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
assertSuggestLocalClass('X');
assertSuggestLocalClass('Z');
assertLocalSuggestMethod('a', 'X', null);
- assertLocalSuggestMethod('b', 'X', 'Z');
+ assertLocalSuggestMethod('b', 'X', 'void');
assertSuggestLocalVariable('f', null);
// Don't suggest locals out of scope
assertNotSuggested('r');
@@ -1117,6 +1167,15 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_Literal_string() {
+ // SimpleStringLiteral ExpressionStatement Block
+ addTestSource('class A {a() {"hel^lo"}}');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertNoSuggestions();
+ });
+ }
+
test_MethodDeclaration_body_getters() {
// Block BlockFunctionBody MethodDeclaration
addTestSource('class A {@deprecated X get f => 0; Z a() {^} get _g => 1;}');
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/local_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698