mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[jps model] fix loading attributes of iml root tag in the new implementation (IJPL-409)
The workspace model uses configurationStore API to load data, and there attributes of the root tag are represented as options in an artificial DeprecatedModuleOptionManager component. GitOrigin-RevId: 2a0a197e8f41c491d5b9ffd9f707a9e2315f1301
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2d8fcf9a99
commit
2e8cb4a8e1
@@ -28,7 +28,16 @@ internal class ProjectDirectJpsFileContentReader(
|
||||
if (fileUrl.endsWith(".iml")) {
|
||||
//todo support external storage
|
||||
val loader = getModuleLoader(fileUrl)
|
||||
return JDomSerializationUtil.findComponent(loader.loadRootElement(Path(JpsPathUtil.urlToPath(fileUrl))), componentName)
|
||||
val rootElement = loader.loadRootElement(Path(JpsPathUtil.urlToPath(fileUrl)))
|
||||
if (componentName == "DeprecatedModuleOptionManager") {
|
||||
//this duplicates logic from ModuleStateStorageManager.beforeElementLoaded which is used to convert attributes to data in an artificial component
|
||||
val componentTag = JDomSerializationUtil.createComponentElement(componentName)
|
||||
rootElement?.attributes?.forEach { attribute ->
|
||||
componentTag.addContent(Element("option").setAttribute("key", attribute.name).setAttribute("value", attribute.value))
|
||||
}
|
||||
return componentTag
|
||||
}
|
||||
return JDomSerializationUtil.findComponent(rootElement, componentName)
|
||||
}
|
||||
return loadProjectLevelComponent(fileUrl, componentName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user