OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.src.generated.bazel; | 5 library analyzer.src.generated.bazel; |
6 | 6 |
7 import 'dart:core' hide Resource; | 7 import 'dart:core'; |
8 | 8 |
9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
11 import 'package:analyzer/src/generated/source_io.dart'; | 11 import 'package:analyzer/src/generated/source_io.dart'; |
12 | 12 |
13 /** | 13 /** |
14 * Instances of the class `BazelFileUriResolver` resolve `file` URI's by first | 14 * Instances of the class `BazelFileUriResolver` resolve `file` URI's by first |
15 * resolving file uri's in the expected way, and then by looking in the | 15 * resolving file uri's in the expected way, and then by looking in the |
16 * corresponding generated directories. | 16 * corresponding generated directories. |
17 */ | 17 */ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 String uriPath = uri.path; | 60 String uriPath = uri.path; |
61 String workspacePath = _workspaceDir.path; | 61 String workspacePath = _workspaceDir.path; |
62 | 62 |
63 if (uriPath.startsWith(workspacePath) && | 63 if (uriPath.startsWith(workspacePath) && |
64 workspacePath.length < uriPath.length) { | 64 workspacePath.length < uriPath.length) { |
65 return uriPath.substring(workspacePath.length + 1); | 65 return uriPath.substring(workspacePath.length + 1); |
66 } | 66 } |
67 return ''; | 67 return ''; |
68 } | 68 } |
69 } | 69 } |
OLD | NEW |