diff options
| author | David Czihak <git@dcz.at> | 2026-05-07 18:12:39 +0200 |
|---|---|---|
| committer | David Czihak <git@dcz.at> | 2026-05-07 18:12:39 +0200 |
| commit | 384a44bd1189119326350996fcdff1cf4394a8cd (patch) | |
| tree | 489490657c3741396a47f8560f38114c5148e638 /Scripts/main.js | |
| parent | ae2337094ff86c544b1f8b45dca072a4d57957ab (diff) | |
Feat: Add LLDB log creation setting, improve logs
Diffstat (limited to 'Scripts/main.js')
| -rw-r--r-- | Scripts/main.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Scripts/main.js b/Scripts/main.js index 1058dfe..d9aac14 100644 --- a/Scripts/main.js +++ b/Scripts/main.js @@ -12,6 +12,7 @@ const CONFIG_KEYS = { zlsEnabled: `${EXTENSION_ID}.zls.enabled`, zlsBuildOnSave: `${EXTENSION_ID}.zls.build-on-save`, zlsDebug: `${EXTENSION_ID}.zls.debug`, + lldbDapDebug: `${EXTENSION_ID}.debug-adapter.debug`, }; let languageServer = null; @@ -264,7 +265,7 @@ function lldbDapProxyPath() { } function debugAdapterLogPath() { - return "/tmp/zig-lldb-dap-proxy.log"; + return nova.path.join(nova.extension.globalStoragePath, "lldb-dap-proxy.log"); } function issueNormalizerScriptPath() { @@ -806,12 +807,24 @@ class ZigTaskAssistant { const action = new TaskDebugAdapterAction("zig-lldb-dap"); action.transport = "stdio"; action.command = "/usr/bin/perl"; - action.args = [lldbDapProxyPath(), lldbDapPath, debugAdapterLogPath()]; + const debugLog = getBooleanConfigValue(CONFIG_KEYS.lldbDapDebug, false); + let logPath; + if (debugLog) { + try { + const p = debugAdapterLogPath(); + const dir = nova.path.dirname(p); + if (!nova.fs.stat(dir)) nova.fs.mkdir(dir); + logPath = p; + } catch (_) {} + } + action.args = logPath + ? [lldbDapProxyPath(), lldbDapPath, logPath] + : [lldbDapProxyPath(), lldbDapPath]; action.debugRequest = "launch"; action.env = { DYLD_FRAMEWORK_PATH: lldbFrameworkPaths().join(":"), NOVA_ZIG_LLDB_DAP_PATH: lldbDapPath, - NOVA_ZIG_DEBUG_LOG: debugAdapterLogPath(), + ...(logPath ? { NOVA_ZIG_DEBUG_LOG: logPath } : {}), }; action.debugArgs = { program: programPath, |
