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

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

Issue 1022703006: fix exceptions when completing other edge cases (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/optype_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 ad3c93044e9b907dc64516d1ba5f3355aab070bc..83ef718627f1a8de62735ae549d78f596f61f2f7 100644
--- a/pkg/analysis_server/lib/src/services/completion/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
@@ -320,7 +320,10 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
}
@override
- visitFunctionExpression(FunctionExpression node) {}
+ void visitFunctionExpression(FunctionExpression node) {}
+
+ @override
+ void visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {}
@override
void visitFunctionTypeAlias(FunctionTypeAlias node) {
@@ -435,6 +438,12 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
}
@override
+ void visitPostfixExpression(PostfixExpression node) {
+ optype.includeReturnValueSuggestions = true;
+ optype.includeTypeNameSuggestions = true;
+ }
+
+ @override
void visitPrefixedIdentifier(PrefixedIdentifier node) {
if (identical(entity, node.identifier)) {
optype.includeInvocationSuggestions = true;
@@ -499,6 +508,12 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
}
@override
+ void visitThrowExpression(ThrowExpression node) {
+ optype.includeReturnValueSuggestions = true;
+ optype.includeTypeNameSuggestions = true;
+ }
+
+ @override
void visitTypeArgumentList(TypeArgumentList node) {
NodeList<TypeName> arguments = node.arguments;
for (TypeName typeName in arguments) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/optype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698