-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
VSCode constantly freezes with Saving 'file.zig': Running 'Zig Language' Formatter
#1881
Comments
By default, the vscode-zig extension provides formatting by itself and does not rely on ZLS unless the One possible reason could be the fact that Until this has been resolved, you can switch to ZLS as the formatting provider which does not have this issue as far as I can tell. |
Lately, I've been getting this freeze almost every minute or so. I gave |
Both formatting providers behave identical. |
Sorry, I didn't really understand the answer. Isn't, say, Also, I tried to disable the formatting altogether but realized that I can't (through options) unless I disable the extension itself. Here are my options (relevant parts): "zig.formattingProvider": "off",
"zig.zls.enableBuildOnSave": false,
"editor.formatOnSave": false, Interesting to note that when it comes to formatting other files (eg. json), the Update: |
Autofix may appear as a feature build on top of formatting but they are actually independent. You can use autofix without formatting and the other way round. The
The vscode-zig extension overrides the "[zig]": {
"editor.formatOnSave": false
} |
This should have hopefully been fixed by ziglang/vscode-zig#222 which is in the vscode-zig 0.5.9 release. |
Zig Version
0.12.0
Zig Language Server Version
ZLS 0.12.0
Client / Code Editor / Extensions
Visual Studio Code-1.88.1
Steps to Reproduce and Observed Behavior
I use zls as part of the Zig extension for vscode. The problem is that zls constantly freezes when attempting to format a file before saving. It happens more frequently when there are syntax errors. Aside from that, I don't see any significant patterns. When it happens, vscode pops up a notification on the right, stating
Saving 'some_file.zig': Running 'Zig Language' Formatter
, and I am unable to save the file (other than continuing editing it). As a result, I find myself constantly pressingcmd shift p
to open the command palette and runningDeveloper: Reload Window
to forcefully "reset" the editor.I have the following configuration:
Note that there are two instances of
zig.zls.path
. This is to show that I have tried both: the zls installed by the extension itself and the one I manually installed throughbrew install zls
. Unfortunately, the problem persists regardless of which binary I use. I don't remember exactly when the problem started, but it dates back to zls versionfd9d2642e27ac65ea96fb37a27e02c9e2d269e23
, committed on Oct 22, 2023 (so no fuzz about latest 0.12.0 release, I simply tired of this problem and decided to report now). Despite trying various zig and zls updates, uninstalling and reinstalling the extension, or reopening the editor, the issue always remains.Expected Behavior
No freezing.
Relevant log output
The text was updated successfully, but these errors were encountered: