Godot: Editor request: manage project licence text

Created on 2 Aug 2019  路  5Comments  路  Source: godotengine/godot

Godot version:
All

Issue description:
It would be convenient if the Godot editor could manage my project's licence text for me. Basically, I'd like to add or edit my licence text in ProjectSettings, and then have the editor add this automatically to files (*.gd at least, maybe others?) and hide it away while I'm editing the file.

I don't have any familiarity with how this is done in other editors, so other folks will have better ideas than me for implementation.

EDIT: Possible alternatives from comments:

  1. Use script_templates. However, I think this can only work in shared projects if script_templates is part of project (rather than user specific) as suggested in https://github.com/godotengine/godot/issues/19145.
  2. A simple editor option to fold all continuous comment lines at the top of all files (related to https://github.com/godotengine/godot/issues/27488 but here I would want special treatment for comments at the top).
feature proposal editor

Most helpful comment

I don't really mind the work of adding text; it's the scrolling past it that eats up my development time & attention.

You do realize that you can fold the license just like any part of your script by simply indenting it, right?
image
image

I think this is an unnecessary feature, I can't see how "Letting Godot handling your license" is an improvement for the engine, as mentioned in #28097. Tho, I do think that having templates in a per-project manner would be a good improvement, then people that like to put their licenses on their scripts can create a template for that, and also, it would allow for many other use cases.

All 5 comments

Could be hidden away by supporting comment folding, and if a file starts with a long multiline comment, it would fold it by default?
Also careful not to overwite license text in addons/.

You can create custom script templates by placing files in the script_templates directory of the editor settings folder (create it if needed). The file must have an extension that matches the script language (.gd for GDScript, .cs for C#).

PS: You can open the editor settings folder using Editor > Open Editor Data/Settings Folder (Editor > Open Editor Settings Folder on Linux).

You can create custom script templates by placing files in the script_templates directory of the editor settings folder (create it if needed).

Makes me wonder whether editor plugins could write out script templates that way (per script class name, for instance), seems doable. But this would make more sense per project rather than editor.

I should probably learn to use script_templates, but I believe that would be a pain to use in a shared project since script_templates are not part of the project (https://github.com/godotengine/godot/issues/19145).

I agree with Zylann that any managed solution would have to respect addons or different parts of a project that might need different licence texts.

Yes, a simple option to fold all continuous text at the top of every file would work. I don't really mind the work of adding text; it's the scrolling past it that eats up my development time & attention.

I don't really mind the work of adding text; it's the scrolling past it that eats up my development time & attention.

You do realize that you can fold the license just like any part of your script by simply indenting it, right?
image
image

I think this is an unnecessary feature, I can't see how "Letting Godot handling your license" is an improvement for the engine, as mentioned in #28097. Tho, I do think that having templates in a per-project manner would be a good improvement, then people that like to put their licenses on their scripts can create a template for that, and also, it would allow for many other use cases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdwardAngeles picture EdwardAngeles  路  3Comments

nunodonato picture nunodonato  路  3Comments

Spooner picture Spooner  路  3Comments

ducdetronquito picture ducdetronquito  路  3Comments

blurymind picture blurymind  路  3Comments