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

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

Issue 999923002: completions for function return type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 9 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 | « no previous file | pkg/analysis_server/test/services/completion/completion_target_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/optype.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/optype.dart b/pkg/analysis_server/lib/src/services/completion/optype.dart
index 83e89f55e9d3e38d1ca301a882a385de6767c671..cba56957243a1931b1da0629605c3b439c36503d 100644
--- a/pkg/analysis_server/lib/src/services/completion/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
@@ -184,7 +184,9 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
}
void visitCompilationUnit(CompilationUnit node) {
- optype.includeTypeNameSuggestions = true;
+ if (entity is! CommentToken) {
+ optype.includeTypeNameSuggestions = true;
+ }
}
@override
@@ -310,6 +312,14 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
}
@override
+ void visitFunctionDeclaration(FunctionDeclaration node) {
+ if (identical(entity, node.returnType) ||
+ identical(entity, node.name) && node.returnType == null) {
+ optype.includeTypeNameSuggestions = true;
+ }
+ }
+
+ @override
void visitFunctionTypeAlias(FunctionTypeAlias node) {
if (identical(entity, node.returnType) ||
identical(entity, node.name) && node.returnType == null) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_target_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698