How to check if a VirtualFile source file are from test or production dir?

Hi.

Is there an easy way to determine whether a source file was loaded from a test or production source directory when the source files are represented as VirtualFiles (as they are when one is implementing a FileProcessingCompiler)?

Kind regards
Christian

2 comments
Comment actions Permalink

Try ModuleRootManager:

0
Comment actions Permalink

Try Project[Module]RootManager.getFileIndex().isIn[Test]Source()

0

Please sign in to leave a comment.