It is possible to get config from `loadState` before running `initComponent` ?
There is a PersistentStateComponent which have a method `loadState` , and there is a `ApplicationComponent` which have a method `initComponent` , and now I want to get config from method `loadState` before run `initComponent` so that I could init my plugin depend on user's config. Is that possible? Or do we have another way to do that?
Please sign in to leave a comment.
You shouldn't perform any actions which depend on settings in 'initComponent' method, because settings may be changed after IDE is started, and in that case 'loadState' will be called again but 'initComponent' won't. So if you need to change something depending on settings you may do it directly in 'loadState' implementation.
However as I wrote in my previous comment plugins shouldn't use ApplicationComponent at all.
I tried using
RegisteredLanguages().forEach { lang -> LanguageAnnotators.INSTANCE.addExplicitExtension(lang, RainbowBrackets()) }inside the `loadState` method but... it does not work(the highlighter does not work), I don't know why
what extension you are trying to register and why for all languages?