| Index: pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
|
| index 6aa3536b327097b02ba1eb97dc9b6edafbc0c194..fe9ef1430d2a735b0fa3d73ecf5d8f7b88cf1d7a 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
|
| @@ -1,4 +1,5 @@
|
| // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| +
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| @@ -70,6 +71,9 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
|
| }
|
| }
|
| _addStatementKeywords(node);
|
| + if (_inCatchClause(node)) {
|
| + _addSuggestion(Keyword.RETHROW, DART_RELEVANCE_KEYWORD - 1);
|
| + }
|
| }
|
|
|
| @override
|
| @@ -446,7 +450,6 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
|
| Keyword.VOID,
|
| Keyword.WHILE
|
| ]);
|
| - _addSuggestion(Keyword.RETHROW, DART_RELEVANCE_KEYWORD - 1);
|
| }
|
|
|
| void _addSuggestion(Keyword keyword,
|
| @@ -481,6 +484,9 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
|
| return body != null && body.isAsynchronous;
|
| }
|
|
|
| + bool _inCatchClause(Block node) =>
|
| + node.getAncestor((p) => p is CatchClause) != null;
|
| +
|
| bool _inClassMemberBody(AstNode node) {
|
| while (true) {
|
| AstNode body = node.getAncestor((n) => n is FunctionBody);
|
|
|