Skip to content

Commit 02b883b

Browse files
authored
Merge pull request #1456 from Haehnchen/feature/twig-path-bundle
Bundle is not needed for namespaces; its just removed
2 parents 6fbc4b3 + 7e5bfd6 commit 02b883b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/path/BundleTwigNamespaceExtension.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ public Collection<TwigPath> getNamespaces(@NotNull TwigNamespaceExtensionParamet
3636
String bundleName = bundle.getName();
3737

3838
twigPaths.add(new TwigPath(path, bundleName, TwigUtil.NamespaceType.BUNDLE));
39-
if(bundleName.endsWith("Bundle")) {
40-
twigPaths.add(new TwigPath(path, bundleName.substring(0, bundleName.length() - 6), TwigUtil.NamespaceType.ADD_PATH));
39+
40+
// Bundle is stripped from its name on the ending "FooBarBundle" => "FooBarBundle"
41+
if (bundleName.endsWith("Bundle")) {
42+
bundleName = bundleName.substring(0, bundleName.length() - 6);
4143
}
44+
45+
twigPaths.add(new TwigPath(path, bundleName, TwigUtil.NamespaceType.ADD_PATH));
4246
}
4347

4448
return twigPaths;

0 commit comments

Comments
 (0)