zielu / GitToolBox

GitToolBox IntelliJ plugin
GNU General Public License v3.0
607 stars 76 forks source link

Feature: Support templating in pattern branch completion formatters #347

Open zielu opened 3 years ago

zielu commented 3 years ago

Given branch name like feature/JIRA-1234_asdsd completion formatter should provider [JIRA-1234]. With current approach the best that can be done is JIRA-1234 with pattern (?:.+/)*(\w+-\d+).*

Templating support should provide one context list with contents of capture groups to reference them.

Final pattern for example would be achieved with following velocity output template: [matches[1]]

Fabianexe commented 3 years ago

Templating support would be very helpful.

Further, it would be nice to have default values or a simple if branching in the template. So that it is possible in your example if no ticket is given to completing [unknown] instead.

I have no idea if it is easily possible but maybe it is worth thinking of it when you implement it.

zielu commented 3 years ago

Hi, I'm considering using velocity for this feature so all kinds of custom logic will be possible :)