godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.47k stars 148 forks source link

Need a config setting to explicitly specify project file/dir #652

Open ogapo opened 2 months ago

ogapo commented 2 months ago

Godot version

4.2.1

VS Code version

1.88.1

Godot Tools VS Code extension version

2.0.0

System information

MacOS Sonoma 14.1.1

Problem statement

Currently, if the workspace contains multiple project files GodotTools attempts to find one anywhere in the tree. If multiple project files are found it takes the one with the shortest absolute path

This is fine as a default behavior, but if you need it to pick a project that isn't the shortest path, there's no escape hatch.

Proposed solution

Add support for optional configuration string godotTools.project_path. If this is specified then get_project_dir in project_utils.ts should use this path only. If the explicitly specified project file doesn't exist, it should return undefined without searching the workspace.