aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Czihak <git@dcz.at>2026-05-09 14:26:55 +0200
committerDavid Czihak <git@dcz.at>2026-05-09 14:26:55 +0200
commit9409ba9689468c8b4ea9371b22eb2ba11354b847 (patch)
tree124f6c15c7bd56dc2d24bc92c344ba98c5ba6fdd
parent4b6f66fd512c254b5a82220dc77411fe391dd258 (diff)
Fix: Add inherit option to bool workspace options
Instead of a checkbox, the boolean workspace options now show three radio buttons, adding the option to inherit the value from the global option
-rw-r--r--Scripts/main.js10
-rw-r--r--extension.json40
2 files changed, 39 insertions, 11 deletions
diff --git a/Scripts/main.js b/Scripts/main.js
index 60fd4aa..3ff3fa2 100644
--- a/Scripts/main.js
+++ b/Scripts/main.js
@@ -88,14 +88,12 @@ function getConfigValue(key) {
*/
function getBooleanConfigValue(key, fallback) {
const workspaceValue = nova.workspace.config.get(key);
- if (typeof workspaceValue === "boolean") {
- return workspaceValue;
- }
+ if (workspaceValue === "enabled") return true;
+ if (workspaceValue === "disabled") return false;
+ if (typeof workspaceValue === "boolean") return workspaceValue;
const globalValue = nova.config.get(key);
- if (typeof globalValue === "boolean") {
- return globalValue;
- }
+ if (typeof globalValue === "boolean") return globalValue;
return fallback;
}
diff --git a/extension.json b/extension.json
index 2a146da..0938ee5 100644
--- a/extension.json
+++ b/extension.json
@@ -152,19 +152,37 @@
{
"key": "at.dcz.nova-zig.zls.enabled",
"title": "Enable ZLS",
- "type": "boolean",
+ "type": "enum",
+ "default": "inherit",
+ "values": [
+ ["inherit", "Inherit from Global"],
+ ["enabled", "Enabled"],
+ ["disabled", "Disabled"]
+ ],
"description": "Enable diagnostics, completion, navigation, and other language-server features."
},
{
"key": "at.dcz.nova-zig.zls.build-on-save",
"title": "Build On Save",
- "type": "boolean",
+ "type": "enum",
+ "default": "inherit",
+ "values": [
+ ["inherit", "Inherit from Global"],
+ ["enabled", "Enabled"],
+ ["disabled", "Disabled"]
+ ],
"description": "Allow ZLS to run its build/check runner on save when the workspace is a Zig project."
},
{
"key": "at.dcz.nova-zig.zls.debug",
"title": "Debug Server Messages",
- "type": "boolean",
+ "type": "enum",
+ "default": "inherit",
+ "values": [
+ ["inherit", "Inherit from Global"],
+ ["enabled", "Enabled"],
+ ["disabled", "Disabled"]
+ ],
"description": "Log ZLS traffic to the Extension Console while developing the extension."
}
]
@@ -177,7 +195,13 @@
{
"key": "at.dcz.nova-zig.debug-adapter.debug",
"title": "Enable Proxy Log",
- "type": "boolean",
+ "type": "enum",
+ "default": "inherit",
+ "values": [
+ ["inherit", "Inherit from Global"],
+ ["enabled", "Enabled"],
+ ["disabled", "Disabled"]
+ ],
"description": "Write lldb-dap-proxy traffic to a log file in the extension's storage directory. For extension development only."
}
]
@@ -190,7 +214,13 @@
{
"key": "at.dcz.nova-zig.tasks.discover-steps",
"title": "Discover Build Steps",
- "type": "boolean",
+ "type": "enum",
+ "default": "inherit",
+ "values": [
+ ["inherit", "Inherit from Global"],
+ ["enabled", "Enabled"],
+ ["disabled", "Disabled"]
+ ],
"description": "Run `zig build --list-steps` and surface each step as a task in the task list. Disable for projects where running build.zig on activation is undesirable."
}
]