Skip to content

Commit

Permalink
bugfix: don't rename package when it did not change (#6115)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek authored Feb 14, 2024
1 parent fc87799 commit c133c94
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class PackageProvider(
oldPackagesParts.dropRight(1) == expectedOldPackageParts

optObj match {
case None if oldPackagesMatchOldPath =>
case None if oldPackagesMatchOldPath && !oldPackagesMatchNewPath =>
calcPackageEdit(pkgs, newPackageParts, oldPath)
case Some(obj) if oldPackagesMatchOldPath =>
for {
Expand All @@ -209,9 +209,12 @@ class PackageProvider(
lastPart,
obj.name.pos.toLsp,
)
} yield List(edits, objectEdit).mergeChanges
} yield {
if (oldPackagesParts == newPackageParts.dropRight(1)) objectEdit
else List(edits, objectEdit).mergeChanges
}
case Some(_)
if !oldPackagesMatchNewPath && oldPackagesWithoutObjectMatchOldPath =>
if !oldPackagesMatchNewPath && oldPackagesWithoutObjectMatchOldPath && !oldPackagesMatchNewPath =>
calcPackageEdit(pkgs, newPackageParts, oldPath)
case _ => None
}
Expand Down

0 comments on commit c133c94

Please sign in to comment.