| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library services.completion.contributor.dart.keyword; | 5 library services.completion.contributor.dart.keyword; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart'; | 9 import 'package:analysis_server/src/protocol.dart'; |
| 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Keyword.DYNAMIC, | 111 Keyword.DYNAMIC, |
| 112 Keyword.FINAL, | 112 Keyword.FINAL, |
| 113 Keyword.TYPEDEF, | 113 Keyword.TYPEDEF, |
| 114 Keyword.VAR, | 114 Keyword.VAR, |
| 115 Keyword.VOID | 115 Keyword.VOID |
| 116 ], DART_RELEVANCE_HIGH); | 116 ], DART_RELEVANCE_HIGH); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 @override | 120 @override |
| 121 visitFormalParameterList(FormalParameterList node) { |
| 122 AstNode constructorDecl = |
| 123 node.getAncestor((p) => p is ConstructorDeclaration); |
| 124 if (constructorDecl != null) { |
| 125 _addSuggestions([Keyword.THIS]); |
| 126 } |
| 127 } |
| 128 |
| 129 @override |
| 121 visitIfStatement(IfStatement node) { | 130 visitIfStatement(IfStatement node) { |
| 122 if (entity == node.thenStatement) { | 131 if (entity == node.thenStatement) { |
| 123 _addStatementKeywords(node); | 132 _addStatementKeywords(node); |
| 124 } | 133 } |
| 125 } | 134 } |
| 126 | 135 |
| 127 @override | 136 @override |
| 128 visitImportDirective(ImportDirective node) { | 137 visitImportDirective(ImportDirective node) { |
| 129 if (entity == node.asKeyword) { | 138 if (entity == node.asKeyword) { |
| 130 if (node.deferredKeyword == null) { | 139 if (node.deferredKeyword == null) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return false; | 213 return false; |
| 205 } | 214 } |
| 206 AstNode parent = body.parent; | 215 AstNode parent = body.parent; |
| 207 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { | 216 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { |
| 208 return true; | 217 return true; |
| 209 } | 218 } |
| 210 node = parent; | 219 node = parent; |
| 211 } | 220 } |
| 212 } | 221 } |
| 213 } | 222 } |
| OLD | NEW |