| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 CompletionSuggestionKind.KEYWORD, | 207 CompletionSuggestionKind.KEYWORD, |
| 208 relevance, | 208 relevance, |
| 209 completion, | 209 completion, |
| 210 completion.length, | 210 completion.length, |
| 211 0, | 211 0, |
| 212 false, | 212 false, |
| 213 false)); | 213 false)); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void _addSuggestions(List<Keyword> keywords, [int relevance = | 216 void _addSuggestions(List<Keyword> keywords, [int relevance = |
| 217 COMPLETION_RELEVANCE_DEFAULT]) { | 217 DART_RELEVANCE_KEYWORD]) { |
| 218 keywords.forEach((Keyword keyword) { | 218 keywords.forEach((Keyword keyword) { |
| 219 _addSuggestion(keyword, relevance); | 219 _addSuggestion(keyword, relevance); |
| 220 }); | 220 }); |
| 221 } | 221 } |
| 222 | 222 |
| 223 bool _isOffsetAfterNode(AstNode node) { | 223 bool _isOffsetAfterNode(AstNode node) { |
| 224 if (request.offset == node.end) { | 224 if (request.offset == node.end) { |
| 225 Token token = node.endToken; | 225 Token token = node.endToken; |
| 226 if (token != null && !token.isSynthetic) { | 226 if (token != null && !token.isSynthetic) { |
| 227 if (token.lexeme == ';' || token.lexeme == '}') { | 227 if (token.lexeme == ';' || token.lexeme == '}') { |
| 228 return true; | 228 return true; |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 return false; | 232 return false; |
| 233 } | 233 } |
| 234 } | 234 } |
| OLD | NEW |