How to Add file to IDEs ignore file list through the code

I developed a plugin and there is a config file. I want to hide that file from project file structure. 

I can hide it through project setting->file types-> ignore files and folders 

I want to do through code. Is there a way to add my file to IntelliJ IDs ignore file list.

0
1 comment
Official comment

To add an ignore mask, you can use com.intellij.openapi.fileTypes.FileTypeManager#getIgnoredFilesList and com.intellij.openapi.fileTypes.FileTypeManager#setIgnoredFilesList. But this will lead to reindexing. If you want only to hide your file from Project View, a more lightweight solution would be to implement TreeStructureProvider extension and hide the corresponding tree node there.

Please sign in to leave a comment.