Filtering out content under exclude roots in custom language plugin

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?

2 comments
Comment actions Permalink

Yes, there is an API that looks exactly like that: ProjectFileIndex.SERVICE.getInstance(project).isExcluded(VirtuaFile)

0
Comment actions Permalink

Not sure how I missed that!  Thanks so much!

0

Please sign in to leave a comment.