Filtering out content under exclude roots in custom language plugin Follow
Is there an easy way to make the various aspects of a custom language plugin (primarily the file-based indices) ignore files under excluded content roots? I've done this explicitly myself now by checking in the input filter against the exclude roots of all modules of all open projects, and then only if the file passes the initial filter of having a file type that I care about, but this still seems unnecessarily expensive. I do want these items excluded because otherwise I find duplicates for source files where build processes copy the files into work directories and such. I thought I'd check here and see if there's some first-class way to ask something like isExcluded(virtualFile). Thoughts?
Please sign in to leave a comment.
Yes, there is an API that looks exactly like that: ProjectFileIndex.SERVICE.getInstance(project).isExcluded(VirtuaFile)
Not sure how I missed that! Thanks so much!