From fb4ec0a6e265fa325977c9833efc2e32cc8dd694 Mon Sep 17 00:00:00 2001 From: Daniel Espendiller Date: Mon, 1 Apr 2024 16:07:10 +0200 Subject: [PATCH] reduce noise for Twig chaining method filter completion --- .../templating/TwigTemplateCompletionContributor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/TwigTemplateCompletionContributor.java b/src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/TwigTemplateCompletionContributor.java index 028cd8d1a..10202614f 100644 --- a/src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/TwigTemplateCompletionContributor.java +++ b/src/main/java/fr/adrienbrault/idea/symfony2plugin/templating/TwigTemplateCompletionContributor.java @@ -1600,8 +1600,8 @@ public static Collection getTypesFilters(@NotNull Pr // add typed filters for (String type : twigExtension.getTypes()) { PhpClass phpClass = PhpElementsUtil.getClassInterface(project, type); - if (phpClass != null) { - for (Method method : phpClass.getMethods().stream().filter(m -> m.getAccess().isPublic() && !m.getName().startsWith("__")).toList()) { + if (phpClass != null && !PhpElementsUtil.isInstanceOf(phpClass, "\\DateTimeInterface")) { + for (Method method : phpClass.getMethods().stream().filter(m -> m.getAccess().isPublic() && !m.isAbstract() && !m.isStatic() && !m.getName().startsWith("__")).toList()) { lookupElements.add(new TwigExtensionLookupElement(project, key + "." + method.getName(), twigExtension)); } }