| 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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 index--; | 1249 index--; |
| 1250 } | 1250 } |
| 1251 return index; | 1251 return index; |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 /** | 1254 /** |
| 1255 * @return the start index of the next line after the line which contains give
n index. | 1255 * @return the start index of the next line after the line which contains give
n index. |
| 1256 */ | 1256 */ |
| 1257 int getLineNext(int index) { | 1257 int getLineNext(int index) { |
| 1258 int length = _buffer.length; | 1258 int length = _buffer.length; |
| 1259 // skip whitespace characters | 1259 // skip to the end of the line |
| 1260 while (index < length) { | 1260 while (index < length) { |
| 1261 int c = _buffer.codeUnitAt(index); | 1261 int c = _buffer.codeUnitAt(index); |
| 1262 if (c == 0xD || c == 0xA) { | 1262 if (c == 0xD || c == 0xA) { |
| 1263 break; | 1263 break; |
| 1264 } | 1264 } |
| 1265 index++; | 1265 index++; |
| 1266 } | 1266 } |
| 1267 // skip single \r | 1267 // skip single \r |
| 1268 if (index < length && _buffer.codeUnitAt(index) == 0xD) { | 1268 if (index < length && _buffer.codeUnitAt(index) == 0xD) { |
| 1269 index++; | 1269 index++; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 String getText3(SourceRange range) => getText2(range.offset, range.length); | 1437 String getText3(SourceRange range) => getText2(range.offset, range.length); |
| 1438 | 1438 |
| 1439 /** | 1439 /** |
| 1440 * @return the actual type source of the given [Expression], may be `null` if
can not | 1440 * @return the actual type source of the given [Expression], may be `null` if
can not |
| 1441 * be resolved, should be treated as <code>Dynamic</code>. | 1441 * be resolved, should be treated as <code>Dynamic</code>. |
| 1442 */ | 1442 */ |
| 1443 String getTypeSource(Expression expression) { | 1443 String getTypeSource(Expression expression) { |
| 1444 if (expression == null) { | 1444 if (expression == null) { |
| 1445 return null; | 1445 return null; |
| 1446 } | 1446 } |
| 1447 DartType type = expression.staticType; | 1447 DartType type = expression.bestType; |
| 1448 String typeSource = getTypeSource2(type); | 1448 String typeSource = getTypeSource2(type); |
| 1449 if ("dynamic" == typeSource) { | 1449 if ("dynamic" == typeSource) { |
| 1450 return null; | 1450 return null; |
| 1451 } | 1451 } |
| 1452 return typeSource; | 1452 return typeSource; |
| 1453 } | 1453 } |
| 1454 | 1454 |
| 1455 /** | 1455 /** |
| 1456 * @return the source to reference the given [Type] in this [CompilationUnit]. | 1456 * @return the source to reference the given [Type] in this [CompilationUnit]. |
| 1457 */ | 1457 */ |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 String p = targetParts[i]; | 2428 String p = targetParts[i]; |
| 2429 relativePath.append(p); | 2429 relativePath.append(p); |
| 2430 relativePath.append("/"); | 2430 relativePath.append("/"); |
| 2431 } | 2431 } |
| 2432 // append target file name | 2432 // append target file name |
| 2433 relativePath.append(targetParts[targetParts.length - 1]); | 2433 relativePath.append(targetParts[targetParts.length - 1]); |
| 2434 // done | 2434 // done |
| 2435 return relativePath.toString(); | 2435 return relativePath.toString(); |
| 2436 } | 2436 } |
| 2437 } | 2437 } |
| OLD | NEW |