| 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 file_system; | 5 library file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:path/path.dart'; | 10 import 'package:path/path.dart'; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return null; | 140 return null; |
| 141 } | 141 } |
| 142 Resource resource = | 142 Resource resource = |
| 143 _provider.getResource(_provider.pathContext.fromUri(uri)); | 143 _provider.getResource(_provider.pathContext.fromUri(uri)); |
| 144 if (resource is File) { | 144 if (resource is File) { |
| 145 return resource.createSource(uri); | 145 return resource.createSource(uri); |
| 146 } | 146 } |
| 147 return null; | 147 return null; |
| 148 } | 148 } |
| 149 | 149 |
| 150 @override |
| 151 Uri restoreAbsolute(Source source) => source.uri; |
| 152 |
| 150 /** | 153 /** |
| 151 * Return `true` if the given URI is a `file` URI. | 154 * Return `true` if the given URI is a `file` URI. |
| 152 * | 155 * |
| 153 * @param uri the URI being tested | 156 * @param uri the URI being tested |
| 154 * @return `true` if the given URI is a `file` URI | 157 * @return `true` if the given URI is a `file` URI |
| 155 */ | 158 */ |
| 156 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; | 159 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; |
| 157 } | 160 } |
| OLD | NEW |