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

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

Issue 657593002: include locally inherited members in suggestions (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 ab9837fe3b5732c3e2270c92fa5698bbf5785375..bf65115d1f1687f1cc2c8aac2bb8fc342904ced1 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -404,6 +404,26 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
}
}
+ CompletionSuggestion assertSuggestImportedGetter(String name,
+ String returnType, [CompletionRelevance relevance =
+ CompletionRelevance.DEFAULT]) {
+ if (computer is ImportedComputer) {
+ return assertSuggestGetter(name, returnType, relevance);
+ } else {
+ return assertNotSuggested(name);
+ }
+ }
+
+ CompletionSuggestion assertSuggestImportedMethod(String name,
+ String declaringType, String returnType, [CompletionRelevance relevance =
+ CompletionRelevance.DEFAULT]) {
+ if (computer is ImportedComputer) {
+ return assertSuggestMethod(name, declaringType, returnType, relevance);
+ } else {
+ return assertNotSuggested(name);
+ }
+ }
+
CompletionSuggestion assertSuggestImportedTopLevelVar(String name,
String returnType, [CompletionRelevance relevance =
CompletionRelevance.DEFAULT]) {
@@ -659,6 +679,27 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
});
}
+ test_Block_inherited_local() {
+ // Block BlockFunctionBody MethodDeclaration ClassDeclaration
+ addTestSource('''
+ class F { var f1; f2() { } }
+ class E extends F { var e1; e2() { } }
+ class I { int i1; i2() { } }
+ class M { var m1; int m2() { } }
+ class A extends E implements I with M {a() {^}}''');
+ computeFast();
+ return computeFull(true).then((_) {
+ assertSuggestLocalGetter('e1', null);
+ assertSuggestLocalGetter('f1', null);
+ assertSuggestLocalGetter('i1', 'int');
+ assertSuggestLocalGetter('m1', null);
+ assertSuggestLocalMethod('e2', 'E', null);
+ assertSuggestLocalMethod('f2', 'F', null);
+ assertSuggestLocalMethod('i2', 'I', null);
+ assertSuggestLocalMethod('m2', 'M', 'int');
+ });
+ }
+
test_CascadeExpression_selector1() {
// PropertyAccess CascadeExpression ExpressionStatement Block
addSource('/testB.dart', '''
@@ -752,11 +793,11 @@ class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
// ClassDeclaration CompilationUnit
addSource('/testB.dart', '''
class B { }''');
- addTestSource( //
- 'import "testB.dart" as x;' //
- ' @deprecated class A {^}' //
- ' class _B {}' //
- ' A T;');
+ addTestSource('''
+ import "testB.dart" as x;
+ @deprecated class A {^}
+ class _B {}
+ A T;''');
computeFast();
return computeFull(true).then((_) {
CompletionSuggestion suggestionA = assertSuggestLocalClass('A');
« 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