Skip to content

Commit

Permalink
Elements. Migrate lib/src/utilities/change_builder/change_builder_cor…
Browse files Browse the repository at this point in the history
…e.dart

Change-Id: Id73d6b493ad2e07d21324dbb354fe6fed758ca09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403740
Reviewed-by: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
  • Loading branch information
scheglov authored and Commit Queue committed Jan 8, 2025
1 parent 11f53fd commit 31d8adf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion pkg/analyzer_plugin/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
lib/src/utilities/change_builder/change_builder_core.dart
lib/src/utilities/change_builder/change_builder_dart.dart
lib/src/utilities/completion/completion_target.dart
lib/src/utilities/completion/element_suggestion_builder.dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,14 @@ class ChangeBuilderImpl implements ChangeBuilder {
}
var timeStamp = result.exists ? 0 : -1;

var declaredUnit = result.unit.declaredElement;
var libraryUnit = declaredUnit?.library.definingCompilationUnit;
var declaredFragment = result.unit.declaredFragment;
var firstFragment = declaredFragment?.element.firstFragment;

DartFileEditBuilderImpl? libraryEditBuilder;
if (libraryUnit != null && libraryUnit != declaredUnit) {
if (firstFragment != null && firstFragment != declaredFragment) {
// If the receiver is a part file builder, then proactively cache the
// library file builder so that imports can be finalized synchronously.
await addDartFileEdit(libraryUnit.source.fullName, (builder) {
await addDartFileEdit(firstFragment.source.fullName, (builder) {
libraryEditBuilder = builder as DartFileEditBuilderImpl;
}, createEditsForImports: createEditsForImports);
}
Expand Down

0 comments on commit 31d8adf

Please sign in to comment.