File Templates in IDE 11

Upgraded from IDE 10 to IDE 11 last week. I have a number of issues, but that’s nothing new for V xx.0. This is my sixth major version upgrade. You’d think I’d learn.

Like its predecessors, K11 broke the file templates I had in my toolbox, opening a new tab with a file:// URL pointing to something from my K10 folder.

Please reconsider/re-think the interpolation “limitation” described in https://github.com/Komodo/KomodoEdit/issues/2992 (@nathanr) This was a valuable feature for me. Not having it for templates is a step backwards IMO. The new template thing looks like a glorified snippet that opens in a new tab. Hopefully it’ll make them more portable between versions going forward. But interpolations are part of snippets, and a natural fit for Templates.

Thanks for listening.

@cdcmicro, I agree. I think it’s fine if you comment on the ticket itself. I’ve raised your concern though. Thanks for bringing this up.

  • Carey

I’m curious, what’s stopping you from using snippets for what you are trying to do? I’m not against the idea of adding it to templates, it just seemed like that would overlap too much with snippets and I couldn’t think of a good use-case for them for templates.

Some workflow examples could be very helpful.

Hi @nathanr,

As I was writing the original post, I was asking myself “why not just use a snippet?”. Ctrl-N, paste the snippet, maybe change languages and it’s good to go. I think I worked that way before I discovered file templates, maybe in v8 or 9.

I do web and what might be called “devops” work in Perl (default language), Javascript, HTML, SCSS, SQL, markdown, makefile, bash script, and others, so there’s a good chance changing languages will be required.

With interpolation, the v10 file template in the toolbox does all that for me, inserts the date and leaves me ready to type the filename in a multi-caret tabstop (see v10 template example below).

It’s not much, but it saves me from having to do repetitive tasks. Sure, there are other ways to achieve the same result, but:

  1. It’s been part of at least the last two major releases, and I’ve built it into my toolbox and workflow
  2. I would have to write a custom solution (script, macro, usertool)
  3. A custom solution might (or might not) require me to leave the IDE
  4. I want you to write it instead :slight_smile:
  5. I think Komodo’s mission is to help reduce common repetitive tasks for developers
  6. It’s just the kind of thing IDEs are supposed to be good at.

This example is the skeleton I use for a perl-based tool or cronjob. I have similar kinds of templates for other languages/scenarios.


#!/usr/local/bin/perl
### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
### [[%tabstop1:SCRIPT_FILENAME]]
### [[%date:%Y-%m-%d]] Clark Christensen at TAIS
### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
use lib qw(/var/www);
use Modern::Perl;
use DBI;
use Data::Dumper;
use IO::File;
use Getopt::Long;
my ($dbname);

### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
### Read the options from the commandline
### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GetOptions(
	#'debug'       => \$boolean_flag,
	#'string=s'    => \$string_var,
	#'inetger=i'   => \$integer_var,
	#'help'        => \&show_help,
);

### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
### 
### +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sub show_help {
	say <<"___END_BLOCK";
Usage: [[%tabstop1:SCRIPT_FILENAME]] [OPTION]

Description of what [[%tabstop1:SCRIPT_FILENAME]] does

Options:
  -f, --flag       Flag opption 1
  -s = STRING      String option
  -i = 999999      Integer option
  -h, --help       Display this help and exit.
___END_BLOCK
}

I struggle with where’s the right place for discussion, so I try to start in forums and see if the discussion becomes ticket-worthy.

Thanks for the feedback @cdcmicro, I’ve reopened the bug and targeted 11.1. I agree given your use-case it makes sense to support this. Anything we can do to make things easier.

Thank you very much! :sunglasses: