GDScript errors are reported in other filetypes (e.g. .rs files)
Maintainer edit: The Godot engine catches and answers language server requests on files other than gdscript. This causes it to report errors on non-GDScript files. We don't have a way to control this behavior on this plugin's end. There is a pending fix to the Godot game engine: https://github.com/godotengine/godot/pull/103186
When GDscript is running, the LSP is also active on other filetypes
Is there a config I should add to limit it to only run on GDScript files?
Steps to reproduce:
- Open a project that contains GDScript file and other files
- Open the GDScript file so that the lsp is running in the background
- Open a non-GDscript file, edit a little, and save the file
- The gdscript LSP will be active on that file
That is weird, GDScript shouldn't even be triggered in those files.
It only happens after the gdscipt lsp is running. Without opening a gdscript file first, the lsp won't be active. (I edited the initial comment adding the step to reproduce the issue)
I think this is more of a Zed bug. It shouldn't check .rs files against the GDScript LSP. The extension is configured to only work on GDScript files (and resource files, since last update)
could you run copy system specs into clipboard in the command palette inside Zed, and paste it here? I will open an issue on Zed repo.
Zed: v0.141.0 (Zed Dev 4855da53dfa62791d9dd102b9db9cf7ddb08d153) OS: Linux Wayland debian unknown Memory: 13.5 GiB Architecture: x86_64
Might be an issue with the linux port?
I have a similar issue, where the Project Diagnostics is flagging gdscript issues on the .tres files:
I'm on MacOs Sonoma 14.5, M1 Pro, latest Zed version (Zed 0.141.2 3e609e479354cfb623e001ea24a559351607076f)
Experiencing the same issue. Zed: v0.146.3 (Zed) OS: Linux Wayland arch unknown Memory: 31.3 GiB Architecture: x86_64 GPU: NVIDIA GeForce GTX 1650 SUPER || NVIDIA || 555.58.02
@coppolaemilio Do you still have this issue on tres files with the latest release of Zed? On this end, I cannot reproduce it.
I can reproduce the issue of the language server running on other programming language files, though. It happens with any programming language it seems. I'm not sure why yet, but I'll try to see if I can find out. If anyone has an idea of what could be the cause, I'm all ears. I'll look into language injections and language server settings, see if something stops the behavior.
Nope, can't reproduce it anymore. It seems fixed on my end 👍 btw, did you take over the project? @NathanLovato 👀
@coppolaemilio Yes! And the idea is to develop it a bit and then if more people start to use Zed offer to transfer it to the foundation like the emacs plugin before.
Nope, can't reproduce it anymore. It seems fixed on my end 👍 btw, did you take over the project? @NathanLovato 👀
Yeah, I threw together the extension just so I could keep working in Zed. But then people started using it and I was unable to keep up. Glad @NathanLovato reached out!
I am still having this issue (including .tres files). Linux, Zed 0.148.0
Hello, I have this issue as well, here's the language server reporting a bunch of issues on my tasks.json file:
This happens when:
- The language server is active (Godot is running)
- You save any text file in the workspace (notably when it is not a .gd file)
Zed: v0.164.2 (Zed) OS: Linux Wayland opensuse-tumbleweed 20250112 Memory: 15.5 GiB Architecture: x86_64 GPU: AMD Radeon RX 6600 (RADV NAVI23) || radv || Mesa 24.3.3
I took a look at the logs, and it seems that when saving a file, Zed sends textDocument/didSave RPC requests to every language server regardless of the file type of the file being saved, and unlike other language servers, Godot's language server will happily respond to a file it has no business analyzing as if it were a GDScript file, while other servers I looked into completely ignore such requests.
I was using Godot 4.2.2, but just checked 4.4 as well in case anything had changed, but that doesn't seem to be the case.
So, the problem doesn't seem to be the extension... Zed is sending requests it shouldn't, and Godot is returning responses it shouldn't. Should probably open an issue upstream, but I'm not even sure whether it is Zed or Godot that's most at fault, here.
I submitted a pull request fixing this into Godot Engine. Thanks @KettLovahr for the detailed response!
It seems like Zed used to not send the notification for all file types, but it was reverted in zed-industries/zed/pull/19183, so I submitted the fix into the engine.
Still a problem it seems.
I just updated the top post to briefly summarize the situation and link to the pending fix on Godot's side.
This happens to me with all no GDScript files when I do commit, I have to reload the editor for the errors to go.
Zed: v0.207.3 (Zed Preview) OS: Linux Wayland fedora 42 Memory: 15 GiB Architecture: x86_64 GPU: AMD Radeon Graphics (RADV RENOIR) || radv || Mesa 25.1.9
Yes, this is a limitation that's outside the control of this extension. See the top post and linked pull request on the engine repository for more information.
FYI https://github.com/godotengine/godot/pull/105236 also contains logic to prevent parsing everything as GDScript. If anyone here is running custom Godot builds, I'd appreciate some user testing, maybe that would help with getting a review.