Editor Path belongs in user settings, not workspace
Godot version
4.1
VS Code version
1.83
Godot Tools VS Code extension version
1.3.1
System information
Windows 11
Problem statement
Spin off from #420 which seems to be fixed now. However, when you set the editor path by using the file picker, I feel it should save to user settings, or at least ask the user where to save. The workspace settings should be committed to version control, and if we're developing in a team, there's good odds each team member will have their Godot editor installed somewhere different. Even just on my own, I have Godot in different places on my desktop and laptop.
Proposed solution
Save the editor path in user settings when it's input by the extension file picker.
The workspace settings should be committed to version control
This is definitely not universally accepted.
ask the user where to save
This is a good idea. I'll see if there's a clean way to ask the user what they want, and then look at standardizing all the file picker/settings prompts to do the right thing.
@lalomartins
I also forgot to mention, it's pretty trivial to add the folder with your godot executable(s) to the system path, and then your editorPath can just be set to something like godot4.exe. This is what I do for extension development when I need to switch between multiple Godot versions easily.
@DaelonSuzuka I think the User Settings are there now ? Shouldn't this be closed ?
@DaelonSuzuka I think the User Settings are there now ? Shouldn't this be closed ?
No changes have been made in relation to this issue, so I really don't know what you mean.
@DaelonSuzuka I was talking about this.
Although file picker is a nice addition, but considering that someone that working with Godot should be able to get the file path easily and copy-pasted / type it to the field.
I think it's better to update the Readme.md instead:
Getting Started
You can set VSCode as your default script editor for Godot by following these steps:
1. Setup Godot Tools in VSCode
Download and install Godot Tools, there are few options to download and install the extension:
- Find Godot Tools in Extension section of VSCode(recommended).
- Visual Studio Marketplace (also recommended): Stable release, with support for automatic updates.
- GitHub Releases: Stable release, but no automatic updates. Can be useful if you need to install an older version of the extension.
- Development build (if you feel adventurous): Development build. Contains new features and fixes not available in stable releases but may be unstable.
Note: If you rather download it from Github, Extract the ZIP archive before installing (it contains the .vsix file inside) To install from GitHub Releases or a development build, see [Install from a VSIX in the VSCode documentation](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix .
Set necessary configurations.
- Set your Godot installation path (Based on #502, it's recommended for setting the default Godot installation in your User Settings. )
When using Godot >3.6 or >4.2, Headless LSP mode is available. In Headless mode, the extension will attempt to launch a windowless instance of the Godot editor to use as its Language Server (see headless mode for details).
If you are using Godot 4.x.x, you need to change
godot_tools.gdscript_lsp_server_portin./vscode/settings.jsonorGodot_tools: Gdscript_lsp_server_portin User Settings to6005.
- Set more configurations in
./vscode/settings.json(optional). for more configuration details, you can check here.
2. Set external script editor in Godot
- Go to Editor menu in Godot Editor, and open Editor Settings
- Find external editor setting by selecting
Text Editor > External(if you can't find it, just typeexternalin Filter Settings input field). - Check
Use External Editorto activate (make sure this is checked, Godot will not use this setting if the box is not checked). - Fill Exec Path with the path to your VS Code executable, in MacOS this executable is typically located at
/Applications/Visual Studio Code.app/Contents/MacOS/Electron - Fill Exec Flags with
{project} --goto {file}:{line}:{col}