Skip to content

Commit

Permalink
remove paid / deprecated extensions from public repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed Jun 4, 2022
1 parent 9b05fc2 commit d85378e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,10 @@ public static void visitRenderTemplateFunctions(@NotNull PsiElement context, @No
private static class TemplateRenderPsiRecursiveElementWalkingVisitor extends PsiRecursiveElementWalkingVisitor {
private final PsiElement context;
private final Consumer<Triple<String, PhpNamedElement, FunctionReference>> consumer;
private Set<String> methods;

TemplateRenderPsiRecursiveElementWalkingVisitor(PsiElement context, Consumer<Triple<String, PhpNamedElement, FunctionReference>> consumer) {
this.context = context;
this.consumer = consumer;
methods = null;
}

@Override
Expand Down Expand Up @@ -312,22 +310,7 @@ private void visitMethodReference(@NotNull MethodReference methodReference) {
return;
}

// init methods once per file
if(methods == null) {
methods = new HashSet<>();

PluginConfigurationExtension[] extensions = Symfony2ProjectComponent.PLUGIN_CONFIGURATION_EXTENSION.getExtensions();
if(extensions.length > 0) {
PluginConfigurationExtensionParameter pluginConfiguration = new PluginConfigurationExtensionParameter(context.getProject());
for (PluginConfigurationExtension extension : extensions) {
extension.invokePluginConfiguration(pluginConfiguration);
}

methods.addAll(pluginConfiguration.getTemplateUsageMethod());
}
}

if(!methods.contains(methodName) && !methodName.toLowerCase().contains("render")) {
if (!methodName.toLowerCase().contains("render")) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ public enum NamespaceType {
"fr.adrienbrault.idea.symfony2plugin.extension.TwigNamespaceExtension"
);

public static final ExtensionPointName<TwigFileUsage> TWIG_FILE_USAGE_EXTENSIONS = new ExtensionPointName<>(
"fr.adrienbrault.idea.symfony2plugin.extension.TwigFileUsage"
);

private static final Key<CachedValue<Map<String, Set<VirtualFile>>>> TEMPLATE_CACHE_TWIG = new Key<>("TEMPLATE_CACHE_TWIG");

private static final Key<CachedValue<Map<String, Set<VirtualFile>>>> TEMPLATE_CACHE_ALL = new Key<>("TEMPLATE_CACHE_ALL");
Expand Down Expand Up @@ -2373,14 +2369,6 @@ public static void visitTemplateIncludes(@NotNull PsiElement psiElement, @NotNul
}
}
}

for (TwigFileUsage extension : TWIG_FILE_USAGE_EXTENSIONS.getExtensions()) {
if (extension.isIncludeTemplate(psiElement)) {
for (String template : extension.getIncludeTemplate(psiElement)) {
consumer.consume(new TemplateInclude(psiElement, template, TemplateInclude.TYPE.INCLUDE));
}
}
}
}
}

Expand Down Expand Up @@ -2833,16 +2821,6 @@ public void visitElement(PsiElement element) {
}
}

for (TwigFileUsage extension : TWIG_FILE_USAGE_EXTENSIONS.getExtensions()) {
if (!extension.isExtendsTemplate(element)) {
continue;
}

for (String template : extension.getExtendsTemplate(element)) {
consumer.consume(Pair.create(TwigUtil.normalizeTemplateName(template), element));
}
}

super.visitElement(element);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ private boolean hasFileExtendsTag(@NotNull PsiElement element) {
if (child instanceof TwigExtendsTag) {
return true;
}

for (TwigFileUsage extension : TwigUtil.TWIG_FILE_USAGE_EXTENSIONS.getExtensions()) {
if (extension.isExtendsTemplate(child)) {
return true;
}
}
}

return false;
Expand Down
5 changes: 0 additions & 5 deletions src/main/resources/META-INF/pay.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<!-- All feature that are only available via valid plugin license (paid) -->
<idea-plugin url="https://www.jetbrains.com/idea">

<extensionPoints>
<extensionPoint dynamic="true" name="extension.PluginConfigurationExtension" interface="fr.adrienbrault.idea.symfony2plugin.extension.PluginConfigurationExtension"/>
<extensionPoint dynamic="true" name="extension.TwigFileUsage" interface="fr.adrienbrault.idea.symfony2plugin.extension.TwigFileUsage"/>
<extensionPoint dynamic="true" name="extension.TranslatorProvider" interface="fr.adrienbrault.idea.symfony2plugin.extension.TranslatorProvider"/>

</extensionPoints>

</idea-plugin>

0 comments on commit d85378e

Please sign in to comment.