GDQuest / zed-gdscript

Zed support for the GDScript language
MIT License
38 stars 10 forks source link

Multiple Godot projects in one window #32

Open eth0net opened 3 weeks ago

eth0net commented 3 weeks ago

I'm submitting a...

Bug report

What is the current behavior?

If you open multiple Godot projects in one Zed window it uses the connected Godot instance for files from all projects, resulting in file not found errors in Godot and type not found in Zed diagnostics.

What is the expected behavior?

Ideally, Godot language server would handle this, but given that's not under your control here maybe only operate on files in the first project in the list in Zed?

Tell us the steps to reproduce the bug, and if possible share a minimal demo of the problem.

  1. Add two Godot projects to a single Zed window.
  2. Open one of them in Godot for the language server to start.
  3. Open a file from the other project in Zed.
  4. See errors reported for missing types.

Feature request

Describe the problem you're trying to solve.

I have been working on a selection of prototypes/demos in Godot and often have extra projects open for reference besides the main one I'm working on at the time, but this results in errors as detailed above.

Tell us which solutions you've explored, the solution you would pick, and why you think it would be the best for everyone.

Aside from avoiding the errors from multiple projects, it would be nice if this extension could handle multiple projects each connected to a separate running Godot instance, but I am not sure how you would go about this.

I think you'd have to detect running Godot instances and check the project paths against them, if that's even provided by the Godot LSP, to direct file diagnostic requests to the correct Godot instance or skip it if no matching instance is found.

Having the dynamic Godot instance detection could also be useful beyond this as it would allow you to run Godot on different ports without reconfiguring the plugin in Zed.

Other

Other information

I'm primarily reporting the issues I've faced with the multiple projects and don't expect multiple to be supported, but thought it would be good to document it all :) I'd love to see it at least filtering out files not a part of the main project though!