String (String directory) { VirtualFile path = LocalFileSystem.getInstance().findFileByPath(directory); if (path == null) return directory; Collection<String> knownWorkingDirs = myWorkingDirToMultiModuleMap.values(); for (String known : knownWorkingDirs) { if (FileUtil.isAncestor(known, directory, false)) { return known; } } return MavenUtil.getVFileBaseDir(path).getPath(); }