godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.52k stars 149 forks source link

Editor Path belongs in user settings, not workspace #502

Open lalomartins opened 10 months ago

lalomartins commented 10 months ago

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.

DaelonSuzuka commented 10 months ago

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.

DaelonSuzuka commented 9 months ago

@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.

tsanyqudsi commented 8 months ago

@DaelonSuzuka I think the User Settings are there now ? Shouldn't this be closed ?

DaelonSuzuka commented 8 months ago

@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.

tsanyqudsi commented 8 months ago

@DaelonSuzuka I was talking about this.

image

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:

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.

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_port in ./vscode/settings.json or Godot_tools: Gdscript_lsp_server_port in User Settings to 6005.

2. Set external script editor in Godot

image

  1. Go to Editor menu in Godot Editor, and open Editor Settings
  2. Find external editor setting by selecting Text Editor > External (if you can't find it, just type external in Filter Settings input field).
  3. Check Use External Editor to activate (make sure this is checked, Godot will not use this setting if the box is not checked).
  4. 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
  5. Fill Exec Flags with {project} --goto {file}:{line}:{col}