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

Renames new zig files as *.zig.z

Open linker-err0r opened this issue 11 months ago • 2 comments

Prerequisites:

  • VSCode Extension
  • ZLS Server

Reproduction Steps:

  1. Create a new file (ctrl/cmd-n).
  2. Use the save file command (ctrl/cmd-s).
  3. Use the system file dialogue to name the file "test.zig" and click "Create File" (or OS equivalent)

Expected Result: The file is saved as "test.zig"

Actual Result: Extension renames the file to "test.zig.z"

Notes: One thing that’s notable is that this only happens when the format is supposed to be inferred by the file extension (by adding .zig at the end). If I explicitly click zig in the dropdown menu it does not occur. It does not occur for non-Zig files. It does occur on every file type if I click “No Extension” in the dropdown menu.

System info: Zig 0.13 Zig Extension v0.63

VS Code Info: Version: 1.96.2 (Universal) Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f Date: 2024-12-19T10:22:47.216Z Electron: 32.2.6 ElectronBuildId: 10629634 Chromium: 128.0.6613.186 Node.js: 20.18.1 V8: 12.8.374.38-electron.0 OS: Darwin arm64 24.1.0

linker-err0r avatar Jan 03 '25 16:01 linker-err0r

One thing that’s notable is that this only happens when the format is supposed to be inferred by the file extension (by adding .zig at the end).

So this doesn't happen if you disable the extension?

I cannot reproduce this on Linux. Do you put something in the file? Do you specify the language?

Vexu avatar Jan 04 '25 09:01 Vexu

I wasn't able to reproduce this on windows either. It seems to be an issue unique to mac. I'll do some more experiments on it tomorrow to see if I can narrow down the cause.

linker-err0r avatar Jan 07 '25 01:01 linker-err0r