| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library services.util; | 8 library services.util; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 /** | 107 /** |
| 108 * @return the [SourceRange] of the selection. | 108 * @return the [SourceRange] of the selection. |
| 109 */ | 109 */ |
| 110 SourceRange get selectionRange => new SourceRange(selectionOffset, selectionLe
ngth); | 110 SourceRange get selectionRange => new SourceRange(selectionOffset, selectionLe
ngth); |
| 111 } | 111 } |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * Utilities for analyzing [CompilationUnit], its parts and source. | 114 * Utilities for analyzing [CompilationUnit], its parts and source. |
| 115 */ | 115 */ |
| 116 class CorrectionUtils { | 116 class CorrectionUtils { |
| 117 /** | |
| 118 * If `true` then [addEdit] validates that | |
| 119 * [Edit] replaces correct part of the [Source]. | |
| 120 */ | |
| 121 static bool _DEBUG_VALIDATE_EDITS = true; | |
| 122 | |
| 123 static List<String> _KNOWN_METHOD_NAME_PREFIXES = ["get", "is", "to"]; | 117 static List<String> _KNOWN_METHOD_NAME_PREFIXES = ["get", "is", "to"]; |
| 124 | 118 |
| 125 /** | 119 /** |
| 126 * @return <code>true</code> if given [List]s are equals at given position. | 120 * @return <code>true</code> if given [List]s are equals at given position. |
| 127 */ | 121 */ |
| 128 static bool allListsEqual(List<List> lists, int position) { | 122 static bool allListsEqual(List<List> lists, int position) { |
| 129 Object element = lists[0][position]; | 123 Object element = lists[0][position]; |
| 130 for (List list in lists) { | 124 for (List list in lists) { |
| 131 if (!identical(list[position], element)) { | 125 if (!identical(list[position], element)) { |
| 132 return false; | 126 return false; |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1762 return []; | 1756 return []; |
| 1763 } | 1757 } |
| 1764 } | 1758 } |
| 1765 | 1759 |
| 1766 /** | 1760 /** |
| 1767 * @return <code>true</code> if given [Token]s contain only single [Token] wit
h given | 1761 * @return <code>true</code> if given [Token]s contain only single [Token] wit
h given |
| 1768 * [TokenType]. | 1762 * [TokenType]. |
| 1769 */ | 1763 */ |
| 1770 static bool hasOnly(List<Token> tokens, TokenType type) => tokens.length == 1
&& tokens[0].type == type; | 1764 static bool hasOnly(List<Token> tokens, TokenType type) => tokens.length == 1
&& tokens[0].type == type; |
| 1771 } | 1765 } |
| OLD | NEW |