Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command 'Format Document With...' resulted in an error #116

Open
papidb opened this issue Jun 15, 2023 · 13 comments
Open

Command 'Format Document With...' resulted in an error #116

papidb opened this issue Jun 15, 2023 · 13 comments

Comments

@papidb
Copy link
Contributor

papidb commented Jun 15, 2023

Trying to run format document with throws this error:

image
@Vexu
Copy link
Member

Vexu commented Jun 16, 2023

Works on my machine, can you provide more info?

@papidb
Copy link
Contributor Author

papidb commented Jun 16, 2023

code --version outputs:

1.79.2
695af097c7bd098fbf017ce3ac85e09bbc5dda06
arm64

zig version is 0.10.1

which zig is /opt/homebrew/bin/zig

My vscode settings is

{
    "workbench.colorTheme": "Default Dark Modern",
    "zig.zls.path": "/Users/benjamindaniel/Library/Application Support/Code/User/globalStorage/ziglang.vscode-zig/zls_install/zls",
    "editor.accessibilitySupport": "off",
    "editor.inlineSuggest.enabled": true,
    "redhat.telemetry.enabled": true
}

I only get this error when I run format document with... command with zig

image

@Vexu
Copy link
Member

Vexu commented Jun 16, 2023

which zig is /opt/homebrew/bin/zig

Hmm, is that a symlink? This might be a duplicate of #34.

@papidb
Copy link
Contributor Author

papidb commented Jun 16, 2023

I used homebrew to install zig.

@Vexu
Copy link
Member

Vexu commented Jun 18, 2023

Does homebrew install symlinks? If yes running file /opt/homebrew/bin/zig should give a path to the link target, can you try setting that as zigPath and seeing if formatting works then?

@papidb
Copy link
Contributor Author

papidb commented Jun 18, 2023

Running file /opt/homebrew/bin/zig gives /opt/homebrew/bin/zig: Mach-O 64-bit executable arm64 so I don't think it did install symlinks.

@Vexu
Copy link
Member

Vexu commented Jun 18, 2023

And just to make sure, your zig.zigPath is set to that path? And plain format document (no with) works?

@tomwyr
Copy link

tomwyr commented Jun 19, 2023

Observing the same behavior:

  • downloaded zig (0.11.0-dev.3704+729a051e9)
  • added zig to PATH
  • point zig.zigPath to the zig binary

Format Document With... throws the Cannot read properties of undefined error.
Format Document doesn't seem to be doing anything.

@Vexu
Copy link
Member

Vexu commented Jun 19, 2023

Are you also on macos?

@papidb
Copy link
Contributor Author

papidb commented Jun 19, 2023

Trying to download zig with vscode throws the error:
image

vscode also displays the warning:
image

@Vexu
Copy link
Member

Vexu commented Jun 19, 2023

The first issue was fixed in 1b6dfd1 and the second is tracked in #86.

@tomwyr
Copy link

tomwyr commented Jun 19, 2023

@Vexu I'm on macos, yes.

@papidb
Copy link
Contributor Author

papidb commented Jun 21, 2023

@Vexu yes I am on macOS, M1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants