Skip to content

Commit

Permalink
fix RIDER-99818 Rider not showing console debug info from Godot
Browse files Browse the repository at this point in the history
  • Loading branch information
van800 committed Nov 6, 2023
1 parent 480ffd6 commit 91b8df4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.intellij.execution.runners.ExecutionEnvironment
import com.intellij.execution.runners.ProgramRunner
import com.intellij.execution.ui.ConsoleView
import com.intellij.execution.ui.ConsoleViewContentType
import com.intellij.openapi.rd.createNestedDisposable
import com.intellij.openapi.util.Key
import com.jetbrains.rd.util.addUnique
import com.jetbrains.rd.util.lifetime.Lifetime
Expand All @@ -26,6 +27,7 @@ import com.jetbrains.rider.run.ExternalConsoleMediator
import com.jetbrains.rider.run.WorkerRunInfo
import com.jetbrains.rider.run.configurations.remote.RemoteConfiguration
import com.jetbrains.rider.run.createEmptyConsoleCommandLine
import com.jetbrains.rider.run.environment.ExecutableType
import com.jetbrains.rider.run.withRawParameters
import com.jetbrains.rider.util.NetUtils

Expand Down Expand Up @@ -64,7 +66,7 @@ class GodotDebugProfileState(private val exeConfiguration: GodotDebugRunConfigur
override fun execute(executor: Executor, runner: ProgramRunner<*>, workerProcessHandler: DebuggerWorkerProcessHandler, lifetime: Lifetime): ExecutionResult {
val envs = exeConfiguration.parameters.envs.toMutableMap()
envs.addUnique(lifetime, "GODOT_MONO_DEBUGGER_AGENT", "--debugger-agent=transport=dt_socket,address=127.0.0.1:${remoteConfiguration.port},server=n,suspend=y")
val runCommandLine = createEmptyConsoleCommandLine(exeConfiguration.parameters.useExternalConsole)
val runCommandLine = createEmptyConsoleCommandLine(exeConfiguration.parameters.useExternalConsole, ExecutableType.Unknown)
.withEnvironment(envs)
.withParentEnvironmentType(if (exeConfiguration.parameters.isPassParentEnvs) {
GeneralCommandLine.ParentEnvironmentType.CONSOLE
Expand Down Expand Up @@ -101,16 +103,12 @@ class GodotDebugProfileState(private val exeConfiguration: GodotDebugRunConfigur
override fun processTerminated(processEvent: ProcessEvent) {
monoConnectResult.executionConsole.tryWriteMessageToConsoleView(OutputMessageWithSubject(output = "Process \"$commandLineString\" terminated with exit code ${processEvent.exitCode}.\r\n", type = OutputType.Warning, subject = OutputSubject.Default))
}

override fun startNotified(processEvent: ProcessEvent) {
monoConnectResult.executionConsole.tryWriteMessageToConsoleView(OutputMessageWithSubject("Process \"$commandLineString\" started.\r\n", OutputType.Info, OutputSubject.Default))
}
})

targetProcessHandler.startNotify()
super.startNotified(event)
}
})
}, lifetime.createNestedDisposable())

return monoConnectResult
}
Expand Down

0 comments on commit 91b8df4

Please sign in to comment.