Skip to content

Commit 26b7710

Browse files
committed
support twig file bundle overwrites Haehnchen#275
1 parent 5011e29 commit 26b7710

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/fr/adrienbrault/idea/symfony2plugin/TwigHelper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ public static PsiFile[] getTemplatePsiElements(Project project, String templateN
221221
addFileInsideTwigPath(project, templatePath, psiFiles, twigPath);
222222
}
223223

224+
// Bundle overwrite:
225+
// FooBundle:index.html -> app/views/FooBundle:index.html
226+
if(twigPath.isGlobalNamespace() && !normalizedTemplateName.startsWith(":") && !normalizedTemplateName.startsWith("@")) {
227+
String templatePath = StringUtils.strip(normalizedTemplateName.replace(":", "/").replace("//", "/"), "/");
228+
addFileInsideTwigPath(project, templatePath, psiFiles, twigPath);
229+
}
230+
224231
}
225232

226233
}

0 commit comments

Comments
 (0)