Is SearchableOptionsContributor available now?
Answered
Hi,
I added options in the Settings, all is good except that the new options is not searchable.
It says there will be a SearchableOptionsContributor at https://intellij-support.jetbrains.com/hc/en-us/community/posts/206110459/comments/206105215, I want to know is it available now? I cannot find it.
Please sign in to leave a comment.
Probably, this one:
https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/ide/ui/search/SearchableOptionContributor.java
I wrote a while back about how I do this here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206110459-Problems-generating-searchableOptions-xml
@Colin Fleming
I cannot believe you are still here and replied my post. I did find the post you mentioned, but failed to make it work. I added it in this way,
public class VerilogCodeFoldingOptionsProvider extends BeanConfigurable<VerilogCodeFoldingSettings> implements CodeFoldingOptionsProvider {public VerilogCodeFoldingOptionsProvider() {
super(VerilogCodeFoldingSettings.getInstance());
VerilogCodeFoldingSettings settings = getInstance();
final SearchableOptionsRegistrar optionsRegistrar = SearchableOptionsRegistrar.getInstance();
optionsRegistrar.addOption("All Verilog Code", null, "All Verilog Code", "editor.preferences.folding", "Code Folding");
checkBox("<html>All Verilog Code</html>", settings::isCollapseAllVerilog, settings::setCollapseAllVerilog);
}
}
It does not work. Maybe it should be placed in initComponent or some where else. I also tried Singingbush's method, but failed either.
SearchableOptionContributor works fine now. Anyway, thank you four your advice.
@Aleksey Pivovarov,
Thank you very much, it's exactly what I want.
It is SearchableOptionContributor now, not SearchableOptionsContributor. That's why I didn't find it out before.