Skip to content

Commit b2e74ab

Browse files
keertipCommit Queue
authored andcommitted
[Element model] Migrate edit_import_elements.dart
Change-Id: If81e7081207960b3a55bc6d6dc0b5488b50e35a5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388680 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Keerti Parthasarathy <[email protected]>
1 parent 223a2db commit b2e74ab

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-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
@@ -74,6 +74,7 @@ lib/src/handler/legacy/edit_get_fixes.dart
7474
lib/src/handler/legacy/edit_get_postfix_completion.dart
7575
lib/src/handler/legacy/edit_get_refactoring.dart
7676
lib/src/handler/legacy/edit_get_statement_completion.dart
77+
lib/src/handler/legacy/edit_import_elements.dart
7778
lib/src/handler/legacy/edit_is_postfix_completion_applicable.dart
7879
lib/src/handler/legacy/edit_list_postfix_completion_templates.dart
7980
lib/src/handler/legacy/edit_organize_directives.dart

pkg/analysis_server/lib/src/handler/legacy/edit_import_elements.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class EditImportElementsHandler extends LegacyHandler {
3434
sendResponse(Response.importElementsInvalidFile(request));
3535
return;
3636
}
37-
var libraryUnit = result.libraryElement.definingCompilationUnit;
38-
if (libraryUnit != result.unit.declaredElement) {
37+
var libraryUnit = result.libraryElement2.firstFragment;
38+
if (libraryUnit != result.libraryFragment) {
3939
// The file in the request is a part of a library. We need to pass the
4040
// defining compilation unit to the computer, not the part.
4141
result = await server.getResolvedUnit(libraryUnit.source.fullName);

0 commit comments

Comments
 (0)