vscode-zig icon indicating copy to clipboard operation
vscode-zig copied to clipboard

no auto download option needed

Open ziyouchutuwenwu opened this issue 2 months ago • 6 comments

is there any option to disable auto download zig and zls?

new version of spmeesseman.vscode-taskexplorer will always trigger this plugin to download zig and zls. when download failed, it will download again, much too boring.

but i wil have settings.json in project dir.

{
  "zig.zls.zigLibPath": "${env:HOME}/dev/ziglang/zig/lib/",
  "zig.path": "${env:HOME}/dev/ziglang/zig/zig",
  "zig.zls.path": "${env:HOME}/dev/ziglang/zls"
}

ziyouchutuwenwu avatar Nov 10 '25 13:11 ziyouchutuwenwu

Specifying zig.path should already disable any downloads. Are you sure those are and that there are no other errors? Do the downloads still happen if you disable the other extension and open a Zig file?

Vexu avatar Nov 10 '25 15:11 Vexu

currently, not for zig project, it's behavior is very strange.

i use these to manage tasks. either of them will trigger the issue.

  • spmeesseman.vscode-taskexplorer
  • isopodlabs.taskviewer

steps:

  1. create python project
uv init demo
  1. open it with vscode.
Image

For the global zig path setting, these two not working.

 "zig.zls.zigLibPath": "",
  "zig.zls.path": ""

and for this path "zig.path": "", after saving the global settings.json, 'zig.path' will be removed. i tried many times.

https://github.com/user-attachments/assets/184fb219-f7ae-4256-9265-b352bff9b837

For zig projects, it works fine.

$ tree -la
.
├── build.zig
├── build.zig.zon
├── src
│   ├── main.zig
│   └── root.zig
└── .vscode
    ├── launch.json
    ├── settings.json
    └── tasks.json

3 directories, 7 files

mmc at manjaro in ~/projects/zig/demo 
$ cat .vscode/settings.json 
{
  "zig.zls.zigLibPath": "${env:HOME}/dev/ziglang/zig/lib/",
  "zig.path": "${env:HOME}/dev/ziglang/zig/zig",
  "zig.zls.path": "${env:HOME}/dev/ziglang/zls"
}

ziyouchutuwenwu avatar Nov 11 '25 00:11 ziyouchutuwenwu

blank vscode also can reproduce.

  1. open vscode
  2. ctrl + shift + p, > run task, Configure a task.

then the dialog will popup

ziyouchutuwenwu avatar Nov 11 '25 02:11 ziyouchutuwenwu

That reproduces. I don't think this is too urgent of an issue though. The extension will only try to install the latest tagged release which doesn't change too often and ZLS can be disabled separately. It also seems like you could workaround this by setting zig.path globally.

Vexu avatar Nov 11 '25 18:11 Vexu

when i set in global settings.json

   "zig.zls.path": ""
  "zig.zls.zigLibPath": "",

  // this setting will be auto removed
  "zig.path": "",

the zls dialog will always popup

ziyouchutuwenwu avatar Nov 11 '25 23:11 ziyouchutuwenwu

Setting it to an empty string is equivalent to not setting it at all. I meant you should use that path to your home directory. Same for the ZLS path, or alternatively you could set zig.zls.enabled to off.

Vexu avatar Nov 12 '25 10:11 Vexu