How to determine module relative path of a VirtualFile Dan Cioca Created February 25, 2008 08:13 I need to display the relative path of a virtual file. e.g. \[Module content root]\scripts\test.sqlCould theoretically parse the VirtualFile.getPath() value, still, how do i get hold of the content roots of a module?
Module module = ModuleUtil.findModuleForPsiElement(psiFile);
ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
VirtualFile[] contentRoots = rootManager.getContentRoots();