-
Notifications
You must be signed in to change notification settings - Fork 50
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
Extension inserts null bytes at end of meson.build file after saving #253
Comments
Sadly I wasn't able to reproduce this with any mesonlsp version I tested |
I'm seeing the same issue here on Windows 10 Pro. Here's the steps to reproduce:
This should cause the error to happen. |
You are both on Windows, maybe it's a windows issue. I will check it later |
Thanks @JCWasmx86 for investigating. I only work on Linux, so can't test. |
Saw the same issue, and have been for a month or so. Had to disable the meson extension because of it. Save without formatting also works, but that's a bit of a hassle. It happens every time I save any meson.build file, I end up with NUL chars inserted in my text.
|
Even on Windows I was unable to reproduce this bug:
|
Tries to fix mesonbuild/vscode-meson#253
This build could fix that: https://github.com/JCWasmx86/mesonlsp/actions/runs/10226037533 Could anybody of you please try it out, whether it really fixes the problem? |
Yes, outside of the trailing NULs at the end of the file, the formatted meson.build seems to be valid. Also, the patched build has fixed the issue for me! |
Also, if it helps at all, the NULs only appeared when the file is actually formatted, as in, a modification is made first (inserting or removing a newline, for instance). |
Great, then I will make a release tomorrow and make a PR here for a bump |
Type: Bug
I have the following simple meson.build file for a test C project. With the meson VS Code extension enabled, anytime I modify this file and save it, a handful (around 9) of null bytes are inserted at the end, causing the language server to crash and meson itself to fail to lex the file. I'm pretty new to meson so if my build file is malformed in anyway (besides the null bytes I didn't ask for), that's on me :)
Edit: If it's worth mentioning, I do have format-on-save enabled globally in VS Code, and I used the extension bisect feature to narrow it down to the Meson extension.
Edit 2: I just confirmed that it's happening when I format the document manually from the command pallet as well. So probably something to do with the language server's formatting functionality?
Extension version: 1.25.1
VS Code version: Code 1.91.1 (f1e16e1e6214d7c44d078b1f0607b2388f29d729, 2024-07-09T22:06:49.809Z)
OS version: Windows_NT x64 10.0.22631
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: