Workspace Model: Do not clear librariesToAdd after the model commit

GitOrigin-RevId: b74425097ceb90ad003cc573864cf2f4f95fe5e3
This commit is contained in:
Alex Plate
2019-12-23 10:33:50 +00:00
committed by intellij-monorepo-bot
parent 655e780578
commit 04fe911b68
@@ -313,8 +313,7 @@ class LegacyBridgeModifiableRootModel(
LegacyBridgeModuleRootComponent.getInstance(module).newModuleLibraries.clear()
LegacyBridgeModuleRootComponent.getInstance(module).newModuleLibraries.addAll(moduleLibraryTable.librariesToAdd)
moduleLibraryTable.librariesToAdd.clear()
moduleLibraryTable.librariesToRemove.clear()
// Do not clear `librariesToAdd`. Otherwise `getLibraries()` will return an empty list after the commit
dispose()
@@ -577,6 +576,7 @@ class LegacyBridgeModifiableRootModel(
}
override fun removeLibrary(library: Library) {
modifiableModel.assertModelIsLive()
library as LegacyBridgeLibrary
val moduleLibraryTableId = library.libraryId.tableId as LibraryTableId.ModuleLibraryTableId