PersistantStateComponent storage inside project root
Answered
Is it possible to, instead of saving the .xml related to the PersistantStateComponent on the plugin options folder, save it under the project root that is using the plugin? If not, is there another simple way to achieve this?
Please sign in to leave a comment.
There are two types of state - application- and project-level. The second one is stored in the project scope. Please read more in the docs: Persisting State of Components
Thank you. I did read it before coming here but I didn't really understand it. So PersistentStateComponent is for app level and PropertiesComponent for project level?
Have you read the Defining the Storage Location section?
Yes, thats how I've implemented it in the first place:
But, like this, it is stored in the options folder shared between all plugins. I couldn't figure out how to make it project dependent (a different file for each project, stored below its root)
Can you please just check
Jakub Chrzanowski when I do that, I get the following error:
Caused by: com.intellij.configurationStore.UnknownMacroException: Unknown macro: $WORKSPACE_FILE$ in storage file spec: $WORKSPACE_FILE$
Sorry for the late reply. Can you please provide some minimal reproducible project that I may verify locally?
How can I send it directly to you?
Just create some GitHub repository and add me to it directly: hsz
Jakub Chrzanowski i've already added you
I tried to run it locally, but there is plantuml library missing in the Gradle dependencies.
Probably had an old build.gradle file on the repo. Please try it again Jakub Chrzanowski
Thanks in advance for your time.