godotengine / godot-vscode-plugin

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

Headless LSP can't use relative path #654

Closed RedMser closed 2 months ago

RedMser commented 2 months ago

Godot version

4.3.dev (6118592c6d)

VS Code version

1.88.1

Godot Tools VS Code extension version

2.0.0

System information

Windows 10

Issue description

I'm working with custom engine builds, and I'd like to have a consistent vscode setup that can be pushed to git.

Trying to specify the godotTools.editorPath.godot4 to a relative path of any kind seems to not work, with the error

Cannot launch headless LSP: <path> is not a valid Godot executable

Steps to reproduce

DaelonSuzuka commented 2 months ago

Add the Godot binary to your system path? I put all my Godot exes in a standard location and add that to my path, so then I can just use godot3 or godot4 or whatever.

I think the relative path issue is something to do with node child process handling and inheriting env stuff correctly. I'll try to look into that.

RedMser commented 2 months ago

Yes I could do that, but the use case is when others clone my project (which depends on a specific custom engine build). It would be convenient to include the engine directly in the workspace and not in a global location then.

Thanks for looking into it! Another thing you could try is calling path.resolve(workspaceFolder, editorPathConfigValue) if the config contains a relative path.

DaelonSuzuka commented 2 months ago

Yeah, that makes sense. Let me see what I can do.

DaelonSuzuka commented 2 months ago

@RedMser Do you mind downloading and installing the build artifact and confirming that it does what you expect now?

RedMser commented 2 months ago

@DaelonSuzuka Yep it works as expected with a relative path in my workspace's settings.json! Thanks a lot :)

(Disclaimer: I have not tested full absolute paths, or paths like godot4.exe)

Etruscian commented 4 days ago

I'm still getting the same error as described in this issue. Should I create a new issue or would you like to continue on this one?

DaelonSuzuka commented 4 days ago

This issue has been resolved in master, so there's no reason to open a new one.

Etruscian commented 4 days ago

Ah thanks. I somehow thought it was already in the release. Any eta on when it will be released?

DaelonSuzuka commented 4 days ago

I'm working on cleaning up some loose ends right now, so hopefully soon.