From 009c5fa5ed432c73f30849a74b3ff3c74124f521 Mon Sep 17 00:00:00 2001 From: FalsePattern Date: Thu, 30 Jan 2025 13:24:33 +0100 Subject: [PATCH] fix: zig build run debugging double run --- CHANGELOG.md | 5 +++++ .../project/execution/build/ZigExecConfigBuild.kt | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cd91514..2c532eb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ Changelog structure reference: ## [Unreleased] +### Fixed + +- Debugging + - `zig build run` would run the process twice, one without, one with debugging + ## [20.2.1] ### Fixed diff --git a/core/src/main/kotlin/com/falsepattern/zigbrains/project/execution/build/ZigExecConfigBuild.kt b/core/src/main/kotlin/com/falsepattern/zigbrains/project/execution/build/ZigExecConfigBuild.kt index f9dc825c..2d1f24f6 100644 --- a/core/src/main/kotlin/com/falsepattern/zigbrains/project/execution/build/ZigExecConfigBuild.kt +++ b/core/src/main/kotlin/com/falsepattern/zigbrains/project/execution/build/ZigExecConfigBuild.kt @@ -48,10 +48,9 @@ class ZigExecConfigBuild(project: Project, factory: ConfigurationFactory): ZigEx override suspend fun buildCommandLineArgs(debug: Boolean): List { val result = ArrayList() result.add("build") - val steps = buildSteps.args - if (debug) { + val steps = if (debug) { val truncatedSteps = ArrayList() - for (step in steps) { + for (step in buildSteps.args) { if (step == "run") continue @@ -60,7 +59,8 @@ class ZigExecConfigBuild(project: Project, factory: ConfigurationFactory): ZigEx truncatedSteps.add(step) } - } + truncatedSteps + } else buildSteps.args result.addAll(steps) result.addAll(coloredCliFlags(colored.value, debug)) result.addAll(extraArgs.args)