Skip to content

Commit 6b80ece

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate CreateFile.
Change-Id: Ia12f6d090b9895e48998da1f589eb55126e2f16c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391541 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Keerti Parthasarathy <[email protected]>
1 parent f0ca55f commit 6b80ece

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/analysis_server/analyzer_use_new_elements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ lib/src/services/correction/dart/create_class.dart
314314
lib/src/services/correction/dart/create_constructor.dart
315315
lib/src/services/correction/dart/create_constructor_for_final_fields.dart
316316
lib/src/services/correction/dart/create_field.dart
317+
lib/src/services/correction/dart/create_file.dart
317318
lib/src/services/correction/dart/create_function.dart
318319
lib/src/services/correction/dart/create_getter.dart
319320
lib/src/services/correction/dart/create_local_variable.dart

pkg/analysis_server/lib/src/services/correction/dart/create_file.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ class CreateFile extends ResolvedCorrectionProducer {
5151
if (source != null) {
5252
var pathContext = resourceProvider.pathContext;
5353
var relativePath = pathContext.relative(
54-
unitResult.libraryElement.source.fullName,
55-
from: pathContext.dirname(source.fullName));
54+
unitResult.libraryElement2.firstFragment.source.fullName,
55+
from: pathContext.dirname(source.fullName),
56+
);
5657

5758
// URIs always use forward slashes regardless of platform.
5859
var relativeUri = pathContext.split(relativePath).join('/');

0 commit comments

Comments
 (0)