Project
PhpStorm/WebStorm
Priority
Major
Type
Feature
State
Fixed
Assignee
Eugene Kudelevsky
Subsystem
Platform/HTML
Fix versions
EAP 96.1009
Affected versions
No Affected versions
  • Created by   Alexey Gopachenko
    2 years ago (18 Nov 2009 12:03)
  • Updated by   Alexey Gopachenko
    12 months ago (17 May 2011 13:12)
 
WI-626 Live templates enhancements
20
Issue is visible to: All Users
  The issue is visible to the selected user group only
Extend live templates in several ways to make non-java (web?) developers able to implement and use templates like used in ZenCoding selectors.

In particular, to allow easy creation of nested HTML/XML structures:
  1. Ability to capture rest of string as "argument" i.e. aTemplateName<caret>Some-Other&PossibleLong#Text should trigger aTemplateName template and pass Some-Other&PossibleLong#Text to dedicated template variable i.e. $ARG
  2. Ability to extract parts of vaiables, especially $ARG via regular expressions into new variables (from template code)
  3. Ability to trigger additional (other or same) template expansion from template code of just expanded via special command i.e. $$EXPAND
Additional ideas may be found in original ZenCoding proposas, however implementing these 3 items will be a really great start.

To allow creation of repetitive blocks:
  1. Ability to use multipliers i.e. expand aTemplateName*5<caret>OtherText to 5 sequental instances of aTemplateName template

There are several demos of using ZenCoding for HTML from concept authors and implementors, one of them http://vimeo.com/7405114 showing Espresso implementation. Same is already achived in TextMate and several other editors.
Comments (22)
 
History
 
Linked Issues (?)
 
Maxim Shafirov
  Maxim Shafirov
18 Nov 2009 14:54
2 years ago
When submitting feature request please consider describing what particular functionality shall do, not marketing buzzwords on how "wow" it'll look like
Related Changes
Resolved Date
2 years ago (18 Nov 2009 14:54)
State
SubmittedIncomplete
Sergey Chikuyonok
  Sergey Chikuyonok
23 Nov 2009 17:15
2 years ago
If you allow editor scripting (WI-266) I will port ZC to IDEA. I think it will be better solution.
Maxim Mossienko
  Maxim Mossienko
23 Nov 2009 17:39
2 years ago
live templates are the scripts, e.g. you can write groovy code to do something
e.g. define live template xxx which consists of $xxx$ variable, specify value for variable groovyScript("_editor.selectionModel.selectLineAtCaret()") and live template scope
Btw, Control (Meta) + Shift + Delete removes enclosing xml tag when editing xml / html
Maxim Mossienko
  Maxim Mossienko
23 Nov 2009 17:39
2 years ago
Btw, groovyScript macro also accepts absolute path to groovy file :)
Alexey Gopachenko
  Alexey Gopachenko
23 Nov 2009 18:29
2 years ago
There's WI-631 for that comments ^)
Related Changes
Alexey Gopachenko
  Alexey Gopachenko
30 Jan 2010 17:41
2 years ago
P1 (Argument) is implemented since ~94.200
Alexey Gopachenko
  Alexey Gopachenko
18 Feb 2010 00:43
2 years ago
available in build 94.335 - expand with tab, works in HTML & CSS
Related Changes
Fixed In version
<lost change><lost change>
Alexey Gopachenko
  Alexey Gopachenko
18 Feb 2010 00:54
2 years ago
$ numbering is not YET supported
Related Changes
Fixed In version
<lost change><lost change>
Alexey Gopachenko
  Alexey Gopachenko
18 Feb 2010 01:58
2 years ago
Sorry for everybody - there's NO Live Template | ZenCoding - it just works
expand with tab, works in HTML & CSS
Use tutorial on Zen Site %)
Also mind that this is "Work in progress"
Maxim Mossienko
  Maxim Mossienko
03 Apr 2010 16:27
2 years ago
control + shift + enter new shortcut
Borovikov Denis
  Borovikov Denis
07 Apr 2010 17:01
2 years ago
Will other usefull features of zen coding, like "wrap with abbreviation", are implemented in final 1.0?
Eugene Kudelevsky
  Eugene Kudelevsky
07 Apr 2010 18:42
2 years ago
"Wrap with abbreviation" feature is available in the last EAP. It can be invoked by Ctrl+Alt+T ("Surround with" action) or Ctrl+Alt+J ("Surround with live template" action)
Borovikov Denis
  Borovikov Denis
07 Apr 2010 19:10
2 years ago
I select the text, select "Surround with XML Zen Coding" and trying to use different Zen coding shortcuts:

Only the simplest shortcuts is working: div.class, div#class, div+div, div*5

Shortcuts like div > div, ul>li*>a is not working.

Is this bug or not?
Eugene Kudelevsky
  Eugene Kudelevsky
07 Apr 2010 19:40
2 years ago
Special syntax for wrapping each line is not supported now, but "div>div" is perfectly works for me. In what context do you invoke it?
Borovikov Denis
  Borovikov Denis
07 Apr 2010 19:49
2 years ago
It's my mistake, sorry. This shortcut is realy working. But I found a strage behavior with using A tag in wrapping. Selecting text disappears until we fill href attribute. If you press ESC, it will disappear forever. Open a new issue?
Eugene Kudelevsky
  Eugene Kudelevsky
07 Apr 2010 20:39
2 years ago
yes, you can open a new issue if you want, but i don't see a serious problem, because you can undo the action after pressing ESC
Borovikov Denis
  Borovikov Denis
07 Apr 2010 21:16
2 years ago
It's not a critical problem, I simply think that coming 1.0 must be perfect :)
Borovikov Denis
  Borovikov Denis
25 May 2010 22:06
2 years ago
Is there any progress with support for "Surround with XML Zen Coding" for multiple lines? Will we see it in 1.0 release?
Alexey Gopachenko
  Alexey Gopachenko
25 May 2010 22:23
2 years ago
Surround already can be applied to multiline selection.
If you taking about "Surround each line" or something else - no additional features will fit 1.0 timeframe, as described in RC release notes.
Borovikov Denis
  Borovikov Denis
25 May 2010 22:33
2 years ago
Yes, I mean "Surround each line" with Zen Coding * operation. It this feature will be applied in the next 1.1 release?

This is really demanded thing for web markup. It is very bored to manually wrap each line of menu text width <li><a href=""></a></li>
Alexey Gopachenko
  Alexey Gopachenko
26 May 2010 00:49
2 years ago
This feature will be added in the nearest minor updates to 1.0
Alexey Gopachenko
  Alexey Gopachenko
14 Jul 2010 18:17
22 months ago
Original request is complete. Please file new requests/reports separately.
Looks like "surround each line" will go into 1.x only. Its EAP will follow in a month.