Mark directory as excluded from BulkFileListener

Answered

I want to mark certain directories as excluded from BulkFileListener, I attempted to use `ModuleRootModificationUtil.updateExcludedFolders();` but I'm not sure how to determine the module and content root of the files.

2 comments
Comment actions Permalink

Module: Module module = ModuleUtilCore.findModuleForFile(virtualFile, project);
Content Root: ProjectRootManager.getInstance(module.getProject()).getFileIndex().getContentRootForFile(virtualFile)

Ref https://jetbrains.org/intellij/sdk/docs/reference_guide/project_model/module.html

0
Comment actions Permalink

Thanks for the response. I think I considered something along those lines but got stuck because I couldn't determine the project that the file belongs to. 

0

Please sign in to leave a comment.