| 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 analyzer.file_system.memory_file_system; | 5 library analyzer.file_system.memory_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:core'; | 10 import 'dart:core'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 new HashMap<String, List<StreamController<WatchEvent>>>(); | 29 new HashMap<String, List<StreamController<WatchEvent>>>(); |
| 30 int nextStamp = 0; | 30 int nextStamp = 0; |
| 31 | 31 |
| 32 final pathos.Context _pathContext; | 32 final pathos.Context _pathContext; |
| 33 | 33 |
| 34 @override | 34 @override |
| 35 final AbsolutePathContext absolutePathContext; | 35 final AbsolutePathContext absolutePathContext; |
| 36 | 36 |
| 37 MemoryResourceProvider( | 37 MemoryResourceProvider( |
| 38 {pathos.Context context, @deprecated bool isWindows: false}) | 38 {pathos.Context context, @deprecated bool isWindows: false}) |
| 39 : _pathContext = (context ??= pathos.context), | 39 : _pathContext = (context ??= pathos.style == pathos.Style.windows |
| 40 // On Windows, ensure that the current drive matches |
| 41 // the drive inserted by MemoryResourceProvider.convertPath |
| 42 // so that packages are mapped to the correct drive |
| 43 ? new pathos.Context(current: 'C:\\') |
| 44 : pathos.context), |
| 40 absolutePathContext = | 45 absolutePathContext = |
| 41 new AbsolutePathContext(context.style == pathos.Style.windows); | 46 new AbsolutePathContext(context.style == pathos.Style.windows); |
| 42 | 47 |
| 43 @override | 48 @override |
| 44 pathos.Context get pathContext => _pathContext; | 49 pathos.Context get pathContext => _pathContext; |
| 45 | 50 |
| 46 /** | 51 /** |
| 47 * Convert the given posix [path] to conform to this provider's path context. | 52 * Convert the given posix [path] to conform to this provider's path context. |
| 48 * | 53 * |
| 49 * This is a utility method for testing; paths passed in to other methods in | 54 * This is a utility method for testing; paths passed in to other methods in |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } | 580 } |
| 576 return path == other.path; | 581 return path == other.path; |
| 577 } | 582 } |
| 578 | 583 |
| 579 @override | 584 @override |
| 580 String toString() => path; | 585 String toString() => path; |
| 581 | 586 |
| 582 @override | 587 @override |
| 583 Uri toUri() => _provider.pathContext.toUri(path); | 588 Uri toUri() => _provider.pathContext.toUri(path); |
| 584 } | 589 } |
| OLD | NEW |