Stored properties using PropertiesComponent cannot be read in 2022.1

Answered

My plugin was persisting some data using the PropertiesComponent service, which was stored in the workspace.xml file as follows:

<component name="PropertiesComponent">
<property name="com.myplugin.platform" value="MyPlatform" />
</component>

After updating to PyCharm 2022.1, my plugin is not able to load the properties of an existing project created with an older PyCharm version. It seems the way the IDE is now reading/storing properties has changed, so the call to PropertiesComponent.getInstance(project).getValue("com.myplugin.platform") returns null. If I create a new project with PyCharm 2022.1, the same property is now stored in the workspace.xml file as follows:

<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
  "com.myplugin.platform": "MyPlatform"
  }
}]]></component>

Is there any way for the plugin running on 2022.1 to read properties using the old format?

2 comments
Comment actions Permalink

Hi Ruben,

Unfortunately, this is a bug. Please follow the issue:
https://youtrack.jetbrains.com/issue/IDEA-292538

to track the progress. Sorry for the inconvenience.

1
Comment actions Permalink

Thanks for your quick response, Karol.

Note that this also affects internal IDE properties like RunOnceActivity.OpenProjectViewOnStart or RunOnceActivity.ShowReadmeOnStart, even when my plugin is not installed. They are reset to default values when opening an existing project (created with an older PyCharm version) in 2022.1 (or vice-versa).

0

Please sign in to leave a comment.