godotengine / godotengine/godot-vscode-plugin
Support for multi-root workspaces
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
### Godot version
4.4.1-stable
### VS Code version
1.101.1
### Godot Tools VS Code extension version
2.5.1
### System information
Fedora 41
### Problem statement
I'm developing a public Godot plugin using GDScript and gdextension, alongside a private game, with each repository being their own Godot project. I generally work in the same Godot project during a code session, but I need to be able to look at code in the other project frequently, so I use a multi-root workspace in Visual Studio Code to minimize context switching.
In version 2.4.0 of this plugin, this worked mostly fine. Once I had Godot Engine open, Godot Tools would connect to the LSP and just work with whatever Godot project I had open. However, this stopped working in 2.5.0 (I think in #816 [blame](https://github.com/godotengine/godot-vscode-plugin/blame/4bca5d71a6036fa50dc56d00360bc15551c8adc5/src/lsp/ClientConnectionManager.ts#L261)), and Godot Tools only lets me work with the first Godot project in my workspace on any later version, no matter what file I'm looking at or what the editor has open.
### Proposed solution
I haven't touched VS Code plugins before, so not sure what is optimal, but here are some ideas:
1. Detect which Godot project is currently open instead of only using the first Godot project in the workspace
- If this was an issue before that called for removal, maybe we could have a "strict" option that can be disabled to allow this
2. Allow specifying a Godot project path (see: #241)
- VS Code allows overriding settings in sub-folders, so I think this would let users specify a Godot project for the given folder
3. Detect the Godot project from the path of the currently viewed file (probably not optimal for parsing, but I don't know)
Contributor guide
Assessment
This issue has not been assessed yet.