From 495a6855a484297726b13f10a6fc4347fa4f4786 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 30 Apr 2020 21:58:27 +0200 Subject: [PATCH] review follow-up: deprecate CompilerManager.addCompilableFileType();, introduce CompilableFileTypesProvider EP (IDEA-CR-62197) GitOrigin-RevId: 529066d6c5ca6e796b71e23c71fe404f9c9e2de7 --- .../compiler/CompilerConfigurationImpl.java | 57 +++++-------------- .../compiler/CompilerManagerImpl.java | 29 ++++++++-- .../impl/javaCompiler/BackendCompiler.java | 4 +- .../javaCompiler/eclipse/EclipseCompiler.java | 4 +- .../javaCompiler/javac/JavacCompiler.java | 4 +- .../compiler/CompilableFileTypesProvider.java | 12 ++++ .../openapi/compiler/CompilerManager.java | 7 ++- java/java-impl/src/META-INF/JavaPlugin.xml | 1 + plugins/groovy/src/META-INF/plugin.xml | 2 +- .../compiler/GreclipseIdeaCompiler.java | 4 +- .../GroovyCompilableFileTypesProvider.java | 17 ++++++ .../groovy/compiler/GroovyCompilerLoader.java | 16 ------ .../ui-designer/resources/META-INF/plugin.xml | 2 +- .../uiDesigner/make/FormTypeRegistrar.java | 15 ++--- 14 files changed, 92 insertions(+), 82 deletions(-) create mode 100644 java/compiler/openapi/src/com/intellij/openapi/compiler/CompilableFileTypesProvider.java create mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilableFileTypesProvider.java delete mode 100644 plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java index 988585e6d767..7d9c7518bf0c 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java @@ -9,7 +9,6 @@ import com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler; import com.intellij.compiler.server.BuildManager; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationNamesInfo; -import com.intellij.openapi.compiler.CompilerManager; import com.intellij.openapi.compiler.JavaCompilerBundle; import com.intellij.openapi.compiler.options.ExcludeEntryDescription; import com.intellij.openapi.compiler.options.ExcludedEntriesConfiguration; @@ -19,7 +18,6 @@ import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.ModuleListener; @@ -86,7 +84,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements private final ExcludedEntriesConfiguration myExcludesConfiguration; private volatile Collection myRegisteredCompilers = Collections.emptyList(); - private JavacCompiler JAVAC_EXTERNAL_BACKEND; + private final JavacCompiler JAVAC_EXTERNAL_BACKEND; private final Perl5Matcher myPatternMatcher = new Perl5Matcher(); { @@ -107,6 +105,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements public CompilerConfigurationImpl(@NotNull Project project) { myProject = project; myExcludesConfiguration = createExcludedEntriesConfiguration(project); + JAVAC_EXTERNAL_BACKEND = new JavacCompiler(myProject); MessageBusConnection connection = project.getMessageBus().connect(); connection.subscribe(ProjectTopics.MODULES, new ModuleListener() { @Override @@ -128,8 +127,10 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements }); if (!project.isDefault()) { - StartupManager.getInstance(project).runAfterOpened(() -> createCompilers()); + // initial state + StartupManager.getInstance(project).runAfterOpened(() -> {myRegisteredCompilers = collectCompilers();}); } + BackendCompiler.EP_NAME.getPoint(project).addChangeListener(() -> {myRegisteredCompilers = collectCompilers();}, project); } // Overridden in Upsource @@ -423,50 +424,17 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements } public JavacCompiler getJavacCompiler() { - createCompilers(); return JAVAC_EXTERNAL_BACKEND; } - private void createCompilers() { - if (JAVAC_EXTERNAL_BACKEND != null) { - return; - } - - JAVAC_EXTERNAL_BACKEND = new JavacCompiler(myProject); - myRegisteredCompilers = collectCompilers(Collections.emptySet()); - - BackendCompiler.EP_NAME.getPoint(myProject).addChangeListener(() -> { - Collection currentCompilers = myRegisteredCompilers; - myRegisteredCompilers = collectCompilers( - currentCompilers.stream().flatMap(c -> c.getCompilableFileTypes().stream()).collect(Collectors.toSet()) - ); - }, myProject); - } - @NotNull - private List collectCompilers(Set typesBefore) { + private List collectCompilers() { final List compilers = new ArrayList<>(); compilers.add(JAVAC_EXTERNAL_BACKEND); if (EclipseCompiler.isInitialized() || ApplicationManager.getApplication().isUnitTestMode()) { compilers.add(new EclipseCompiler(myProject)); } - compilers.addAll(Arrays.asList(BackendCompiler.EP_NAME.getExtensions(myProject))); - - final Set typesToAdd = new HashSet<>(); - final Set typesToRemove = new HashSet<>(typesBefore); - for (BackendCompiler compiler : compilers) { - Set compilerTypes = compiler.getCompilableFileTypes(); - typesToAdd.addAll(compilerTypes); - typesToRemove.removeAll(compilerTypes); - } - typesToAdd.removeAll(typesBefore); - final CompilerManager compilerManager = CompilerManager.getInstance(myProject); - for (FileType type : typesToRemove) { - compilerManager.removeCompilableFileType(type); - } - for (FileType type : typesToAdd) { - compilerManager.addCompilableFileType(type); - } + compilers.addAll(BackendCompiler.EP_NAME.getExtensions(myProject)); myDefaultJavaCompiler = JAVAC_EXTERNAL_BACKEND; for (BackendCompiler compiler : compilers) { @@ -480,8 +448,11 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements } public Collection getRegisteredJavaCompilers() { - createCompilers(); - return Collections.unmodifiableCollection(myRegisteredCompilers); + Collection compilers = myRegisteredCompilers; + if (compilers.isEmpty()) { + compilers = collectCompilers(); + } + return Collections.unmodifiableCollection(compilers); } public String[] getResourceFilePatterns() { @@ -933,7 +904,9 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements } public BackendCompiler getDefaultCompiler() { - createCompilers(); + if (myRegisteredCompilers.isEmpty()) { + collectCompilers(); // this will properly initialize myDefaultJavaCompiler + } return myDefaultJavaCompiler; } diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java index 06bfc8ea1216..9e8d4de93ebe 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java @@ -2,6 +2,7 @@ package com.intellij.compiler; import com.intellij.compiler.impl.*; +import com.intellij.compiler.impl.javaCompiler.BackendCompiler; import com.intellij.compiler.server.BuildManager; import com.intellij.execution.process.ProcessIOExecutorService; import com.intellij.ide.IdeEventQueue; @@ -16,7 +17,6 @@ import com.intellij.openapi.extensions.ExtensionPointListener; import com.intellij.openapi.extensions.PluginDescriptor; import com.intellij.openapi.extensions.ProjectExtensionPointName; import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleType; import com.intellij.openapi.project.Project; @@ -58,6 +58,7 @@ import java.util.stream.Collectors; public class CompilerManagerImpl extends CompilerManager { private static final ProjectExtensionPointName COMPILER_FACTORY_EP = new ProjectExtensionPointName<>("com.intellij.compilerFactory"); private static final ProjectExtensionPointName COMPILER_TASK_EP = new ProjectExtensionPointName<>("com.intellij.compiler.task"); + private static final ProjectExtensionPointName COMPILABLE_TYPE_EP = new ProjectExtensionPointName<>("com.intellij.compilableFileTypesProvider"); private static final Logger LOG = Logger.getInstance(CompilerManagerImpl.class); @@ -69,6 +70,7 @@ public class CompilerManagerImpl extends CompilerManager { private final List myBeforeTasks = new ArrayList<>(); private final List myAfterTasks = new ArrayList<>(); private final Set myCompilableTypes = new HashSet<>(); + private volatile Set myCachedCompilableTypes = new HashSet<>(); private final CompilationStatusListener myEventPublisher; private final Semaphore myCompilationSemaphore = new Semaphore(1, true); private final Set> myValidationDisabledModuleTypes = new HashSet<>(); @@ -86,7 +88,10 @@ public class CompilerManagerImpl extends CompilerManager { myProject = project; myEventPublisher = project.getMessageBus().syncPublisher(CompilerTopics.COMPILATION_STATUS); // predefined compilers - COMPILER_FACTORY_EP.getPoint(myProject).addExtensionPointListener(new ExtensionPointListener() { + for (ProjectExtensionPointName ep : Arrays.asList(COMPILABLE_TYPE_EP, BackendCompiler.EP_NAME)) { + ep.addChangeListener(project, () -> {myCachedCompilableTypes = null;}, project); + } + COMPILER_FACTORY_EP.getPoint(project).addExtensionPointListener(new ExtensionPointListener() { @Override public void extensionAdded(@NotNull CompilerFactory factory, @NotNull PluginDescriptor pluginDescriptor) { Compiler[] compilers = factory.createCompilers(CompilerManagerImpl.this); @@ -111,9 +116,7 @@ public class CompilerManagerImpl extends CompilerManager { removeCompiler(compiler); } } - }, true, myProject); - - addCompilableFileType(StdFileTypes.JAVA); + }, true, project); final File projectGeneratedSrcRoot = CompilerPaths.getGeneratedDataDirectory(project); projectGeneratedSrcRoot.mkdirs(); @@ -221,7 +224,21 @@ public class CompilerManagerImpl extends CompilerManager { @Override public boolean isCompilableFileType(@NotNull FileType type) { - return myCompilableTypes.contains(type); + if (myCompilableTypes.contains(type)) { + return true; + } + Set types = myCachedCompilableTypes; + if (types == null) { + types = new HashSet<>(); + for (CompilableFileTypesProvider extension : COMPILABLE_TYPE_EP.getExtensions(myProject)) { + types.addAll(extension.getCompilableFileTypes()); + } + for (BackendCompiler compiler : BackendCompiler.EP_NAME.getExtensions(myProject)) { + types.addAll(compiler.getCompilableFileTypes()); + } + myCachedCompilableTypes = types; + } + return types.contains(type); } @Override diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompiler.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompiler.java index 8317ba214ea5..67730a059158 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompiler.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompiler.java @@ -1,7 +1,7 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.compiler.impl.javaCompiler; -import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.openapi.extensions.ProjectExtensionPointName; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.options.Configurable; import org.jetbrains.annotations.NotNull; @@ -10,7 +10,7 @@ import org.jetbrains.jps.model.java.compiler.CompilerOptions; import java.util.Set; public interface BackendCompiler { - ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.java.compiler"); + ProjectExtensionPointName EP_NAME = new ProjectExtensionPointName<>("com.intellij.java.compiler"); CompilerOptions EMPTY_OPTIONS = new CompilerOptions() { }; diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseCompiler.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseCompiler.java index 486ca1d9f8d9..7cd58d6b289b 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseCompiler.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseCompiler.java @@ -16,9 +16,9 @@ package com.intellij.compiler.impl.javaCompiler.eclipse; import com.intellij.compiler.impl.javaCompiler.BackendCompiler; +import com.intellij.ide.highlighter.JavaFileType; import com.intellij.openapi.compiler.JavaCompilerBundle; import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; @@ -61,7 +61,7 @@ public class EclipseCompiler implements BackendCompiler { @NotNull @Override public Set getCompilableFileTypes() { - return Collections.singleton(StdFileTypes.JAVA); + return Collections.singleton(JavaFileType.INSTANCE); } @NotNull diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacCompiler.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacCompiler.java index a6444d36a7c9..987f6b32bcc0 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacCompiler.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacCompiler.java @@ -16,9 +16,9 @@ package com.intellij.compiler.impl.javaCompiler.javac; import com.intellij.compiler.impl.javaCompiler.BackendCompiler; +import com.intellij.ide.highlighter.JavaFileType; import com.intellij.openapi.compiler.JavaCompilerBundle; import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NonNls; @@ -58,7 +58,7 @@ public class JavacCompiler implements BackendCompiler { @Override @NotNull public Set getCompilableFileTypes() { - return Collections.singleton(StdFileTypes.JAVA); + return Collections.singleton(JavaFileType.INSTANCE); } @NotNull diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilableFileTypesProvider.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilableFileTypesProvider.java new file mode 100644 index 000000000000..9fc0c3a27812 --- /dev/null +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilableFileTypesProvider.java @@ -0,0 +1,12 @@ +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.openapi.compiler; + +import com.intellij.openapi.fileTypes.FileType; +import org.jetbrains.annotations.NotNull; + +import java.util.Set; + +public interface CompilableFileTypesProvider { + @NotNull + Set getCompilableFileTypes(); +} diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerManager.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerManager.java index 614dfe082690..8d9449b72f73 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerManager.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/CompilerManager.java @@ -84,24 +84,29 @@ public abstract class CompilerManager { * Registers the type as a compilable type so that Compile action will be enabled on files of this type. * * @param type the type for which the Compile action is enabled. + * @deprecated use {@link CompilableFileTypesProvider} extension point to register compilable file types */ + @Deprecated public abstract void addCompilableFileType(@NotNull FileType type); /** * Unregisters the type as a compilable type so that Compile action will be disabled on files of this type. * * @param type the type for which the Compile action is disabled. + * @deprecated use {@link CompilableFileTypesProvider} extension point to register compilable file types */ + @Deprecated public abstract void removeCompilableFileType(@NotNull FileType type); /** * Checks if files of the specified type can be compiled by one of registered compilers. * If the compiler can process files of certain type, it should register this file type within * the CompilerManager as a compilable file type. + * Preferably register compilable file types with the CompilableFileTypesProvider extension point * * @param type the type to check. * @return true if the file type is compilable, false otherwise. - * @see com.intellij.openapi.compiler.CompilerManager#addCompilableFileType(FileType) + * @see com.intellij.openapi.compiler.CompilableFileTypesProvider#getCompilableFileTypes() */ public abstract boolean isCompilableFileType(@NotNull FileType type); diff --git a/java/java-impl/src/META-INF/JavaPlugin.xml b/java/java-impl/src/META-INF/JavaPlugin.xml index 6b17a4c61dcb..b7d32039e028 100644 --- a/java/java-impl/src/META-INF/JavaPlugin.xml +++ b/java/java-impl/src/META-INF/JavaPlugin.xml @@ -161,6 +161,7 @@ + diff --git a/plugins/groovy/src/META-INF/plugin.xml b/plugins/groovy/src/META-INF/plugin.xml index 97fbd84d889a..3c882f746c3b 100644 --- a/plugins/groovy/src/META-INF/plugin.xml +++ b/plugins/groovy/src/META-INF/plugin.xml @@ -1218,7 +1218,7 @@ - + diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompiler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompiler.java index 80302d69ffd1..81edbc24d1ee 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompiler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GreclipseIdeaCompiler.java @@ -16,8 +16,8 @@ package org.jetbrains.plugins.groovy.compiler; import com.intellij.compiler.impl.javaCompiler.BackendCompiler; +import com.intellij.ide.highlighter.JavaFileType; import com.intellij.openapi.fileTypes.FileType; -import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.project.Project; import com.intellij.util.containers.ContainerUtil; @@ -59,7 +59,7 @@ public class GreclipseIdeaCompiler implements BackendCompiler { @NotNull @Override public Set getCompilableFileTypes() { - return ContainerUtil.newTroveSet(StdFileTypes.JAVA, GroovyFileType.GROOVY_FILE_TYPE); + return ContainerUtil.newTroveSet(JavaFileType.INSTANCE, GroovyFileType.GROOVY_FILE_TYPE); } @NotNull diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilableFileTypesProvider.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilableFileTypesProvider.java new file mode 100644 index 000000000000..f7e0cf45cb9e --- /dev/null +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilableFileTypesProvider.java @@ -0,0 +1,17 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package org.jetbrains.plugins.groovy.compiler; + +import com.intellij.openapi.compiler.CompilableFileTypesProvider; +import com.intellij.openapi.fileTypes.FileType; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.plugins.groovy.GroovyFileType; + +import java.util.Collections; +import java.util.Set; + +public class GroovyCompilableFileTypesProvider implements CompilableFileTypesProvider { + @Override + public @NotNull Set getCompilableFileTypes() { + return Collections.singleton(GroovyFileType.GROOVY_FILE_TYPE); + } +} diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java deleted file mode 100644 index 240f066f1752..000000000000 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerLoader.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -package org.jetbrains.plugins.groovy.compiler; - -import com.intellij.openapi.compiler.CompilerManager; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.startup.StartupActivity; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.plugins.groovy.GroovyFileType; - -public class GroovyCompilerLoader implements StartupActivity.DumbAware { - - @Override - public void runActivity(@NotNull Project project) { - CompilerManager.getInstance(project).addCompilableFileType(GroovyFileType.GROOVY_FILE_TYPE); - } -} diff --git a/plugins/ui-designer/resources/META-INF/plugin.xml b/plugins/ui-designer/resources/META-INF/plugin.xml index cf0d83f6cbc8..345ca08a297c 100644 --- a/plugins/ui-designer/resources/META-INF/plugin.xml +++ b/plugins/ui-designer/resources/META-INF/plugin.xml @@ -118,7 +118,7 @@ - + diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/make/FormTypeRegistrar.java b/plugins/ui-designer/src/com/intellij/uiDesigner/make/FormTypeRegistrar.java index 0a89ef1def90..045c632353fe 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/make/FormTypeRegistrar.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/make/FormTypeRegistrar.java @@ -1,16 +1,17 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.uiDesigner.make; -import com.intellij.openapi.compiler.CompilerManager; -import com.intellij.openapi.fileTypes.StdFileTypes; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.startup.StartupActivity; +import com.intellij.openapi.compiler.CompilableFileTypesProvider; +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.uiDesigner.GuiFormFileType; import org.jetbrains.annotations.NotNull; -public class FormTypeRegistrar implements StartupActivity.DumbAware { +import java.util.Collections; +import java.util.Set; +public class FormTypeRegistrar implements CompilableFileTypesProvider { @Override - public void runActivity(@NotNull Project project) { - CompilerManager.getInstance(project).addCompilableFileType(StdFileTypes.GUI_DESIGNER_FORM); + public @NotNull Set getCompilableFileTypes() { + return Collections.singleton(GuiFormFileType.INSTANCE); } } \ No newline at end of file