What is this feature called? Preview the ResourceBundle property value
Answered
In my plugin source code, a ResourceBundle can be previewed:
Please tell me what is this feature called? How could I enable/disable this feature, and how could I use this feature in my plugin?
Because I write another ResourceBundle in another non-plugin project, this feature doesn't work!
Please sign in to leave a comment.
Hi,
See https://plugins.jetbrains.com/docs/intellij/additional-minor-features.html#code-folding
Thank you so much. But seems folding is not the default behavior, I wrote a ResouceBundle like this:
The method
MessageBundle.message
can be folded only if I use the collapse shortcut, by deafult it's not folded, even if I close the file and reopen it.How can I set folding as default?
And below is my setting:
I'm not sure if you try to implement this feature or just use it. If implement, see
com.intellij.lang.folding.FoldingBuilderEx#isCollapsedByDefault
.If use, please use product support forums: https://www.jetbrains.com/support/
Because IDEA remembers whether a file was folded or unfolded the last time it was opened, the
com.intellij.lang.folding.FoldingBuilderEx#isCollapsedByDefault
method only controls the default state when the file is first opened.If you want to implement the same folding state each time you open a file, you can use an event listener to detect when the file is opened. Each time the file is opened, you can retrieve and apply the specified folding state for that file.
You can refer to this:
https://github.com/xiaoyan94/Idea-Plugin-OneClickNavigation/blob/main/src/main/java/com/zhiyin/plugins/listeners/MyFileEditorManagerListener.java