Project Configuration in Plugin - Settings Apply Globally, Not Per Project
已回答
Hey community, I want to build a project where the project settings differentiate. I followed the docs and try to use project settings (projectConfigurable
) inside my plugin.xml
, but I turns out, that my settings are always the same for every project. Did I misunderstand something, I thought the configuration would be unique per project? My settings are marked as project settings in the settings windows.
请先登录再写评论。
It depends on how you save your settings. You're probably using a PersistentStateComponent. Make sure the XML is actually stored in a project's .idea folder. Also make sure to autowire the project into your Configurable and use that to retrieve your config.
You can use my project https://gitlab.com/ppiag/intellij_gitlab_pipeline_monitor/-/tree/master/src/main/java/de/sist/gitlab/pipelinemonitor/config?ref_type=heads as an example, see PipelineViewerConfigApp and PipelineViewerConfigProject. I can't guarantee that it's 100% the right way to go but it works ;-)
In addition to what Simon wrote, if the problem is still not solved, please share the code of all related classes and related plugin.xml entries.