mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
bundle zen-coding live templates
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templateSet group="Zen XSL">
|
||||
<template description="<xsl:template match="..." mode="...">...</xsl:template>" name="tmatch" toReformat="true" toShortenFQNames="true" value="<xsl:template match="$VAR0$" mode="$VAR1$">$END$</xsl:template>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:param name="..." select="..." />" name="par" toReformat="true" toShortenFQNames="true" value="<xsl:param name="$VAR0$" select="$VAR1$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:copy-of select="..." />" name="co" toReformat="true" toShortenFQNames="true" value="<xsl:copy-of select="$VAR0$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:attribute name="...">...</xsl:attribute>" name="attr" toReformat="true" toShortenFQNames="true" value="<xsl:attribute name="$VAR0$">$END$</xsl:attribute>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:value-of select="..." />" name="val" toReformat="true" toShortenFQNames="true" value="<xsl:value-of select="$VAR0$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:when test="...">...</xsl:when>" name="xsl:when" toReformat="true" toShortenFQNames="true" value="<xsl:when test="$VAR0$">$END$</xsl:when>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:for-each select="...">...</xsl:for-each>" name="each" toReformat="true" toShortenFQNames="true" value="<xsl:for-each select="$VAR0$">$END$</xsl:for-each>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:variable name="...">...</xsl:variable>" name="var" toReformat="true" toShortenFQNames="true" value="<xsl:variable name="$VAR0$">$END$</xsl:variable>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:when test="...">...</xsl:when>" name="wh" toReformat="true" toShortenFQNames="true" value="<xsl:when test="$VAR0$">$END$</xsl:when>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:template name="...">...</xsl:template>" name="tn" toReformat="true" toShortenFQNames="true" value="<xsl:template name="$VAR0$">$END$</xsl:template>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:apply-templates select="..." mode="..." />" name="ap" toReformat="true" toShortenFQNames="true" value="<xsl:apply-templates select="$VAR0$" mode="$VAR1$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:template match="..." mode="...">...</xsl:template>" name="tm" toReformat="true" toShortenFQNames="true" value="<xsl:template match="$VAR0$" mode="$VAR1$">$END$</xsl:template>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:call-template name="..." />" name="call" toReformat="true" toShortenFQNames="true" value="<xsl:call-template name="$VAR0$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="" name="choose+" toReformat="true" toShortenFQNames="true" value="<xsl:choose> <xsl:when test="$VAR0$">$VAR1$</xsl:when> <xsl:otherwise>$END$</xsl:otherwise> </xsl:choose>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:variable name="..." select="..." />" name="vare" toReformat="true" toShortenFQNames="true" value="<xsl:variable name="$VAR0$" select="$VAR1$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:with-param name="..." select="..." />" name="wp" toReformat="true" toShortenFQNames="true" value="<xsl:with-param name="$VAR0$" select="$VAR1$" />">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR1"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:template name="...">...</xsl:template>" name="tname" toReformat="true" toShortenFQNames="true" value="<xsl:template name="$VAR0$">$END$</xsl:template>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template description="<xsl:if test="...">...</xsl:if>" name="if" toReformat="true" toShortenFQNames="true" value="<xsl:if test="$VAR0$">$END$</xsl:if>">
|
||||
<variable alwaysStopAt="true" defaultValue="""" expression="" name="VAR0"/>
|
||||
<context>
|
||||
<option name="XML" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
</templateSet>
|
||||
@@ -22,6 +22,6 @@ import com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider;
|
||||
*/
|
||||
public class XmlDefaultLiveTemplatesProvider implements DefaultLiveTemplatesProvider {
|
||||
public String[] getDefaultLiveTemplateFiles() {
|
||||
return new String[] { "/liveTemplates/html_xml" };
|
||||
return new String[] { "/liveTemplates/html_xml", "/liveTemplates/zen_html", "/liveTemplates/zen_xsl" };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ public class XmlZenCodingTemplate extends ZenCodingTemplate {
|
||||
private static TemplateImpl generateTagTemplate(String tagName, CustomTemplateCallback callback) {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
builder.append(tagName).append('>');
|
||||
if (isTrueXml(callback) || !HtmlUtil.isSingleHtmlTag(tagName)) {
|
||||
if (!HtmlUtil.isSingleHtmlTag(tagName)) {
|
||||
builder.append("$END$</").append(tagName).append('>');
|
||||
}
|
||||
return new TemplateImpl("", builder.toString(), "");
|
||||
|
||||
@@ -206,7 +206,7 @@ public class GenerationNode {
|
||||
return template;
|
||||
}
|
||||
|
||||
private static TemplateImpl invokeXmlTemplate(XmlTemplateToken token,
|
||||
private static TemplateImpl invokeXmlTemplate(final XmlTemplateToken token,
|
||||
CustomTemplateCallback callback,
|
||||
final int numberInIteration,
|
||||
@Nullable ZenCodingGenerator generator,
|
||||
@@ -227,6 +227,7 @@ public class GenerationNode {
|
||||
public void run() {
|
||||
XmlTag tag1 = hasChildren ? expandEmptyTagIfNeccessary(tag) : tag;
|
||||
setAttributeValues(tag1, attr2value, numberInIteration);
|
||||
token.setFile((XmlFile)tag1.getContainingFile());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -272,7 +273,6 @@ public class GenerationNode {
|
||||
if (flag) {
|
||||
builder.append("></").append(tag.getName()).append('>');
|
||||
final XmlTag tag1 = XmlElementFactory.getInstance(tag.getProject()).createTagFromText(builder.toString(), XMLLanguage.INSTANCE);
|
||||
tag.replace(tag1);
|
||||
return tag1;
|
||||
}
|
||||
return tag;
|
||||
|
||||
Reference in New Issue
Block a user