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

When GDScript LSP is active, it reports issues on other filetypes (e.g. .rs files) #6

Open
ray-pH opened this issue Jun 17, 2024 · 15 comments · May be fixed by godotengine/godot#103186
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ray-pH
Copy link

ray-pH commented Jun 17, 2024

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?

image
image

Steps to reproduce:

  1. Open a project that contains GDScript file and other files
  2. Open the GDScript file so that the lsp is running in the background
  3. Open a non-GDscript file, edit a little, and save the file
  4. The gdscript LSP will be active on that file
@grndctrl
Copy link
Contributor

That is weird, GDScript shouldn't even be triggered in those files.

@ray-pH
Copy link
Author

ray-pH commented Jun 17, 2024

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)

@grndctrl
Copy link
Contributor

grndctrl commented Jun 17, 2024

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)

@grndctrl
Copy link
Contributor

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.

@ray-pH
Copy link
Author

ray-pH commented Jun 18, 2024

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?

@coppolaemilio
Copy link

I have a similar issue, where the Project Diagnostics is flagging gdscript issues on the .tres files:
image
I'm on MacOs Sonoma 14.5, M1 Pro, latest Zed version (Zed 0.141.2 3e609e479354cfb623e001ea24a559351607076f)

@grndctrl grndctrl added the help wanted Extra attention is needed label Jul 21, 2024
@EnderMaster77
Copy link

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

@NathanLovato NathanLovato changed the title gdscript LSP active on other filetypes When GDScript LSP is active, it reports issues on other filetypes (e.g. .rs files) Aug 14, 2024
@NathanLovato NathanLovato added the bug Something isn't working label Aug 14, 2024
@NathanLovato
Copy link
Contributor

NathanLovato commented Aug 14, 2024

@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.

@coppolaemilio
Copy link

coppolaemilio commented Aug 14, 2024

Nope, can't reproduce it anymore. It seems fixed on my end 👍
btw, did you take over the project? @NathanLovato 👀

@NathanLovato
Copy link
Contributor

@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.

@grndctrl
Copy link
Contributor

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!

@fstxz
Copy link
Contributor

fstxz commented Aug 15, 2024

I am still having this issue (including .tres files). Linux, Zed 0.148.0

@KettLovahr
Copy link

KettLovahr commented Jan 17, 2025

Hello, I have this issue as well, here's the language server reporting a bunch of issues on my tasks.json file:

An image showing several gdscript related errors on a json file

This happens when:

  1. The language server is active (Godot is running)
  2. 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

@KettLovahr
Copy link

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.

@Na-r
Copy link

Na-r commented Feb 22, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants