| 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 engine.source; | 8 library engine.source; |
| 9 | 9 |
| 10 import "dart:math" as math; | 10 import "dart:math" as math; |
| 11 import 'dart:collection'; | 11 import 'dart:collection'; |
| 12 | 12 |
| 13 import 'package:analyzer/file_system/file_system.dart'; |
| 14 import 'package:analyzer/source/package_map_resolver.dart'; |
| 15 |
| 13 import 'engine.dart'; | 16 import 'engine.dart'; |
| 14 import 'java_core.dart'; | 17 import 'java_core.dart'; |
| 15 import 'java_engine.dart'; | 18 import 'java_engine.dart'; |
| 16 import 'sdk.dart' show DartSdk; | 19 import 'sdk.dart' show DartSdk; |
| 17 | 20 |
| 18 /** | 21 /** |
| 19 * A function that is used to handle [ContentCache] entries. | 22 * A function that is used to handle [ContentCache] entries. |
| 20 */ | 23 */ |
| 21 typedef void ContentCacheVisitor(Source source, int stamp, String contents); | 24 typedef void ContentCacheVisitor(Source source, int stamp, String contents); |
| 22 | 25 |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 | 591 |
| 589 /** | 592 /** |
| 590 * Sets the [LocalSourcePredicate]. | 593 * Sets the [LocalSourcePredicate]. |
| 591 * | 594 * |
| 592 * @param localSourcePredicate the predicate to determine is [Source] is local | 595 * @param localSourcePredicate the predicate to determine is [Source] is local |
| 593 */ | 596 */ |
| 594 void set localSourcePredicate(LocalSourcePredicate localSourcePredicate) { | 597 void set localSourcePredicate(LocalSourcePredicate localSourcePredicate) { |
| 595 this._localSourcePredicate = localSourcePredicate; | 598 this._localSourcePredicate = localSourcePredicate; |
| 596 } | 599 } |
| 597 | 600 |
| 601 /// A table mapping package names to paths of directories containing |
| 602 /// the package (or [null] if there is no registered package URI resolver). |
| 603 Map<String, List<Folder>> get packageMap { |
| 604 PackageMapUriResolver resolver = |
| 605 _resolvers.firstWhere((r) => r is PackageMapUriResolver, orElse: null); |
| 606 return resolver != null ? resolver.packageMap : null; |
| 607 } |
| 608 |
| 598 /** | 609 /** |
| 599 * Return a source object representing the given absolute URI, or `null` if th
e URI is not a | 610 * Return a source object representing the given absolute URI, or `null` if th
e URI is not a |
| 600 * valid URI or if it is not an absolute URI. | 611 * valid URI or if it is not an absolute URI. |
| 601 * | 612 * |
| 602 * @param absoluteUri the absolute URI to be resolved | 613 * @param absoluteUri the absolute URI to be resolved |
| 603 * @return a source object representing the absolute URI | 614 * @return a source object representing the absolute URI |
| 604 */ | 615 */ |
| 605 Source forUri(String absoluteUri) { | 616 Source forUri(String absoluteUri) { |
| 606 try { | 617 try { |
| 607 Uri uri = parseUriWithException(absoluteUri); | 618 Uri uri = parseUriWithException(absoluteUri); |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 | 980 |
| 970 /** | 981 /** |
| 971 * Return an absolute URI that represents the given source, or `null` if a val
id URI cannot | 982 * Return an absolute URI that represents the given source, or `null` if a val
id URI cannot |
| 972 * be computed. | 983 * be computed. |
| 973 * | 984 * |
| 974 * @param source the source to get URI for | 985 * @param source the source to get URI for |
| 975 * @return the absolute URI representing the given source | 986 * @return the absolute URI representing the given source |
| 976 */ | 987 */ |
| 977 Uri restoreAbsolute(Source source) => null; | 988 Uri restoreAbsolute(Source source) => null; |
| 978 } | 989 } |
| OLD | NEW |