diff --git a/src/main/java/org/netbeans/modules/python/actions/PythonVEnvConsoleAction.java b/src/main/java/org/netbeans/modules/python/actions/PythonVEnvConsoleAction.java index 26015dc..d43d076 100644 --- a/src/main/java/org/netbeans/modules/python/actions/PythonVEnvConsoleAction.java +++ b/src/main/java/org/netbeans/modules/python/actions/PythonVEnvConsoleAction.java @@ -19,6 +19,8 @@ import org.openide.util.LookupListener; import org.openide.util.NbBundle; import org.openide.util.Utilities; +import org.openide.windows.Mode; +import org.openide.windows.WindowManager; /** * @@ -92,6 +94,12 @@ public void actionPerformed(ActionEvent ev) { PythonProject get = lkpInfo.allInstances().stream().findFirst().get(); PythonVEnvConsoleActionTopComponent pythonVEnvConsoleActionTopComponent = new PythonVEnvConsoleActionTopComponent(get, "venv"); + for (Mode mode : WindowManager.getDefault().getModes()) { + if (mode.getName().equals("output") && mode.canDock(pythonVEnvConsoleActionTopComponent)) { + mode.dockInto(pythonVEnvConsoleActionTopComponent); + break; + } + } pythonVEnvConsoleActionTopComponent.open(); pythonVEnvConsoleActionTopComponent.requestActive(); } diff --git a/src/main/java/org/netbeans/modules/python/options/PythonLspServerConfigsPanel.java b/src/main/java/org/netbeans/modules/python/options/PythonLspServerConfigsPanel.java index f13b74e..9a77cf9 100644 --- a/src/main/java/org/netbeans/modules/python/options/PythonLspServerConfigsPanel.java +++ b/src/main/java/org/netbeans/modules/python/options/PythonLspServerConfigsPanel.java @@ -42,7 +42,7 @@ final class PythonLspServerConfigsPanel extends javax.swing.JPanel { public static String[] PACKAGES = { "pylsp", - "pyls-isort", + "python-lsp-isort", "pylsp-mypy", "pylsp-rope", "black", diff --git a/src/main/java/org/netbeans/modules/python/packagemanager/PythonPackageManagerTopComponent.java b/src/main/java/org/netbeans/modules/python/packagemanager/PythonPackageManagerTopComponent.java index 541a082..f1af6fc 100644 --- a/src/main/java/org/netbeans/modules/python/packagemanager/PythonPackageManagerTopComponent.java +++ b/src/main/java/org/netbeans/modules/python/packagemanager/PythonPackageManagerTopComponent.java @@ -243,9 +243,21 @@ private void installButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN switch (text) { case "Install": RP.post(() -> { - PythonUtility.processExecutor(new String[]{pyPath, "-m", "pip", - "install", name + "==" + versionsComboBox.getSelectedItem() - .toString()}, "Installing Package " + name); + PythonUtility.processExecutor( + new String[]{ + pyPath, + "-m", + "pip", + "install", + String.format( + "%s%s", + name, + versionsComboBox.getSelectedItem() != null + ? "==" + versionsComboBox.getSelectedItem().toString() + : "") + }, + "Installing Package " + name + ); PythonPackagesModel.loadInstalled(pyPath); }); break; diff --git a/src/main/java/org/netbeans/modules/python/testrunner/PythonTestResultsTopComponent.java b/src/main/java/org/netbeans/modules/python/testrunner/PythonTestResultsTopComponent.java index 2d6d618..a316dcf 100644 --- a/src/main/java/org/netbeans/modules/python/testrunner/PythonTestResultsTopComponent.java +++ b/src/main/java/org/netbeans/modules/python/testrunner/PythonTestResultsTopComponent.java @@ -17,10 +17,7 @@ import org.netbeans.api.editor.EditorRegistry; import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; -import org.netbeans.api.settings.ConvertAsProperties; import org.netbeans.modules.editor.NbEditorUtilities; -import org.openide.awt.ActionID; -import org.openide.awt.ActionReference; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.util.Exceptions; @@ -31,16 +28,16 @@ /** * Top component which displays something. */ -@ConvertAsProperties(dtd = "-//org.netbeans.modules.python.testrunner//PythonTestResults//EN", autostore = false) -@TopComponent.Description(preferredID = "PythonTestResultsTopComponent", iconBase = "org/netbeans/modules/python/pytest.png", persistenceType = TopComponent.PERSISTENCE_ALWAYS) -@TopComponent.Registration(mode = "output", openAtStartup = false) -@ActionID(category = "Window", id = "org.netbeans.modules.python.testrunner.PythonTestResultsTopComponent") -@ActionReference(path = "Menu/Window/Tools", position = 255) -@TopComponent.OpenActionRegistration(displayName = "#CTL_PythonTestResultsAction", preferredID = "PythonTestResultsTopComponent") +//@ConvertAsProperties(dtd = "-//org.netbeans.modules.python.testrunner//PythonTestResults//EN", autostore = false) +//@TopComponent.Description(preferredID = "PythonTestResultsTopComponent", iconBase = "org/netbeans/modules/python/pytest.png", persistenceType = TopComponent.PERSISTENCE_ALWAYS) +//@TopComponent.Registration(mode = "output", openAtStartup = false) +//@ActionID(category = "Window", id = "org.netbeans.modules.python.testrunner.PythonTestResultsTopComponent") +//@ActionReference(path = "Menu/Window/Tools", position = 255) +//@TopComponent.OpenActionRegistration(displayName = "#CTL_PythonTestResultsAction", preferredID = "PythonTestResultsTopComponent") @Messages({ - "CTL_PythonTestResultsAction=PyTest Results", - "CTL_PythonTestResultsTopComponent=PyTest Results Window", - "HINT_PythonTestResultsTopComponent=This is a PyTest Results window" + "CTL_PythonTestResultsAction=PyTest Results", + "CTL_PythonTestResultsTopComponent=PyTest Results Window", + "HINT_PythonTestResultsTopComponent=This is a PyTest Results window" }) public final class PythonTestResultsTopComponent extends TopComponent { @@ -91,7 +88,7 @@ public void componentOpened() { .getProjectDirectory()).toPath()) .map(Path::toFile) .filter(file -> file.getName() - .equals("report.html")) + .equals("report.html")) .collect(Collectors.toList()); collect.sort(LastModifiedFileComparator.LASTMODIFIED_REVERSE); if (!collect.isEmpty()) {