Customize SearchEverywhere dialog (add two new tabs for searching specific filetype)
Hi, I would like to customize the SearchEverywhere function from Intellij.
I found related API code, for example : the SearchEverywhereUI.class and FilesearchEverywhereContributor.class.
What I need is to add a new tab to the SearchEverywhereUI and call it "Functions" besides of "Symbols", it only shows functions with params for kotlin files inside of current project. And another tab called "xml" besides to "Functions", it only show xml files in this project.
After checking code, I think I need to add two new contributors (KotlinsSearchEverywhereContributor and xmlSearchEverewhereConbributor) to the SearchEverywhereContributor, but I dont have a clue how to do it?
Hope can get some detailed help here. Thanks!
Please sign in to leave a comment.
Yes, implement com.intellij.ide.actions.searcheverywhere.SearchEverywhereContributor and register it via extension point com.intellij.searchEverywhereContributor.
https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_extensions.html
Hei, Yann Cebron, thanks for your quick feedback. It works very well now.
However, I found that Symbols Search filters with Langauge, File Search filters with Filetype.
I want to mix these two features. In the Symbols search feature, I can define my Langauge and Filetype together and limit the search content.
I only found class: PersistentSearchEverywhereContributorFilter, it supports either Langauge or Filetype, not at the same time.
If this implementation is not suggested, is it possible to limit the search content under a fixed project folder by ScopeDescriptor in Class AbstractGotoSEContributor
?
Thanks again for the useful help!
Regards,
Oscar
Whether you items for full project or only specific scope is implementation-specific to your AbstractGotoSEContributor. In general, it is supposed to show "everything in Project" or alternatively "everying in project and dependencies".