godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Automatically specify exec flags based on the selected external editor #10631

Open ivanskorikov opened 2 months ago

ivanskorikov commented 2 months ago

Describe the project you are working on

JetBrains Rider

Describe the problem or limitation you are having in your project

As described in Using an external text editor section, to configure an external editor, you need to specify the path to editor executable and the required flags suitable for the selected editor. From the UI it is not evident that you need a specific set of exec flags configured when you select an external editor executable, nor it is evident that each editor required a different set of flags.

As a member of the JetBrains Rider support team, I regularly deal with support requests from Godot+Rider users regarding Rider not opening the project properly. Usually those requests are resolved by proper exec flags configuration.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Since flags for most popular external editors are already documented, it would be convenient to have the Godot Editor automatically set exec flags based on the path to the external editor specified by the user.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I was thinking that it might be worth adding an event that fires off when the Exec Path setting is edited. On this event, use a regex to parse the path and detect editor name and then set Exec Flags field value to have appropriate flags. If no known editor was detected, indicate it in the Settings window (e.g. using a tooltip) and set the field to a fallback value like {file}

If this enhancement will not be used often, can it be worked around with a few lines of script?

I can't see any easy workaround, however I'd be happy to be proven wrong.

Is there a reason why this should be core and not an add-on in the asset library?

It's core editor functionality.

Calinou commented 2 months ago

Feel free to open a pull request for this :slightly_smiling_face:

You can check how I implemented automatic flags for terminal emulators based on the terminal emulator name: https://github.com/godotengine/godot/pull/85923