7 Replies Last post: Jan 28, 2013 6:52 PM by Denis Zhdanov  
Adoxographer - Newbie 4 posts since
Jan 25, 2013
Currently Being Moderated

Jan 25, 2013 7:53 PM

Custom autocompletion lists

Hi,

 

Is it possible to add custom auto complete lists (much like sublime does with .sublime-completions) ?

 

Thanks!

Denis Zhdanov JetBrains 1,423 posts since
Oct 20, 2007
Currently Being Moderated
Jan 25, 2013 8:12 PM in response to: Adoxographer -
Re: Custom autocompletion lists

Hello,

 

Please check live templates reference section.

 

Denis

Denis Zhdanov JetBrains 1,423 posts since
Oct 20, 2007
Currently Being Moderated
Jan 28, 2013 11:04 AM in response to: Adoxographer -
Re: Custom autocompletion lists

I see, so the question is to how introduce target text into template. The IDE already provides a notion of 'surround templates', i.e. templates which use text selected at editor. You can combine that with the powerful macros sub-system. The general idea is to write a macros which selects target text and calls target custom surround template and bind it to shortcut.

 

I've created a small screencast which illustrates the whole process - https://dl.dropbox.com/u/1648086/video/macro-template.m4v

 

Denis

Denis Zhdanov JetBrains 1,423 posts since
Oct 20, 2007
Currently Being Moderated
Jan 28, 2013 11:44 PM in response to: Adoxographer -
Re: Custom autocompletion lists

Sure, all 'surround' templates are stored at $IDEA_CONFIG_HOME/templates/surround.xml file. So, you can do the following:

  1. Create a template manually and check its serialized representation;
  2. Write a simple script which traverses your sublime templates and generates corresponding template section at surround.xml;

Denis

Denis Zhdanov JetBrains 1,423 posts since
Oct 20, 2007
Currently Being Moderated
Jan 28, 2013 6:52 PM in response to: Adoxographer -
Re: Custom autocompletion lists

No

More Like This

  • Retrieving data ...