Skip to content

Commit f686c79

Browse files
committed
🐛 Fix bugs with latest update (version 1.3)
1 parent a01d2ff commit f686c79

File tree

9 files changed

+314
-421
lines changed

9 files changed

+314
-421
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99

1010
group = "com.uriyyo.evaluate_async_code"
11-
version = "1.3"
11+
version = "1.4"
1212

1313
repositories {
1414
mavenCentral()

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version=2020.1
22
kotlinVersion=1.3.21
3-
ideaVersion=PC-2020.1
4-
pythonPlugin=PythonCore:201.6668.115
3+
ideaVersion=PC-2020.2.3
4+
pythonPlugin=PythonCore:202.7660.27
55
downloadIdeaSources=true

src/main/java/com/uriyyo/evaluate_async_code/AsyncPyDebugBundledDictionaryProvider.kt

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/main/java/com/uriyyo/evaluate_async_code/AsyncPyDebugConsoleRunnerFactory.kt

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/com/uriyyo/evaluate_async_code/AsyncPyDebugEntryPoint.kt

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
package com.uriyyo.evaluate_async_code
22

3-
import com.intellij.execution.configurations.RunProfile
4-
import com.intellij.openapi.project.Project
3+
import com.intellij.execution.ExecutionResult
4+
import com.intellij.xdebugger.XDebugSession
5+
import com.jetbrains.python.debugger.PyDebugProcess
56
import com.jetbrains.python.debugger.PyDebugRunner
6-
import com.jetbrains.python.run.CommandLinePatcher
7+
import com.jetbrains.python.debugger.PyDebugValue
78
import com.jetbrains.python.run.PythonCommandLineState
9+
import java.net.ServerSocket
810

911
class AsyncPyDebugRunner : PyDebugRunner() {
10-
companion object {
11-
init {
12-
registerPythonConsoleRunnerFactory()
12+
override fun createDebugProcess(
13+
session: XDebugSession,
14+
serverSocket: ServerSocket,
15+
result: ExecutionResult,
16+
pyState: PythonCommandLineState
17+
): PyDebugProcess {
18+
if (!isSupportedVersion(pyState.sdk?.versionString))
19+
return super.createDebugProcess(session, serverSocket, result, pyState)
20+
21+
return object : PyDebugProcess(
22+
session, serverSocket, result.executionConsole, result.processHandler, pyState.isMultiprocessDebug
23+
) {
24+
override fun evaluate(expression: String?, execute: Boolean, doTrunc: Boolean): PyDebugValue {
25+
super.evaluate(PLUGIN, true, true)
26+
return super.evaluate(expression, execute, doTrunc)
27+
}
1328
}
1429
}
1530

16-
override fun createCommandLinePatchers(
17-
project: Project?,
18-
state: PythonCommandLineState?,
19-
profile: RunProfile?,
20-
serverLocalPort: Int
21-
): Array<CommandLinePatcher> {
22-
return arrayOf(
23-
*super.createCommandLinePatchers(project, state, profile, serverLocalPort),
24-
CommandLinePatcher {
25-
if (isSupportedVersion(state?.sdk?.versionString))
26-
it.patchCommandLine("Debugger", "debug")
27-
}
28-
)
29-
}
3031
}

0 commit comments

Comments
 (0)