After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754342 - File templates for a particular project
File templates for a particular project
Status: RESOLVED OBSOLETE
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-31 08:44 UTC by Alexander Larsson
Modified: 2018-01-11 09:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander Larsson 2015-08-31 08:44:06 UTC
It would be cool if i could somehow add templates for new files in a project.
For instance, i could create a template for header (.h) files that come with a pre-created licence boilerplate comment matching that particular project. Any new file created by builder would then start with this content rather than empty.
Comment 1 Carlos Soriano 2015-08-31 08:48:38 UTC
fwiw I feel snipets like "gpl" or "gobject" does the job pretty well and in a generic way, but maybe it could integrate both worlds.
Comment 2 Christian Hergert 2015-08-31 08:49:38 UTC
Indeed. My hope was to get templates in for 3.18, but that is looking increasingly unlikely.

(We need both project and file templates).

I'd also like them to be easy to activate, such as typing a bit of the name in the search bar and activating an action.
Comment 3 Alexander Larsson 2015-08-31 10:24:17 UTC
snippets are not typically per-project though. I want the full header file with the project name and whatnot.
Comment 4 Christian Hergert 2015-08-31 20:33:16 UTC
As a stop gap, would adding a ${project_name} variable to the snippet context be useful? Then we could alter the snippets to include it during expansion.

Having a generic file template would be closer to having a `license` snippet that looked at the project setting and Did the Right Thing™
Comment 5 Alexander Larsson 2015-09-02 11:58:41 UTC
That makes a lot of sense as a stop-gap measure.
Comment 6 GNOME Infrastructure Team 2018-01-11 09:52:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-builder/issues/44.