godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 93 forks source link

Allow to configure external editors for arbitrary file types #4795

Open A-Lamia opened 2 years ago

A-Lamia commented 2 years ago

Describe the project you are working on

A semi open world RPG game.

Describe the problem or limitation you are having in your project

Need a faster way to edit files from within Godot.

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

Would let you right click files and press an "Edit" option that would launch the software associated with that file type.

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

Right click a file in the FileSystem and press Edit, this will run a function called EditFileByAssociation this will check 2 places, a custom user settings option to place software paths with file types and the systems file association.

User settings should override systems associations.


Void EditFileByAssociation() {
    string file;
    string file_type;
    string file_path;

    // If file_type is equal to user settings association:
        // open file in associated software
    // elseif check windows for software associated with file type:
        // open file in associated software
    // else:
        // error: no software could be found to edit file with. 

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

It maybe possible to write some of this as an addon but unsure.

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

This should be core as it is a feature that is globally usable on every project and betters Godots UX for everyone.

YuriSizov commented 2 years ago

So it's not the Edit button you want. It's the open external editor functionality. For arbitrary file types and editors, with full user customization (instead of relying on the host OS resolution).

The context menu button would be a consequence of this functionality existing. In fact, it would probably not be required at all, because double click would behave as expected.

A-Lamia commented 2 years ago

Double clicking might not work because currently you double click some assets for them to show up in the node inspector, and 3D files will open the advanced importer when you double click them.