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

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

Issue 1076773002: do not suggest local functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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/test/mock_sdk.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 b0e6515334bc98c91c0f3cd27d4a699a1a1fda97..092bc66150c6bb6dffafff34e6d29da711924827 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -1211,7 +1211,7 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
export "dart:math" hide max;
class A {int x;}
@deprecated D1() {int x;}
- class _B { }''');
+ class _B {boo() { partBoo() {}} }''');
addSource('/testCD.dart', '''
String T1;
var _T2;
@@ -1233,7 +1233,7 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
int T5;
var _T6;
String get T7 => 'hello';
- set T8(int value) { }
+ set T8(int value) { partT8() {} }
Z D2() {int x;}
class X {
int get clog => 8;
@@ -1260,10 +1260,12 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
// Don't suggest locals out of scope
assertNotSuggested('r');
assertNotSuggested('x');
+ assertNotSuggested('partT8');
assertSuggestImportedClass('A');
assertNotSuggested('_B');
assertSuggestImportedClass('C');
+ assertNotSuggested('partBoo');
// hidden element suggested as low relevance
// but imported results are partially filtered
//assertSuggestImportedClass('D', COMPLETION_RELEVANCE_LOW);
@@ -1299,6 +1301,9 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
assertSuggestLocalSetter('blog');
// TODO (danrubel) suggest HtmlElement as low relevance
assertNotSuggested('HtmlElement');
+ assertSuggestImportedClass('Uri');
+ assertNotSuggested('parseIPv6Address');
+ assertNotSuggested('parseHex');
});
}
@@ -1439,6 +1444,58 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_Block_local_function() {
+ addSource('/testAB.dart', '''
+ export "dart:math" hide max;
+ class A {int x;}
+ @deprecated D1() {int x;}
+ class _B {boo() { partBoo() {}} }''');
+ addSource('/testCD.dart', '''
+ String T1;
+ var _T2;
+ class C { }
+ class D { }''');
+ addSource('/testEEF.dart', '''
+ class EE { }
+ class F { }''');
+ addSource('/testG.dart', 'class G { }');
+ addSource('/testH.dart', '''
+ class H { }
+ int T3;
+ var _T4;'''); // not imported
+ addTestSource('''
+ import "/testAB.dart";
+ import "/testCD.dart" hide D;
+ import "/testEEF.dart" show EE;
+ import "/testG.dart" as g;
+ int T5;
+ var _T6;
+ String get T7 => 'hello';
+ set T8(int value) { partT8() {} }
+ Z D2() {int x;}
+ class X {
+ int get clog => 8;
+ set blog(value) { }
+ a() {
+ var f;
+ localF(int arg1) { }
+ {var x;}
+ p^ var r;
+ }
+ void b() { }}
+ class Z { }''');
+ computeFast();
+ return computeFull((bool result) {
+ expect(request.replacementOffset, completionOffset - 1);
+ expect(request.replacementLength, 1);
+
+ assertNotSuggested('partT8');
+ assertNotSuggested('partBoo');
+ assertNotSuggested('parseIPv6Address');
+ assertNotSuggested('parseHex');
+ });
+ }
+
test_Block_unimported() {
addSource('/testAB.dart', 'class Foo { }');
addTestSource('class C {foo(){F^}}');
« no previous file with comments | « pkg/analysis_server/test/mock_sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698