| 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.computer.dart.keyword; | 5 library services.completion.computer.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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 _addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH); | 112 _addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH); |
| 113 } | 113 } |
| 114 _addSuggestions( | 114 _addSuggestions( |
| 115 [Keyword.EXPORT, Keyword.IMPORT, Keyword.PART], DART_RELEVANCE_HIGH); | 115 [Keyword.EXPORT, Keyword.IMPORT, Keyword.PART], DART_RELEVANCE_HIGH); |
| 116 } | 116 } |
| 117 if (entity == null || entity is Declaration) { | 117 if (entity == null || entity is Declaration) { |
| 118 _addSuggestions([ | 118 _addSuggestions([ |
| 119 Keyword.ABSTRACT, | 119 Keyword.ABSTRACT, |
| 120 Keyword.CLASS, | 120 Keyword.CLASS, |
| 121 Keyword.CONST, | 121 Keyword.CONST, |
| 122 Keyword.DYNAMIC, |
| 122 Keyword.FINAL, | 123 Keyword.FINAL, |
| 123 Keyword.TYPEDEF, | 124 Keyword.TYPEDEF, |
| 124 Keyword.VAR | 125 Keyword.VAR, |
| 126 Keyword.VOID |
| 125 ], DART_RELEVANCE_HIGH); | 127 ], DART_RELEVANCE_HIGH); |
| 126 } | 128 } |
| 127 } | 129 } |
| 128 | 130 |
| 129 void _addClassDeclarationKeywords(ClassDeclaration node) { | 131 void _addClassDeclarationKeywords(ClassDeclaration node) { |
| 130 // Very simplistic suggestion because analyzer will warn if | 132 // Very simplistic suggestion because analyzer will warn if |
| 131 // the extends / with / implements keywords are out of order | 133 // the extends / with / implements keywords are out of order |
| 132 if (node.extendsClause == null) { | 134 if (node.extendsClause == null) { |
| 133 _addSuggestion(Keyword.EXTENDS, DART_RELEVANCE_HIGH); | 135 _addSuggestion(Keyword.EXTENDS, DART_RELEVANCE_HIGH); |
| 134 } else if (node.withClause == null) { | 136 } else if (node.withClause == null) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 161 return false; | 163 return false; |
| 162 } | 164 } |
| 163 AstNode parent = body.parent; | 165 AstNode parent = body.parent; |
| 164 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { | 166 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { |
| 165 return true; | 167 return true; |
| 166 } | 168 } |
| 167 node = parent; | 169 node = parent; |
| 168 } | 170 } |
| 169 } | 171 } |
| 170 } | 172 } |
| OLD | NEW |