mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-8427 Behave BDD support
PY-4186 Lettuce BDD tool support Initial extension point impl
This commit is contained in:
@@ -17,6 +17,7 @@ package com.jetbrains.python.packaging;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -39,6 +40,7 @@ public abstract class PyPackageManager {
|
||||
public abstract void showInstallationError(Project project, String title, String description);
|
||||
public abstract void showInstallationError(Component owner, String title, String description);
|
||||
public abstract void refresh();
|
||||
@Nullable
|
||||
public abstract PyPackage findPackage(String name) throws PyExternalProcessException;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jetbrains.python.packaging;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,10 +27,13 @@ import java.util.List;
|
||||
* @author yole
|
||||
*/
|
||||
public abstract class PyPackageManagers {
|
||||
|
||||
@NotNull
|
||||
public static PyPackageManagers getInstance() {
|
||||
return ServiceManager.getService(PyPackageManagers.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract PyPackageManager forSdk(Sdk sdk);
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ public interface PyFile extends PyElement, PsiFile, PyDocStringOwner, ScopeOwner
|
||||
|
||||
List<PyClass> getTopLevelClasses();
|
||||
|
||||
@NotNull
|
||||
List<PyFunction> getTopLevelFunctions();
|
||||
|
||||
List<PyTargetExpression> getTopLevelAttributes();
|
||||
|
||||
@@ -236,6 +236,7 @@ public class PyPsiUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static <T, U extends PsiElement> List<T> collectStubChildren(U e,
|
||||
final StubElement<U> stub, final IElementType elementType,
|
||||
final Class<T> itemClass) {
|
||||
|
||||
@@ -603,6 +603,7 @@ public class PyPackageManagerImpl extends PyPackageManager {
|
||||
return packages != null ? findPackageByName(name, packages) : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PyPackage findPackageByName(String name, List<PyPackage> packages) {
|
||||
for (PyPackage pkg : packages) {
|
||||
if (name.equalsIgnoreCase(pkg.getName())) {
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.jetbrains.python.packaging;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -29,6 +30,7 @@ import java.util.Map;
|
||||
public class PyPackageManagersImpl extends PyPackageManagers {
|
||||
private final Map<String, PyPackageManagerImpl> myInstances = new HashMap<String, PyPackageManagerImpl>();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public synchronized PyPackageManager forSdk(Sdk sdk) {
|
||||
final String name = sdk.getName();
|
||||
|
||||
@@ -419,6 +419,7 @@ public class PyFileImpl extends PsiFileBase implements PyFile, PyExpression {
|
||||
return PyPsiUtils.collectStubChildren(this, this.getStub(), PyElementTypes.CLASS_DECLARATION, PyClass.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<PyFunction> getTopLevelFunctions() {
|
||||
return PyPsiUtils.collectStubChildren(this, this.getStub(), PyElementTypes.FUNCTION_DECLARATION, PyFunction.class);
|
||||
|
||||
Reference in New Issue
Block a user