1 // 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.
2 package com.jetbrains.python;
4 import com.intellij.openapi.Disposable;
5 import com.intellij.openapi.application.ApplicationManager;
6 import com.intellij.openapi.components.Service;
7 import com.intellij.openapi.project.Project;
8 import org.jetbrains.annotations.NotNull;
11 * The service is intended to be used instead of a project/application as a parent disposable.
14 public final class PythonPluginDisposable implements Disposable {
15 public static @NotNull Disposable getInstance() {
16 return ApplicationManager.getApplication().getService(PythonPluginDisposable.class);
19 public static @NotNull Disposable getInstance(@NotNull Project project) {
20 return project.getService(PythonPluginDisposable.class);
24 public void dispose() {