| Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart
|
| diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
|
| index a6c49083fdeb69ed4bd6bf51aa7daa3fbd7d398a..cfed575fb9872503f05c0ce444b759fa6a5c8946 100644
|
| --- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart
|
| +++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart
|
| @@ -651,7 +651,13 @@ class FolderBasedDartSdk extends AbstractDartSdk {
|
| try {
|
| File file = libraryDirectory.getChildAssumingFile(library.path);
|
| if (!relativePath.isEmpty) {
|
| - file = file.parent.getChildAssumingFile(relativePath);
|
| + File relativeFile = file.parent.getChildAssumingFile(relativePath);
|
| + if (relativeFile.path == file.path) {
|
| + // The relative file is the library, so return a Source for the
|
| + // library rather than the part format.
|
| + return file.createSource(Uri.parse(library.shortName));
|
| + }
|
| + file = relativeFile;
|
| }
|
| return file.createSource(Uri.parse(dartUri));
|
| } on FormatException {
|
|
|