| Index: pkg/analyzer/lib/src/generated/bazel.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/bazel.dart b/pkg/analyzer/lib/src/generated/bazel.dart
|
| index debd30081f18494500f6e764b4e0af294db9c456..fc85e29740b4a071bc86bc2fbd85cdc2cfb77c2d 100644
|
| --- a/pkg/analyzer/lib/src/generated/bazel.dart
|
| +++ b/pkg/analyzer/lib/src/generated/bazel.dart
|
| @@ -57,13 +57,11 @@ class BazelFileUriResolver extends ResourceUriResolver {
|
| }
|
|
|
| String _getPathFromWorkspaceDir(Uri uri) {
|
| - String uriPath = uri.path;
|
| - String workspacePath = _workspaceDir.path;
|
| -
|
| - if (uriPath.startsWith(workspacePath) &&
|
| - workspacePath.length < uriPath.length) {
|
| - return uriPath.substring(workspacePath.length + 1);
|
| + try {
|
| + return provider.pathContext.relative(provider.pathContext.fromUri(uri),
|
| + from: _workspaceDir.path);
|
| + } on Exception {
|
| + return '';
|
| }
|
| - return '';
|
| }
|
| }
|
|
|