Skip to content

Commit 6284108

Browse files
committed
PowerShellRunSettingsEditor: fix inspections
1 parent 3b74b51 commit 6284108

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/main/java/com/intellij/plugin/powershell/ide/run/PowerShellRunSettingsEditor.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import com.intellij.openapi.ui.TextComponentAccessor;
1212
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
1313
import com.intellij.openapi.util.text.StringUtil;
14+
import com.intellij.plugin.powershell.ide.MessagesBundle;
1415
import com.intellij.plugin.powershell.lang.lsp.ide.settings.PowerShellExecutableChooserPanel;
1516
import com.intellij.ui.components.fields.ExtendableTextField;
1617
import org.jetbrains.annotations.NotNull;
17-
import org.jetbrains.annotations.Nullable;
1818

1919
import javax.swing.*;
2020
import java.io.File;
@@ -95,15 +95,16 @@ protected JComponent createEditor() {
9595
return mainPanel;
9696
}
9797

98-
@Nullable
99-
public String getScriptName() {
100-
return runConfiguration.getScriptPath();
101-
}
102-
10398
private void createUIComponents() {
10499
workingDirectoryTextField = new ExtendableTextField();
105100
workingDirectoryTextFieldWithBrowseBtn = new TextFieldWithBrowseButton(workingDirectoryTextField);
106-
workingDirectoryTextFieldWithBrowseBtn.addBrowseFolderListener("Choose directory", null, runConfiguration.getProject(), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
101+
workingDirectoryTextFieldWithBrowseBtn.addBrowseFolderListener(
102+
MessagesBundle.message("run-configuration-editor.choose-directory.title"),
103+
null,
104+
runConfiguration.getProject(),
105+
BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
106+
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
107+
);
107108
JTextField textField = workingDirectoryTextFieldWithBrowseBtn.getChildComponent();
108109
FileChooserFactory.getInstance().installFileCompletion(textField, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, true, null);
109110
MacrosDialog.addMacroSupport(workingDirectoryTextField, MacrosDialog.Filters.ALL, () -> false);

src/main/resources/messages/MessagesBundle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ powershell.vs.code.extension.not.installed.title=PowerShell extension is not ins
2121

2222
ps.editor.services.detected.version.label=Version:
2323

24+
run-configuration-editor.choose-directory.title=Choose Directory
25+
2426
settings.errors.executable-not-found=PowerShell executable "{0}" could not be found.
2527
settings.powershell.lsp.is.enabled.box.text=Integrate Editor with PowerShell EditorServices host
2628
settings.powershell=PowerShell

0 commit comments

Comments
 (0)