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

Unified Diff: pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart

Issue 1120893002: cleanup visitInheritedTypes signature (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: update comments 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/lib/src/services/completion/local_declaration_visitor.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/lib/src/services/completion/suggestion_builder.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
index 9dfdf2f8df35d350b576ed7b87b38a50a599a965..80ddd8560414003336112be61692682d28e3cd84 100644
--- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
@@ -157,12 +157,13 @@ visitInheritedTypeNames(ClassDeclaration node, void inherited(String name)) {
/**
* Starting with the given class node, traverse the inheritence hierarchy
* calling the given functions with each non-null non-empty inherited class
- * declaration. For each locally defined class declaration, call [local].
+ * declaration. For each locally defined declaration, call [localDeclaration].
* For each class identifier in the hierarchy that is not defined locally,
- * call the [imported] function.
+ * call the [importedTypeName] function.
*/
void visitInheritedTypes(ClassDeclaration node,
- void local(ClassDeclaration classNode), void imported(String typeName)) {
+ {void localDeclaration(ClassDeclaration classNode),
+ void importedTypeName(String typeName)}) {
CompilationUnit unit = node.getAncestor((p) => p is CompilationUnit);
List<ClassDeclaration> todo = new List<ClassDeclaration>();
todo.add(node);
@@ -181,10 +182,14 @@ void visitInheritedTypes(ClassDeclaration node,
return false;
}, orElse: () => null);
if (classNode is ClassDeclaration) {
- local(classNode);
+ if (localDeclaration != null) {
+ localDeclaration(classNode);
+ }
todo.add(classNode);
} else {
- imported(name);
+ if (importedTypeName != null) {
+ importedTypeName(name);
+ }
}
}
});
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698