Skip to content

Commit

Permalink
[2021.1 compat] Compatibility fixes to testing classes
Browse files Browse the repository at this point in the history
* Remove call to not needed `Extensions.registerAreaClass` API after it was removed in [this commit](JetBrains/intellij-community@cc31a97#diff-5b5191d65df57cc34c25265d1be88fc3daedb8529c3b9c462d29312fd8360941)
* Use `ExtensionsArea.registerExtensionPoint(extensionPointName, extensionPointBeanClass, kind)` API that is available for all supported IDE versions after `ExtensionsArea.registerExtensionPoint(extensionPointName, extensionPointBeanClass)` was removed in [this commit](JetBrains/intellij-community@cc31a97#diff-f6d29de2def2588a09dcabf39c8ff1022dd787537bc5f0ed8124e9ed97610112)

PiperOrigin-RevId: 374622744
  • Loading branch information
mai93 authored and copybara-github committed May 19, 2021
1 parent 75a4121 commit 96336c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion testing/src/com/google/idea/testing/ServiceHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static <T> void registerExtensionPoint(
ExtensionPointName<T> name, Class<T> clazz, Disposable parentDisposable) {
ExtensionsArea area = Extensions.getRootArea();
String epName = name.getName();
area.registerExtensionPoint(epName, clazz.getName());
area.registerExtensionPoint(epName, clazz.getName(), ExtensionPoint.Kind.INTERFACE);
Disposer.register(parentDisposable, () -> area.unregisterExtensionPoint(epName));
}

Expand Down
2 changes: 0 additions & 2 deletions testing/src/com/google/idea/testing/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.encoding.EncodingManager;
Expand Down Expand Up @@ -150,7 +149,6 @@ static void createMockApplication(Disposable parentDisposable) {
}

static MockProject mockProject(@Nullable PicoContainer container, Disposable parentDisposable) {
Extensions.registerAreaClass("IDEA_PROJECT", null);
container = container != null ? container : new DefaultPicoContainer();
return new MockProject(container, parentDisposable);
}
Expand Down

0 comments on commit 96336c1

Please # to comment.