From 3110d1283e247d6d41a01a4500c113ec226ec774 Mon Sep 17 00:00:00 2001 From: intellij-powershell automation Date: Thu, 14 Nov 2024 00:59:43 +0000 Subject: [PATCH 1/3] Dependencies: update IntelliJ-based IDE versions --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f0969280..eb35ffa0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] -intellij = "2024.2" -intellijPreview = "2024.2.4" +intellij = "2024.3" +intellijPreview = "2024.3" junixsocket = "2.10.1" lsp4j = "0.23.1" From 778018e7ced1e0729a0a832d5af21f9ed91cae3c Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sun, 17 Nov 2024 23:22:30 +0100 Subject: [PATCH 2/3] Build: get rid of deprecated API calls, minor cleanup --- .../ide/run/PowerShellRunSettingsEditor.java | 15 ++++++++------- .../lang/lsp/ide/settings/FormUIUtil.kt | 3 --- .../PowerShellExecutableChooserPanel.java | 4 +--- .../ide/settings/PowerShellJPanelComponent.java | 1 - .../ide/debugger/PowerShellDebugSession.kt | 5 ++--- .../debugger/PowerShellDebuggerVariableValue.kt | 2 +- .../ide/debugger/PowerShellStackFrame.kt | 2 +- .../ide/debugger/PowershellDebuggerEvaluator.kt | 2 +- .../ide/run/PowerShellProgramDebugRunner.kt | 2 +- .../EditorServicesLanguageHostStarter.kt | 2 +- .../lsp/languagehost/LanguageServerEndpoint.kt | 2 +- .../lsp/languagehost/TextDocumentServiceQueue.kt | 2 +- .../resources/messages/MessagesBundle.properties | 4 ---- .../powershell/lang/PSLanguageHostUtilsTests.kt | 2 +- 14 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/intellij/plugin/powershell/ide/run/PowerShellRunSettingsEditor.java b/src/main/java/com/intellij/plugin/powershell/ide/run/PowerShellRunSettingsEditor.java index 71f204e9..0bb85412 100644 --- a/src/main/java/com/intellij/plugin/powershell/ide/run/PowerShellRunSettingsEditor.java +++ b/src/main/java/com/intellij/plugin/powershell/ide/run/PowerShellRunSettingsEditor.java @@ -3,15 +3,14 @@ import com.intellij.execution.configuration.EnvironmentVariablesData; import com.intellij.execution.configuration.EnvironmentVariablesTextFieldWithBrowseButton; import com.intellij.ide.macro.MacrosDialog; -import com.intellij.ide.util.BrowseFilesListener; import com.intellij.openapi.fileChooser.FileChooserDescriptor; +import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory; import com.intellij.openapi.fileChooser.FileChooserFactory; import com.intellij.openapi.options.SettingsEditor; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.TextComponentAccessor; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.plugin.powershell.ide.MessagesBundle; import com.intellij.plugin.powershell.lang.lsp.ide.settings.PowerShellExecutableChooserPanel; import com.intellij.ui.components.fields.ExtendableTextField; import org.jetbrains.annotations.NotNull; @@ -39,7 +38,7 @@ public PowerShellRunSettingsEditor(Project project, PowerShellRunConfiguration r this.runConfiguration = runConfiguration; FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false); - scriptTextField.addBrowseFolderListener("Chose Script", "Please choose script to run", project, descriptor); + scriptTextField.addBrowseFolderListener(project, descriptor); var textChangeListener = new DocumentListener() { @Override @@ -118,14 +117,16 @@ private void createUIComponents() { workingDirectoryTextField = new ExtendableTextField(); workingDirectoryTextFieldWithBrowseBtn = new TextFieldWithBrowseButton(workingDirectoryTextField); workingDirectoryTextFieldWithBrowseBtn.addBrowseFolderListener( - MessagesBundle.message("run-configuration-editor.choose-directory.title"), - null, runConfiguration.getProject(), - BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, + FileChooserDescriptorFactory.createSingleFolderDescriptor(), TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT ); JTextField textField = workingDirectoryTextFieldWithBrowseBtn.getChildComponent(); - FileChooserFactory.getInstance().installFileCompletion(textField, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, true, null); + FileChooserFactory.getInstance().installFileCompletion( + textField, + FileChooserDescriptorFactory.createSingleFolderDescriptor(), + true, + null); MacrosDialog.addMacroSupport(workingDirectoryTextField, MacrosDialog.Filters.ALL, () -> false); psExecutableChooserComponent = new PowerShellExecutableChooserPanel(runConfiguration.getExecutablePath()); } diff --git a/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/FormUIUtil.kt b/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/FormUIUtil.kt index 1de99b87..df77941b 100644 --- a/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/FormUIUtil.kt +++ b/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/FormUIUtil.kt @@ -59,7 +59,6 @@ object FormUIUtil { @JvmStatic fun createTextFieldWithBrowseButton( - description: String, field: JBTextField?, fileChooserDescriptor: FileChooserDescriptor ): TextFieldWithBrowseButton { @@ -68,8 +67,6 @@ object FormUIUtil { val textField = textFieldWithBrowseButton.childComponent textField.setDisabledTextColor(UIUtil.getLabelDisabledForeground()) textFieldWithBrowseButton.addBrowseFolderListener( - description, - null, null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT diff --git a/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellExecutableChooserPanel.java b/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellExecutableChooserPanel.java index 96caf29a..6d4532cc 100644 --- a/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellExecutableChooserPanel.java +++ b/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellExecutableChooserPanel.java @@ -47,9 +47,7 @@ public void changedUpdate(DocumentEvent e) { } }); FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false); - psExecutablePathTextFieldChooser = FormUIUtil.createTextFieldWithBrowseButton( - MessagesBundle.message("powershell.executable.path.dialog.text"), - textField, fileChooserDescriptor); + psExecutablePathTextFieldChooser = FormUIUtil.createTextFieldWithBrowseButton(textField, fileChooserDescriptor); } private void updatePowerShellVersionLabel(@NotNull String powerShellExePath) { diff --git a/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellJPanelComponent.java b/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellJPanelComponent.java index a2357bab..29cd5f68 100644 --- a/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellJPanelComponent.java +++ b/src/main/java/com/intellij/plugin/powershell/lang/lsp/ide/settings/PowerShellJPanelComponent.java @@ -149,7 +149,6 @@ private void createUIComponents() { myPathToPSExtensionLabel = new JBLabel(MessagesBundle.message("powershell.extension.path.form.label")); myPathToPSExtDirjTextField = new JBTextField(0); myPSExtensionPathTextField = FormUIUtil.createTextFieldWithBrowseButton( - MessagesBundle.message("powershell.editor.services.path.dialog.text"), myPathToPSExtDirjTextField, new FileChooserDescriptor(false, true, false, false, false, false) { @Override diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebugSession.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebugSession.kt index 76639514..3a1d50a6 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebugSession.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebugSession.kt @@ -2,10 +2,8 @@ package com.intellij.plugin.powershell.ide.debugger import com.intellij.openapi.application.EDT import com.intellij.openapi.diagnostic.logger -import com.intellij.openapi.diagnostic.thisLogger import com.intellij.plugin.powershell.ide.MessagesBundle import com.intellij.plugin.powershell.lang.debugger.PSDebugClient -import com.intellij.util.io.await import com.intellij.util.text.nullize import com.intellij.xdebugger.XDebugSession import com.intellij.xdebugger.breakpoints.XBreakpointProperties @@ -16,6 +14,7 @@ import com.jetbrains.rd.util.threading.coroutines.adviseSuspend import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.future.await import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock @@ -29,7 +28,7 @@ class PowerShellDebugSession( val coroutineScope: CoroutineScope ) { - public val sendKeyPress = Signal() + val sendKeyPress = Signal() private val breakpointMap = mutableMapOf>>>() private val breakpointsMapMutex = Mutex() diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebuggerVariableValue.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebuggerVariableValue.kt index e164c956..3d7522fc 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebuggerVariableValue.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellDebuggerVariableValue.kt @@ -2,11 +2,11 @@ package com.intellij.plugin.powershell.ide.debugger import com.intellij.icons.AllIcons import com.intellij.openapi.diagnostic.logger -import com.intellij.util.io.await import com.intellij.xdebugger.XDebugSession import com.intellij.xdebugger.XExpression import com.intellij.xdebugger.frame.* import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.future.await import kotlinx.coroutines.launch import org.eclipse.lsp4j.debug.SetVariableArguments import org.eclipse.lsp4j.debug.Variable diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellStackFrame.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellStackFrame.kt index c6d0b780..6f75a370 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellStackFrame.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowerShellStackFrame.kt @@ -3,7 +3,6 @@ package com.intellij.plugin.powershell.ide.debugger import com.intellij.openapi.vfs.VfsUtil import com.intellij.ui.ColoredTextContainer import com.intellij.ui.SimpleTextAttributes -import com.intellij.util.io.await import com.intellij.xdebugger.XDebugSession import com.intellij.xdebugger.XDebuggerUtil import com.intellij.xdebugger.XSourcePosition @@ -12,6 +11,7 @@ import com.intellij.xdebugger.frame.XCompositeNode import com.intellij.xdebugger.frame.XStackFrame import com.intellij.xdebugger.frame.XValueChildrenList import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.future.await import kotlinx.coroutines.launch import org.eclipse.lsp4j.debug.ScopesArguments import org.eclipse.lsp4j.debug.StackFrame diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowershellDebuggerEvaluator.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowershellDebuggerEvaluator.kt index e38288e0..547818f8 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowershellDebuggerEvaluator.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/debugger/PowershellDebuggerEvaluator.kt @@ -1,9 +1,9 @@ package com.intellij.plugin.powershell.ide.debugger -import com.intellij.util.io.await import com.intellij.xdebugger.XSourcePosition import com.intellij.xdebugger.evaluation.XDebuggerEvaluator import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.future.await import kotlinx.coroutines.launch import org.eclipse.lsp4j.debug.EvaluateArguments import org.eclipse.lsp4j.debug.Variable diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellProgramDebugRunner.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellProgramDebugRunner.kt index 7d707425..041e5a3f 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellProgramDebugRunner.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellProgramDebugRunner.kt @@ -26,7 +26,6 @@ import com.intellij.plugin.powershell.ide.debugger.PowerShellDebugSession import com.intellij.plugin.powershell.lang.debugger.PSDebugClient import com.intellij.terminal.TerminalExecutionConsole import com.intellij.util.execution.ParametersListUtil -import com.intellij.util.io.await import com.intellij.xdebugger.* import com.intellij.xdebugger.breakpoints.XLineBreakpoint import com.jetbrains.rd.util.lifetime.Lifetime @@ -34,6 +33,7 @@ import com.jetbrains.rd.util.threading.coroutines.adviseSuspend import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.async +import kotlinx.coroutines.future.await import kotlinx.coroutines.withContext import org.eclipse.lsp4j.debug.* import org.eclipse.lsp4j.debug.launch.DSPLauncher diff --git a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt index 422a9d12..8fedb760 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/EditorServicesLanguageHostStarter.kt @@ -29,12 +29,12 @@ import com.intellij.plugin.powershell.lang.lsp.languagehost.PSLanguageHostUtils. import com.intellij.util.application import com.intellij.util.execution.ParametersListUtil import com.intellij.util.io.BaseOutputReader -import com.intellij.util.io.await import com.sun.jna.Pointer import com.sun.jna.platform.win32.Kernel32 import com.sun.jna.platform.win32.WinNT import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay +import kotlinx.coroutines.future.await import kotlinx.coroutines.withContext import org.newsclub.net.unix.AFUNIXSocket import org.newsclub.net.unix.AFUNIXSocketAddress diff --git a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt index 0bb8e15d..7c75dcb8 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt @@ -31,8 +31,8 @@ import com.intellij.plugin.powershell.lang.lsp.ide.listeners.SelectionListenerIm import com.intellij.plugin.powershell.lang.lsp.ide.settings.PowerShellConfigurable import com.intellij.plugin.powershell.lang.lsp.util.getTextEditor import com.intellij.plugin.powershell.lang.lsp.util.isRemotePath -import com.intellij.util.io.await import kotlinx.coroutines.* +import kotlinx.coroutines.future.await import org.eclipse.lsp4j.* import org.eclipse.lsp4j.jsonrpc.messages.Either import org.eclipse.lsp4j.launch.LSPLauncher diff --git a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/TextDocumentServiceQueue.kt b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/TextDocumentServiceQueue.kt index d7f0d0d1..9855c748 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/TextDocumentServiceQueue.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/TextDocumentServiceQueue.kt @@ -2,8 +2,8 @@ package com.intellij.plugin.powershell.lang.lsp.languagehost import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.diagnostic.trace -import com.intellij.util.io.await import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.future.await import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext diff --git a/src/main/resources/messages/MessagesBundle.properties b/src/main/resources/messages/MessagesBundle.properties index 6ab741f7..c52288d5 100644 --- a/src/main/resources/messages/MessagesBundle.properties +++ b/src/main/resources/messages/MessagesBundle.properties @@ -6,8 +6,6 @@ powershell-console.launching=Launching PowerShell Terminal Console powershell.download.link=https://github.com/powershell/powershell#get-powershell powershell.editor.services.download.link=https://github.com/PowerShell/PowerShellEditorServices/releases -powershell.editor.services.path.dialog.text=Select folder -powershell.executable.path.dialog.text=Select PowerShell executable powershell.extension.path.form.description=Here you can specify the path to PowerShellEditorServices package. powershell.extension.path.form.label=PowerShell Editor Services: powershell.not.installed.install.action=Download @@ -21,8 +19,6 @@ powershell.vs.code.extension.not.installed.title=PowerShell extension is not ins ps.editor.services.detected.version.label=Version: -run-configuration-editor.choose-directory.title=Choose Directory - settings.errors.executable-not-found=PowerShell executable "{0}" could not be found. settings.powershell.lsp.is.enabled.box.text=Integrate Editor with PowerShell EditorServices host settings.powershell=PowerShell diff --git a/src/test/kotlin/com/intellij/plugin/powershell/lang/PSLanguageHostUtilsTests.kt b/src/test/kotlin/com/intellij/plugin/powershell/lang/PSLanguageHostUtilsTests.kt index 1be9d9e5..33761881 100644 --- a/src/test/kotlin/com/intellij/plugin/powershell/lang/PSLanguageHostUtilsTests.kt +++ b/src/test/kotlin/com/intellij/plugin/powershell/lang/PSLanguageHostUtilsTests.kt @@ -6,7 +6,7 @@ import com.intellij.plugin.powershell.isOnCiServer import com.intellij.plugin.powershell.lang.lsp.languagehost.PSLanguageHostUtils import com.intellij.plugin.powershell.lang.lsp.languagehost.PowerShellEdition import com.intellij.testFramework.fixtures.BasePlatformTestCase -import com.intellij.util.io.await +import kotlinx.coroutines.future.await import kotlinx.coroutines.runBlocking import java.nio.file.Path import kotlin.io.path.pathString From 52798996bb623b96bcd2e84106fffb03c0f3c6ff Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sun, 17 Nov 2024 23:35:24 +0100 Subject: [PATCH 3/3] Build: get rid of the internal API calls --- .../plugin/powershell/ide/LoggerEx.kt | 18 +++++++++++++ .../run/PowerShellScriptCommandLineState.kt | 26 +------------------ .../lang/lsp/ide/EditorEventManager.kt | 2 +- .../languagehost/LanguageServerEndpoint.kt | 2 +- 4 files changed, 21 insertions(+), 27 deletions(-) create mode 100644 src/main/kotlin/com/intellij/plugin/powershell/ide/LoggerEx.kt diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/LoggerEx.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/LoggerEx.kt new file mode 100644 index 00000000..9ad54a81 --- /dev/null +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/LoggerEx.kt @@ -0,0 +1,18 @@ +package com.intellij.plugin.powershell.ide + +import com.intellij.openapi.diagnostic.Logger +import kotlin.coroutines.cancellation.CancellationException + +/** + * See [IJPL-171743](https://youtrack.jetbrains.com/issue/IJPL-171743) for details: IntelliJ has a similar function, but + * it's marked as internal. + */ +inline fun Logger.runAndLogException(action: () -> T): T? { + try { + return action() + } catch (t: Throwable) { + if (t is CancellationException) throw t + error(t) + return null + } +} diff --git a/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellScriptCommandLineState.kt b/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellScriptCommandLineState.kt index 17bbdc5a..828a671d 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellScriptCommandLineState.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/ide/run/PowerShellScriptCommandLineState.kt @@ -4,11 +4,8 @@ import com.intellij.execution.DefaultExecutionResult import com.intellij.execution.ExecutionException import com.intellij.execution.ExecutionResult import com.intellij.execution.Executor -import com.intellij.execution.configurations.GeneralCommandLine import com.intellij.execution.configurations.PtyCommandLine import com.intellij.execution.configurations.RunProfileState -import com.intellij.execution.executors.DefaultDebugExecutor -import com.intellij.execution.executors.DefaultRunExecutor import com.intellij.execution.process.KillableProcessHandler import com.intellij.execution.process.ProcessHandler import com.intellij.execution.runners.ExecutionEnvironment @@ -16,43 +13,24 @@ import com.intellij.execution.runners.ProgramRunner import com.intellij.execution.util.ProgramParametersUtil import com.intellij.openapi.application.readAction import com.intellij.openapi.diagnostic.logger -import com.intellij.openapi.diagnostic.runAndLogException import com.intellij.openapi.options.advanced.AdvancedSettings -import com.intellij.openapi.project.Project import com.intellij.openapi.roots.ProjectRootManager import com.intellij.openapi.util.io.NioFiles.toPath import com.intellij.openapi.util.text.StringUtil import com.intellij.openapi.vfs.LocalFileSystem -import com.intellij.openapi.vfs.VfsUtil -import com.intellij.plugin.powershell.ide.PluginProjectRoot -import com.intellij.plugin.powershell.ide.debugger.PowerShellBreakpointType -import com.intellij.plugin.powershell.ide.debugger.PowerShellDebugSession -import com.intellij.plugin.powershell.lang.debugger.PSDebugClient +import com.intellij.plugin.powershell.ide.runAndLogException import com.intellij.plugin.powershell.lang.lsp.LSPInitMain -import com.intellij.plugin.powershell.lang.lsp.languagehost.EditorServicesLanguageHostStarter import com.intellij.plugin.powershell.lang.lsp.languagehost.PowerShellNotInstalled import com.intellij.terminal.TerminalExecutionConsole -import com.intellij.util.io.await import com.intellij.util.text.nullize -import com.intellij.xdebugger.XDebugSession -import com.intellij.xdebugger.XDebuggerManager import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext -import org.eclipse.lsp4j.debug.* -import org.eclipse.lsp4j.debug.launch.DSPLauncher -import org.eclipse.lsp4j.debug.services.IDebugProtocolServer -import org.eclipse.lsp4j.jsonrpc.Launcher import org.jetbrains.annotations.TestOnly import java.io.File -import java.io.InputStream -import java.io.OutputStream import java.nio.charset.Charset import java.nio.file.Path -import java.util.concurrent.TimeUnit import java.util.regex.Pattern - class PowerShellScriptCommandLineState( val runConfiguration: PowerShellRunConfiguration, private val environment: ExecutionEnvironment @@ -134,8 +112,6 @@ class PowerShellScriptCommandLineState( } } - - private fun getTerminalCharSet(): Charset { val name = AdvancedSettings.getString("terminal.character.encoding") return logger.runAndLogException { charset(name) } ?: Charsets.UTF_8 diff --git a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/ide/EditorEventManager.kt b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/ide/EditorEventManager.kt index be252067..106ecca9 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/ide/EditorEventManager.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/ide/EditorEventManager.kt @@ -6,13 +6,13 @@ package com.intellij.plugin.powershell.lang.lsp.ide import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.diagnostic.logger -import com.intellij.openapi.diagnostic.runAndLogException import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.event.DocumentEvent import com.intellij.openapi.project.Project import com.intellij.openapi.util.Key import com.intellij.openapi.util.removeUserData import com.intellij.openapi.util.text.StringUtil +import com.intellij.plugin.powershell.ide.runAndLogException import com.intellij.plugin.powershell.lang.PowerShellLanguage import com.intellij.plugin.powershell.lang.lsp.ide.listeners.DocumentListenerImpl import com.intellij.plugin.powershell.lang.lsp.ide.listeners.EditorMouseListenerImpl diff --git a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt index 7c75dcb8..d93bebc1 100644 --- a/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt +++ b/src/main/kotlin/com/intellij/plugin/powershell/lang/lsp/languagehost/LanguageServerEndpoint.kt @@ -7,7 +7,6 @@ import com.intellij.ide.actions.ShowSettingsUtilImpl import com.intellij.notification.* import com.intellij.openapi.Disposable import com.intellij.openapi.diagnostic.logger -import com.intellij.openapi.diagnostic.runAndLogException import com.intellij.openapi.editor.Editor import com.intellij.openapi.fileEditor.FileDocumentManager import com.intellij.openapi.project.Project @@ -20,6 +19,7 @@ import com.intellij.openapi.vfs.newvfs.events.VFileEvent import com.intellij.plugin.powershell.PowerShellIcons import com.intellij.plugin.powershell.ide.MessagesBundle import com.intellij.plugin.powershell.ide.PluginProjectRoot +import com.intellij.plugin.powershell.ide.runAndLogException import com.intellij.plugin.powershell.lang.lsp.client.PSLanguageClientImpl import com.intellij.plugin.powershell.lang.lsp.ide.DEFAULT_DID_CHANGE_CONFIGURATION_PARAMS import com.intellij.plugin.powershell.lang.lsp.ide.EditorEventManager