Merge branch 'traff/python-psi-impl'
GitOrigin-RevId: 32ba8b691d490ddcab9eae7031f430fd203dbad7
@@ -663,11 +663,12 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/python/intellij.python.helpers.iml" filepath="$PROJECT_DIR$/python/intellij.python.helpers.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/helpers/tests/intellij.python.helpers.tests.iml" filepath="$PROJECT_DIR$/python/helpers/tests/intellij.python.helpers.tests.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/IntelliLang-python/intellij.python.langInjection.iml" filepath="$PROJECT_DIR$/python/IntelliLang-python/intellij.python.langInjection.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/psi-api/intellij.python.psi.iml" filepath="$PROJECT_DIR$/python/psi-api/intellij.python.psi.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/python-psi-api/intellij.python.psi.iml" filepath="$PROJECT_DIR$/python/python-psi-api/intellij.python.psi.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/intellij.python.pydev.iml" filepath="$PROJECT_DIR$/python/intellij.python.pydev.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/python-rest/intellij.python.reStructuredText.iml" filepath="$PROJECT_DIR$/python/python-rest/intellij.python.reStructuredText.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/python-terminal/intellij.python.terminal.iml" filepath="$PROJECT_DIR$/python/python-terminal/intellij.python.terminal.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/tools/intellij.python.tools.iml" filepath="$PROJECT_DIR$/python/tools/intellij.python.tools.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/python-psi-impl/intellij.python.psi.impl.iml" filepath="$PROJECT_DIR$/python/python-psi-impl/intellij.python.psi.impl.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/python/rest/intellij.reStructuredText.iml" filepath="$PROJECT_DIR$/python/rest/intellij.reStructuredText.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/RegExpSupport/intellij.regexp.iml" filepath="$PROJECT_DIR$/RegExpSupport/intellij.regexp.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/xml/relaxng/intellij.relaxng.iml" filepath="$PROJECT_DIR$/xml/relaxng/intellij.relaxng.iml" />
|
||||
@@ -731,4 +732,4 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/plugins/yaml/intellij.yaml.iml" filepath="$PROJECT_DIR$/plugins/yaml/intellij.yaml.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -35,6 +35,7 @@ class PyCharmCommunityProperties extends PyCharmPropertiesBase {
|
||||
"intellij.python.configure",
|
||||
"intellij.python.community",
|
||||
"intellij.python.psi",
|
||||
"intellij.python.psi.impl",
|
||||
"intellij.platform.main"
|
||||
]
|
||||
productLayout.bundledPluginModules = new File("$communityHome/python/build/plugin-list.txt").readLines()
|
||||
@@ -122,4 +123,4 @@ class PyCharmCommunityProperties extends PyCharmPropertiesBase {
|
||||
String getOutputDirectoryName(ApplicationInfoProperties applicationInfo) {
|
||||
"pycharm-ce"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,16 +44,6 @@ public final class PythonIcons {
|
||||
/** 16x16 */ public static final Icon Function = load("/icons/com/jetbrains/python/function.svg");
|
||||
/** 16x16 */ public static final Icon IpythonNotebook = load("/icons/com/jetbrains/python/IpythonNotebook.svg");
|
||||
/** 16x16 */ public static final Icon Jython = load("/icons/com/jetbrains/python/jython.svg");
|
||||
|
||||
public final static class Nodes {
|
||||
/** 16x16 */ public static final Icon Cyan_dot = load("/icons/com/jetbrains/python/nodes/cyan-dot.svg");
|
||||
/** 16x16 */ public static final Icon Lock = load("/icons/com/jetbrains/python/nodes/lock.svg");
|
||||
/** 16x16 */ public static final Icon Red_inv_triangle = load("/icons/com/jetbrains/python/nodes/red-inv-triangle.svg");
|
||||
|
||||
}
|
||||
/** 16x16 */ public static final Icon PropertyDeleter = load("/icons/com/jetbrains/python/propertyDeleter.svg");
|
||||
/** 16x16 */ public static final Icon PropertyGetter = load("/icons/com/jetbrains/python/propertyGetter.svg");
|
||||
/** 16x16 */ public static final Icon PropertySetter = load("/icons/com/jetbrains/python/propertySetter.svg");
|
||||
/** 16x16 */ public static final Icon Pypy = load("/icons/com/jetbrains/python/pypy.svg");
|
||||
/** 16x16 */ public static final Icon Python = load("/icons/com/jetbrains/python/python.svg");
|
||||
/** 16x16 */ public static final Icon PythonClosed = load("/icons/com/jetbrains/python/pythonClosed.svg");
|
||||
|
||||
@@ -29,8 +29,7 @@ import com.jetbrains.python.configuration.PyConfigureInterpretersLinkPanel;
|
||||
import com.jetbrains.python.run.AbstractPyCommonOptionsForm;
|
||||
import com.jetbrains.python.run.PyCommonOptionsFormData;
|
||||
import com.jetbrains.python.sdk.PySdkListCellRenderer;
|
||||
import com.jetbrains.python.sdk.PySdkUtil;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -74,7 +73,7 @@ public class PyIdeCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(),
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
|
||||
myPythonSdks = new ArrayList<>(PythonSdkType.getAllSdks());
|
||||
myPythonSdks = new ArrayList<>(PythonSdkUtil.getAllSdks());
|
||||
myPythonSdks.add(0, null);
|
||||
|
||||
myInterpreterComboBox.setModel(new CollectionComboBoxModel(myPythonSdks, null));
|
||||
@@ -242,7 +241,7 @@ public class PyIdeCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
|
||||
@Override
|
||||
public void setUseModuleSdk(boolean useModuleSdk) {
|
||||
myInterpreterComboBox.setSelectedItem(useModuleSdk ? null : PythonSdkType.findSdkByPath(myPythonSdks, mySelectedSdkHome));
|
||||
myInterpreterComboBox.setSelectedItem(useModuleSdk ? null : PythonSdkUtil.findSdkByPath(myPythonSdks, mySelectedSdkHome));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -310,7 +309,7 @@ public class PyIdeCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
}
|
||||
|
||||
private void updateRemoteInterpreterMode() {
|
||||
setRemoteInterpreterMode(PySdkUtil.isRemote(getSdkSelected()));
|
||||
setRemoteInterpreterMode(PythonSdkUtil.isRemote(getSdkSelected()));
|
||||
for (Consumer<Boolean> f : myRemoteInterpreterModeListeners) {
|
||||
f.accept(myInterpreterRemote);
|
||||
}
|
||||
@@ -320,13 +319,13 @@ public class PyIdeCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
private Sdk getSdkSelected() {
|
||||
String sdkHome = getSdkHome();
|
||||
if (StringUtil.isEmptyOrSpaces(sdkHome)) {
|
||||
final Sdk projectJdk = PythonSdkType.findPythonSdk(getModule());
|
||||
final Sdk projectJdk = PythonSdkUtil.findPythonSdk(getModule());
|
||||
if (projectJdk != null) {
|
||||
sdkHome = projectJdk.getHomePath();
|
||||
}
|
||||
}
|
||||
|
||||
return PythonSdkType.findSdkByPath(sdkHome);
|
||||
return PythonSdkUtil.findSdkByPath(sdkHome);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,5 +35,6 @@
|
||||
<orderEntry type="library" name="javax.annotation-api" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Groovy" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Ant" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.python.psi.impl" exported="" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -20,7 +20,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ public class PyManagePackagesAction extends AnAction {
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
Module module = e.getData(LangDataKeys.MODULE);
|
||||
final Sdk sdk = PythonSdkType.findPythonSdk(module);
|
||||
final Sdk sdk = PythonSdkUtil.findPythonSdk(module);
|
||||
if (module != null && sdk != null) {
|
||||
new PyManagePackagesDialog(module.getProject(), sdk).show();
|
||||
}
|
||||
@@ -39,6 +39,6 @@ public class PyManagePackagesAction extends AnAction {
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
Module module = e.getData(LangDataKeys.MODULE);
|
||||
e.getPresentation().setEnabled(module != null && PythonSdkType.findPythonSdk(module) != null);
|
||||
e.getPresentation().setEnabled(module != null && PythonSdkUtil.findPythonSdk(module) != null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.intellij.webcore.packaging.PackagesNotificationPanel;
|
||||
import com.jetbrains.python.packaging.ui.PyInstalledPackagesPanel;
|
||||
import com.jetbrains.python.sdk.PreferredSdkComparator;
|
||||
import com.jetbrains.python.sdk.PySdkListCellRenderer;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -31,7 +31,7 @@ public class PyManagePackagesDialog extends DialogWrapper {
|
||||
super(project, true);
|
||||
setTitle("Manage Python Packages");
|
||||
|
||||
List<Sdk> sdks = PythonSdkType.getAllSdks();
|
||||
List<Sdk> sdks = PythonSdkUtil.getAllSdks();
|
||||
Collections.sort(sdks, new PreferredSdkComparator());
|
||||
final JComboBox sdkComboBox = new JComboBox(new CollectionComboBoxModel(sdks, sdk));
|
||||
sdkComboBox.setRenderer(new PySdkListCellRenderer(null));
|
||||
|
||||
@@ -22,10 +22,7 @@ import com.intellij.ui.RawCommandLineEditor;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.PathMappingSettings;
|
||||
import com.jetbrains.python.sdk.PreferredSdkComparator;
|
||||
import com.jetbrains.python.sdk.PySdkListCellRenderer;
|
||||
import com.jetbrains.python.sdk.PySdkUtil;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.*;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -115,7 +112,7 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
for (Consumer<Boolean> f : myRemoteInterpreterModeListeners) {
|
||||
f.accept(PySdkUtil.isRemote(getSelectedSdk()));
|
||||
f.accept(PythonSdkUtil.isRemote(getSelectedSdk()));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -124,7 +121,7 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
private void updateControls() {
|
||||
myModuleComboBox.setEnabled(myUseModuleSdkRadioButton.isSelected());
|
||||
myInterpreterComboBox.setEnabled(myUseSpecifiedSdkRadioButton.isSelected());
|
||||
myPathMappingsComponent.setVisible(PySdkUtil.isRemote(getSelectedSdk()));
|
||||
myPathMappingsComponent.setVisible(PythonSdkUtil.isRemote(getSelectedSdk()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,7 +179,7 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
public void setSdkHome(String sdkHome) {
|
||||
List<Sdk> sdkList = new ArrayList<>();
|
||||
sdkList.add(null);
|
||||
final List<Sdk> allSdks = PythonSdkType.getAllSdks();
|
||||
final List<Sdk> allSdks = PythonSdkUtil.getAllSdks();
|
||||
Collections.sort(allSdks, new PreferredSdkComparator());
|
||||
Sdk selection = null;
|
||||
for (Sdk sdk : allSdks) {
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
<orderEntry type="module" module-name="intellij.java.indexing" />
|
||||
<orderEntry type="module" module-name="intellij.java.ui" />
|
||||
<orderEntry type="module" module-name="intellij.python.community.plugin" />
|
||||
<orderEntry type="module" module-name="intellij.python.psi.impl" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
|
||||
import static com.jetbrains.python.PythonModuleTypeBase.PYTHON_MODULE;
|
||||
import static com.jetbrains.python.PyNames.PYTHON_MODULE_ID;
|
||||
|
||||
/**
|
||||
* @author traff
|
||||
@@ -64,7 +64,7 @@ public class PythonFacetType extends FacetType<PythonFacet, PythonFacetType.Pyth
|
||||
|
||||
@Override
|
||||
public boolean isSuitableModuleType(ModuleType moduleType) {
|
||||
return !(moduleType.getId().equals(PYTHON_MODULE));
|
||||
return !(moduleType.getId().equals(PYTHON_MODULE_ID));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// 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 icons;
|
||||
|
||||
import com.intellij.ui.IconManager;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* NOTE THIS FILE IS AUTO-GENERATED
|
||||
* DO NOT EDIT IT BY HAND, run "Generate icon classes" configuration instead
|
||||
*/
|
||||
public final class PythonPsiApiIcons {
|
||||
private static Icon load(String path) {
|
||||
return IconManager.getInstance().getIcon(path, PythonPsiApiIcons.class);
|
||||
}
|
||||
|
||||
/** 16x16 */ public static final Icon PythonFile = load("/icons/com/jetbrains/python/pythonFile.svg");
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.NullableFunction;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.PyPsiBundle;
|
||||
import com.jetbrains.python.sdk.PythonSdkAdditionalData;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.flavors.CondaEnvSdkFlavor;
|
||||
|
||||
@@ -43,9 +43,9 @@ import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.packaging.PyPackageManagers;
|
||||
import com.jetbrains.python.packaging.ui.PyInstalledPackagesPanel;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
import com.jetbrains.python.psi.PyUtil;
|
||||
import com.jetbrains.python.sdk.*;
|
||||
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
|
||||
import com.jetbrains.python.ui.PyUiUtil;
|
||||
import one.util.streamex.StreamEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -288,7 +288,7 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
|
||||
final LanguageLevel languageLevel2 = flavor2.getLanguageLevel(prevSdk);
|
||||
if ((languageLevel1.isPy3K() && languageLevel2.isPython2()) ||
|
||||
(languageLevel1.isPython2()) && languageLevel2.isPy3K()) {
|
||||
PyUtil.rehighlightOpenEditors(myProject);
|
||||
PyUiUtil.rehighlightOpenEditors(myProject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,7 +320,7 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
|
||||
List<Object> items = new ArrayList<>();
|
||||
items.add(null);
|
||||
|
||||
final Map<PyRenderedSdkType, List<Sdk>> moduleSdksByTypes = groupModuleSdksByTypes(allPythonSdks, myModule, PythonSdkType::isInvalid);
|
||||
final Map<PyRenderedSdkType, List<Sdk>> moduleSdksByTypes = groupModuleSdksByTypes(allPythonSdks, myModule, PythonSdkUtil::isInvalid);
|
||||
if (selection != null && !StreamEx.of(moduleSdksByTypes.values()).flatCollection(Function.identity()).toList().contains(selection)) {
|
||||
items.add(0, selection);
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.jetbrains.python.psi.LanguageLevel;
|
||||
import com.jetbrains.python.sdk.PySdkUtil;
|
||||
import com.jetbrains.python.sdk.PythonSdkAdditionalData;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil;
|
||||
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -94,10 +94,10 @@ public class PyConfigurableInterpreterList {
|
||||
return -Comparing.compare(o1.getName(), o2.getName());
|
||||
}
|
||||
|
||||
final boolean isVEnv1 = PythonSdkType.isVirtualEnv(o1);
|
||||
final boolean isVEnv2 = PythonSdkType.isVirtualEnv(o2);
|
||||
final boolean isRemote1 = PySdkUtil.isRemote(o1);
|
||||
final boolean isRemote2 = PySdkUtil.isRemote(o2);
|
||||
final boolean isVEnv1 = PythonSdkUtil.isVirtualEnv(o1);
|
||||
final boolean isVEnv2 = PythonSdkUtil.isVirtualEnv(o2);
|
||||
final boolean isRemote1 = PythonSdkUtil.isRemote(o1);
|
||||
final boolean isRemote2 = PythonSdkUtil.isRemote(o2);
|
||||
|
||||
if (isVEnv1) {
|
||||
if (isVEnv2) {
|
||||
|
||||
@@ -54,7 +54,7 @@ private class PySdkStatusBar(project: Project) : EditorBasedStatusBarPopup(proje
|
||||
|
||||
module = ModuleUtil.findModuleForFile(file, project) ?: return WidgetState.HIDDEN
|
||||
|
||||
val sdk = PythonSdkType.findPythonSdk(module)
|
||||
val sdk = PythonSdkUtil.findPythonSdk(module)
|
||||
return if (sdk == null) {
|
||||
WidgetState("", noInterpreterMarker, true)
|
||||
}
|
||||
@@ -92,7 +92,7 @@ private class PySdkPopupFactory(val project: Project, val module: Module) {
|
||||
val group = DefaultActionGroup()
|
||||
|
||||
val moduleSdksByTypes = groupModuleSdksByTypes(PyConfigurableInterpreterList.getInstance(project).getAllPythonSdks(project), module) {
|
||||
PythonSdkType.isInvalid(it) ||
|
||||
PythonSdkUtil.isInvalid(it) ||
|
||||
PythonSdkType.hasInvalidRemoteCredentials(it) ||
|
||||
PythonSdkType.isIncompleteRemote(it) ||
|
||||
!LanguageLevel.SUPPORTED_LEVELS.contains(PythonSdkType.getLanguageLevelForSdk(it))
|
||||
@@ -109,7 +109,7 @@ private class PySdkPopupFactory(val project: Project, val module: Module) {
|
||||
group.add(InterpreterSettingsAction())
|
||||
group.add(AddInterpreterAction())
|
||||
|
||||
val currentSdkName = PythonSdkType.findPythonSdk(module)?.name
|
||||
val currentSdkName = PythonSdkUtil.findPythonSdk(module)?.name
|
||||
return JBPopupFactory.getInstance().createActionGroupPopup(
|
||||
"Project Interpreter",
|
||||
group,
|
||||
@@ -172,4 +172,4 @@ private fun shortenNameAndPath(sdk: Sdk) = "${name(sdk)} [${path(sdk)}]".trimMid
|
||||
private fun name(sdk: Sdk): String {
|
||||
val (_, primary, secondary) = com.jetbrains.python.sdk.name(sdk)
|
||||
return if (secondary == null) primary else "$primary [$secondary]"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public class PythonSdkDetailsDialog extends DialogWrapper {
|
||||
|
||||
private void addCreatedSdk(@Nullable final Sdk sdk, boolean newVirtualEnv) {
|
||||
if (sdk != null) {
|
||||
boolean isVirtualEnv = PythonSdkType.isVirtualEnv(sdk);
|
||||
boolean isVirtualEnv = PythonSdkUtil.isVirtualEnv(sdk);
|
||||
if (isVirtualEnv && !newVirtualEnv) {
|
||||
AddVEnvOptionsDialog dialog = new AddVEnvOptionsDialog(myMainPanel);
|
||||
dialog.show();
|
||||
@@ -442,7 +442,7 @@ public class PythonSdkDetailsDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private PythonPathEditor createPathEditor(final Sdk sdk) {
|
||||
if (PySdkUtil.isRemote(sdk)) {
|
||||
if (PythonSdkUtil.isRemote(sdk)) {
|
||||
return new PyRemotePathEditor(sdk);
|
||||
}
|
||||
else {
|
||||
@@ -502,7 +502,7 @@ public class PythonSdkDetailsDialog extends DialogWrapper {
|
||||
String[] files = PythonRemoteInterpreterManager
|
||||
.getInstance().chooseRemoteFiles(project, (PyRemoteSdkAdditionalDataBase)mySdk.getSdkAdditionalData(), false);
|
||||
|
||||
final String sourcesLocalPath = PySdkUtil.getRemoteSourcesLocalPath(mySdk.getHomePath());
|
||||
final String sourcesLocalPath = PythonSdkUtil.getRemoteSourcesLocalPath(mySdk.getHomePath());
|
||||
|
||||
VirtualFile[] vFiles = new VirtualFile[files.length];
|
||||
|
||||
|
||||
@@ -25,10 +25,7 @@ import com.jetbrains.python.newProject.PyFrameworkProjectGenerator;
|
||||
import com.jetbrains.python.newProject.PythonProjectGenerator;
|
||||
import com.jetbrains.python.packaging.PyPackage;
|
||||
import com.jetbrains.python.packaging.PyPackageUtil;
|
||||
import com.jetbrains.python.sdk.PreferredSdkComparator;
|
||||
import com.jetbrains.python.sdk.PyLazySdk;
|
||||
import com.jetbrains.python.sdk.PySdkSettings;
|
||||
import com.jetbrains.python.sdk.PythonSdkType;
|
||||
import com.jetbrains.python.sdk.*;
|
||||
import com.jetbrains.python.sdk.add.PyAddSdkGroupPanel;
|
||||
import com.jetbrains.python.sdk.add.PyAddSdkPanel;
|
||||
import one.util.streamex.StreamEx;
|
||||
@@ -190,7 +187,7 @@ public class ProjectSpecificSettingsStep<T> extends ProjectSettingsStepBase<T> i
|
||||
|
||||
// Framework package check may be heavy in case of remote sdk and should not be called on AWT, pretend everything is OK for
|
||||
// remote and check for packages later
|
||||
if (!PythonSdkType.isRemote(sdk)) {
|
||||
if (!PythonSdkUtil.isRemote(sdk)) {
|
||||
final Pair<Boolean, List<String>> validationInfo = validateFramework(frameworkGenerator, sdk);
|
||||
myInstallFramework = validationInfo.first;
|
||||
warnings.addAll(validationInfo.second);
|
||||
@@ -344,7 +341,7 @@ public class ProjectSpecificSettingsStep<T> extends ProjectSettingsStepBase<T> i
|
||||
private static List<Sdk> getValidPythonSdks() {
|
||||
return StreamEx
|
||||
.of(PyConfigurableInterpreterList.getInstance(null).getAllPythonSdks())
|
||||
.filter(sdk -> sdk != null && sdk.getSdkType() instanceof PythonSdkType && !PythonSdkType.isInvalid(sdk))
|
||||
.filter(sdk -> sdk != null && sdk.getSdkType() instanceof PythonSdkType && !PythonSdkUtil.isInvalid(sdk))
|
||||
.sorted(new PreferredSdkComparator())
|
||||
.toList();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import com.intellij.util.ui.UIUtil
|
||||
import com.jetbrains.python.Result
|
||||
import com.jetbrains.python.remote.PyProjectSynchronizer
|
||||
import com.jetbrains.python.remote.PythonRemoteInterpreterManager
|
||||
import com.jetbrains.python.sdk.PySdkUtil
|
||||
import com.jetbrains.python.sdk.PythonSdkType
|
||||
import com.jetbrains.python.sdk.PythonSdkUtil
|
||||
import com.jetbrains.python.sdk.add.PyAddSdkPanel
|
||||
import com.jetbrains.python.sdk.associatedModulePath
|
||||
import java.awt.BorderLayout
|
||||
@@ -60,7 +60,7 @@ class PyAddExistingSdkPanel(project: Project?,
|
||||
private val remotePathField = PyRemotePathField().apply {
|
||||
addActionListener {
|
||||
val currentSdk = sdk ?: return@addActionListener
|
||||
if (!PySdkUtil.isRemote(currentSdk)) return@addActionListener
|
||||
if (!PythonSdkUtil.isRemote(currentSdk)) return@addActionListener
|
||||
textField.text = currentSdk.chooseRemotePath(parent) ?: return@addActionListener
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class PyAddExistingSdkPanel(project: Project?,
|
||||
val selectedSdk = sdk
|
||||
val message = when {
|
||||
selectedSdk == null -> "No Python interpreter selected"
|
||||
PythonSdkType.isInvalid(selectedSdk) -> "Choose valid Python interpreter"
|
||||
PythonSdkUtil.isInvalid(selectedSdk) -> "Choose valid Python interpreter"
|
||||
else -> return null
|
||||
}
|
||||
return ValidationInfo(message, sdkChooserCombo)
|
||||
@@ -185,4 +185,4 @@ class PyAddExistingSdkPanel(project: Project?,
|
||||
return if (wrapper.showAndGet()) supplier.get() else null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 397 B After Width: | Height: | Size: 397 B |
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -69,6 +69,11 @@ public class PyNames {
|
||||
|
||||
public static final String TYPE_ENUM = "enum.Enum";
|
||||
|
||||
public static final String PYTHON_SDK_ID_NAME = "Python SDK";
|
||||
public static final String VERBOSE_REG_EXP_LANGUAGE_ID = "PythonVerboseRegExp";
|
||||
@NonNls public static final String PYTHON_MODULE_ID = "PYTHON_MODULE";
|
||||
public static final String TESTCASE_SETUP_NAME = "setUp";
|
||||
|
||||
private PyNames() {
|
||||
}
|
||||
|
||||