Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.src.completion.statement; | 5 library services.src.completion.statement; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/protocol_server.dart' hide Element; | 10 import 'package:analysis_server/src/protocol_server.dart' hide Element; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 } | 231 } |
| 232 | 232 |
| 233 String _baseNodeText(AstNode astNode) { | 233 String _baseNodeText(AstNode astNode) { |
| 234 String text = utils.getNodeText(astNode); | 234 String text = utils.getNodeText(astNode); |
| 235 if (text.endsWith(eol)) { | 235 if (text.endsWith(eol)) { |
| 236 text = text.substring(0, text.length - eol.length); | 236 text = text.substring(0, text.length - eol.length); |
| 237 } | 237 } |
| 238 return text; | 238 return text; |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool _complete_controlFlowBlock() { | 241 // bool _complete_controlFlowBlock() { |
|
messick
2017/04/20 17:30:49
You could fix the warning by calling this method f
devoncarew
2017/04/20 17:37:36
If this warning will be addressed shortly then I w
| |
| 242 //TODO(messick) Implement _complete_controlFlowBlock | 242 // //TODO(messick) Implement _complete_controlFlowBlock |
| 243 // Use statement completion to move the cursor to a new line outside the | 243 // // Use statement completion to move the cursor to a new line outside the |
| 244 // current block. The statement has no errors in this case. Used to jump | 244 // // current block. The statement has no errors in this case. Used to jump |
| 245 // out of do/for/if/while blocks. | 245 // // out of do/for/if/while blocks. |
| 246 //TODO(messick) Move has-errors checking into dispatch method. | 246 // //TODO(messick) Move has-errors checking into dispatch method. |
| 247 return false; | 247 // return false; |
| 248 } | 248 // } |
| 249 | 249 |
| 250 bool _complete_doStatement() { | 250 bool _complete_doStatement() { |
| 251 if (errors.isEmpty || node is! DoStatement) { | 251 if (errors.isEmpty || node is! DoStatement) { |
| 252 return false; | 252 return false; |
| 253 } | 253 } |
| 254 DoStatement statement = node; | 254 DoStatement statement = node; |
| 255 SourceBuilder sb = _sourceBuilderAfterKeyword(statement.doKeyword); | 255 SourceBuilder sb = _sourceBuilderAfterKeyword(statement.doKeyword); |
| 256 bool hasWhileKeyword = statement.whileKeyword.lexeme == "while"; | 256 bool hasWhileKeyword = statement.whileKeyword.lexeme == "while"; |
| 257 int exitDelta = 0; | 257 int exitDelta = 0; |
| 258 if (statement.body is EmptyStatement) { | 258 if (statement.body is EmptyStatement) { |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 696 final Token keyword; | 696 final Token keyword; |
| 697 final Token leftParenthesis, rightParenthesis; | 697 final Token leftParenthesis, rightParenthesis; |
| 698 final Expression condition; | 698 final Expression condition; |
| 699 final Statement block; | 699 final Statement block; |
| 700 | 700 |
| 701 _KeywordConditionBlockStructure(this.keyword, this.leftParenthesis, | 701 _KeywordConditionBlockStructure(this.keyword, this.leftParenthesis, |
| 702 this.condition, this.rightParenthesis, this.block); | 702 this.condition, this.rightParenthesis, this.block); |
| 703 | 703 |
| 704 int get offset => keyword.offset; | 704 int get offset => keyword.offset; |
| 705 } | 705 } |
| OLD | NEW |