| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 _addSuggestion(Keyword.WITH, DART_RELEVANCE_HIGH); | 212 _addSuggestion(Keyword.WITH, DART_RELEVANCE_HIGH); |
| 213 } | 213 } |
| 214 if (node.implementsClause == null) { | 214 if (node.implementsClause == null) { |
| 215 _addSuggestion(Keyword.IMPLEMENTS, DART_RELEVANCE_HIGH); | 215 _addSuggestion(Keyword.IMPLEMENTS, DART_RELEVANCE_HIGH); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 void _addSuggestion(Keyword keyword, | 219 void _addSuggestion(Keyword keyword, |
| 220 [int relevance = DART_RELEVANCE_DEFAULT]) { | 220 [int relevance = DART_RELEVANCE_DEFAULT]) { |
| 221 String completion = keyword.syntax; | 221 String completion = keyword.syntax; |
| 222 request.suggestions.add(new CompletionSuggestion( | 222 request.addSuggestion(new CompletionSuggestion( |
| 223 CompletionSuggestionKind.KEYWORD, | 223 CompletionSuggestionKind.KEYWORD, |
| 224 relevance, completion, completion.length, 0, false, false)); | 224 relevance, completion, completion.length, 0, false, false)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void _addSuggestions(List<Keyword> keywords, | 227 void _addSuggestions(List<Keyword> keywords, |
| 228 [int relevance = DART_RELEVANCE_KEYWORD]) { | 228 [int relevance = DART_RELEVANCE_KEYWORD]) { |
| 229 keywords.forEach((Keyword keyword) { | 229 keywords.forEach((Keyword keyword) { |
| 230 _addSuggestion(keyword, relevance); | 230 _addSuggestion(keyword, relevance); |
| 231 }); | 231 }); |
| 232 } | 232 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 AstNode parent = body.parent; | 252 AstNode parent = body.parent; |
| 253 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { | 253 if (parent is ConstructorDeclaration || parent is MethodDeclaration) { |
| 254 return true; | 254 return true; |
| 255 } | 255 } |
| 256 node = parent; | 256 node = parent; |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 } | 259 } |
| OLD | NEW |