Where are plugin component files saved (WIndows 10)?

Answered

I have a class that implements the ProjectComponent and PersistentStateComponent interfaces. It is annotated with @State and the name field is set. The state class is also nested in the class I am trying to persist.

The documentation states that these are in an .ipr file, but I don't see an .ipr file anywhere in the project directory. I did a search globally and nothing seems to come up either. Where on Windows 10 is this file?

Thanks!

3 comments
Comment actions Permalink

This depends on @Storage parameter in @State annotation. For Project components, you can search for it in the .idea folder. (Configuration for Application components will be stored in <IDE system folder>/config/options/....xml )

Documentation states, that for ipr projects (format used by old IDE versions) plugin doesn't have a choice (everything will be put into .ipr file),

1
Comment actions Permalink

So I did look in the .idea folder for both the plugin project, and the Android Studio project I am testing it with and there just are no .ipr files. I didn't use the storage parameter since the documentation states it is optional for project components.

I added the @Storage annotation to the project component I am persisting, and it looks like it is being added to the .idea folder for each project as an xml file (although I specified that it is stored as xml).

Thanks!

0
Comment actions Permalink

If you do not specify a storage then the IDE will save the settings in misc.xml file managed by the IDE under the .idea directory.

You should look for your state name in a tag <component name="..."> where name is your state name.

1

Please sign in to leave a comment.