From c896340bf70d2ab66e76385a8254b702e35a95f9 Mon Sep 17 00:00:00 2001 From: MoritzKn Date: Tue, 27 Sep 2016 11:27:10 +0200 Subject: [PATCH 1/5] Add snippets for core JSP-tags --- snippets/language-java.cson | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/snippets/language-java.cson b/snippets/language-java.cson index 1f3bbb4..37fa7ae 100644 --- a/snippets/language-java.cson +++ b/snippets/language-java.cson @@ -129,3 +129,37 @@ 'while': 'prefix': 'wh' 'body': 'while ($1) {\n\t$0\n}' +'.text.html.jsp': + 'c:out': + 'prefix': 'out' + 'body': '' + 'c:set': + 'prefix': 'set' + 'body': '' + 'c:remove': + 'prefix': 'rm' + 'body': '' + 'c:catch': + 'prefix': 'catch' + 'body': '\n\t$2\n' + 'c:if': + 'prefix': 'if' + 'body': '\n\t$0\n' + 'c:choose': + 'prefix': 'choose' + 'body': '\n\t\n\t\t$2\n\t$3\n\t\n\t\t$4\n\t\n' + 'c:when': + 'prefix': 'when' + 'body': '\n\t$2\n' + 'c:otherwise': + 'prefix': 'other' + 'body': '\n\t$1\n' + 'c:forEach': + 'prefix': 'forEach' + 'body': '\n\t$4\n' + 'c:forEach': + 'prefix': 'forEachIn' + 'body': '\n\t$3\n' + 'c:forTokens': + 'prefix': 'forTokens' + 'body': '\n\t$4\n' From 868d397ee1df01a7d0c9fb39cf22376a41f9980c Mon Sep 17 00:00:00 2001 From: MoritzKn Date: Tue, 27 Sep 2016 11:45:11 +0200 Subject: [PATCH 2/5] Add snippets for core JSP syntax --- snippets/language-java.cson | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/snippets/language-java.cson b/snippets/language-java.cson index 37fa7ae..5b8cbcf 100644 --- a/snippets/language-java.cson +++ b/snippets/language-java.cson @@ -130,6 +130,30 @@ 'prefix': 'wh' 'body': 'while ($1) {\n\t$0\n}' '.text.html.jsp': + 'scriptlet': + 'prefix': '%' + 'body': '<%\n\t$1\n%>' + 'scriptlet (xml)': + 'prefix': 'scriptlet' + 'body': '\n\t$1\n' + 'declaration': + 'prefix': '%!' + 'body': '<%!\n\t$1\n%>' + 'declaration (xml)': + 'prefix': 'declaration' + 'body': '\n\t$1\n' + 'expression': + 'prefix': '%=' + 'body': '<%=\n\t$1\n%>' + 'expression (xml)': + 'prefix': 'expression' + 'body': '\n\t$1\n' + 'comment': + 'prefix': '%--' + 'body': '<%--\n\t$1\n--%>' + 'el': + 'prefix': '$' + 'body': '\\${$1}' 'c:out': 'prefix': 'out' 'body': '' From b9caad2e69a5cbeab8e378a4dd4cfcc5b09419f6 Mon Sep 17 00:00:00 2001 From: MoritzKn Date: Thu, 13 Oct 2016 09:57:30 +0200 Subject: [PATCH 3/5] Fix c:choose snippet The closing tag was not closing. --- snippets/language-java.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/language-java.cson b/snippets/language-java.cson index 5b8cbcf..798e2ea 100644 --- a/snippets/language-java.cson +++ b/snippets/language-java.cson @@ -171,7 +171,7 @@ 'body': '\n\t$0\n' 'c:choose': 'prefix': 'choose' - 'body': '\n\t\n\t\t$2\n\t$3\n\t\n\t\t$4\n\t\n' + 'body': '\n\t\n\t\t$2\n\t$3\n\t\n\t\t$4\n\t\n' 'c:when': 'prefix': 'when' 'body': '\n\t$2\n' From 27d117e5c276509f51884272141270cc71ae2f14 Mon Sep 17 00:00:00 2001 From: Moritz Date: Sun, 16 Oct 2016 02:32:55 +0200 Subject: [PATCH 4/5] Make multi line JSP snippet bodies multi line strings --- snippets/language-java.cson | 117 +++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 23 deletions(-) diff --git a/snippets/language-java.cson b/snippets/language-java.cson index 798e2ea..9a5696f 100644 --- a/snippets/language-java.cson +++ b/snippets/language-java.cson @@ -130,60 +130,131 @@ 'prefix': 'wh' 'body': 'while ($1) {\n\t$0\n}' '.text.html.jsp': + 'el': + 'prefix': '$' + 'body': '\\${$1}' 'scriptlet': 'prefix': '%' - 'body': '<%\n\t$1\n%>' - 'scriptlet (xml)': - 'prefix': 'scriptlet' - 'body': '\n\t$1\n' + 'body': """ + <% + \t$1 + %> + """ 'declaration': 'prefix': '%!' - 'body': '<%!\n\t$1\n%>' + 'body': """ + <%! + \t$1 + %> + """ 'declaration (xml)': 'prefix': 'declaration' - 'body': '\n\t$1\n' + 'body': """ + + \t$1 + + """ 'expression': 'prefix': '%=' - 'body': '<%=\n\t$1\n%>' + 'body': """ + <%= + \t$1 + %> + """ 'expression (xml)': 'prefix': 'expression' - 'body': '\n\t$1\n' + 'body': """ + + \t$1 + + """ 'comment': 'prefix': '%--' - 'body': '<%--\n\t$1\n--%>' - 'el': - 'prefix': '$' - 'body': '\\${$1}' + 'body': """ + <%-- + \t$1 + --%> + """ + 'scriptlet (xml)': + 'prefix': 'scriptlet' + 'body': """ + + \t$1 + + """ 'c:out': 'prefix': 'out' - 'body': '' + 'body': """ + + """ 'c:set': 'prefix': 'set' - 'body': '' + 'body': """ + + """ 'c:remove': 'prefix': 'rm' - 'body': '' + 'body': """ + + """ 'c:catch': 'prefix': 'catch' - 'body': '\n\t$2\n' + 'body': """ + + \t$2 + + """ 'c:if': 'prefix': 'if' - 'body': '\n\t$0\n' + 'body': """ + + \t$0 + + """ 'c:choose': 'prefix': 'choose' - 'body': '\n\t\n\t\t$2\n\t$3\n\t\n\t\t$4\n\t\n' + 'body': """ + + \t + \t\t$2 + \t$3 + \t + \t\t$4 + \t + + """ 'c:when': 'prefix': 'when' - 'body': '\n\t$2\n' + 'body': """ + + \t$2 + + """ 'c:otherwise': 'prefix': 'other' - 'body': '\n\t$1\n' + 'body': """ + + \t$1 + + """ 'c:forEach': 'prefix': 'forEach' - 'body': '\n\t$4\n' + 'body': """ + + \t$4 + + """ 'c:forEach': 'prefix': 'forEachIn' - 'body': '\n\t$3\n' + 'body': """ + + \t$3 + + """ 'c:forTokens': 'prefix': 'forTokens' - 'body': '\n\t$4\n' + 'body': """ + + \t$4 + + """ From 9afe6a94440d5d420a116f726979919cc466970a Mon Sep 17 00:00:00 2001 From: Moritz Date: Sun, 16 Oct 2016 03:08:46 +0200 Subject: [PATCH 5/5] Add JSP snippets for started tags Pressing tab after ` """ - 'declaration (xml)': - 'prefix': 'declaration' - 'body': """ - - \t$1 - - """ 'expression': 'prefix': '%=' 'body': """ @@ -161,13 +154,6 @@ \t$1 %> """ - 'expression (xml)': - 'prefix': 'expression' - 'body': """ - - \t$1 - - """ 'comment': 'prefix': '%--' 'body': """ @@ -175,6 +161,20 @@ \t$1 --%> """ + 'declaration (xml)': + 'prefix': 'declaration' + 'body': """ + + \t$1 + + """ + 'expression (xml)': + 'prefix': 'expression' + 'body': """ + + \t$1 + + """ 'scriptlet (xml)': 'prefix': 'scriptlet' 'body': """ @@ -258,3 +258,131 @@ \t$4 """ +'.text.html.jsp .entity.name.tag': + 'declaration (xml)': + 'prefix': ' + \t$1 + + """ + 'expression (xml)': + 'prefix': ' + \t$1 + + """ + 'scriptlet (xml)': + 'prefix': ' + \t$1 + + """ + 'c:out': + 'prefix': ' + """ + 'c:set': + 'prefix': ' + """ + 'c:remove': + 'prefix': ' + """ + 'c:catch': + 'prefix': ' + \t$2 + + """ + 'c:if': + 'prefix': ' + \t$0 + + """ + 'c:choose': + 'prefix': ' + \t + \t\t$2 + \t$3 + \t + \t\t$4 + \t + + """ + 'c:when': + 'prefix': ' + \t$2 + + """ + 'c:otherwise': + 'prefix': ' + \t$1 + + """ + 'c:forEach': + 'prefix': ' + \t$4 + + """ + 'c:forEach': + 'prefix': ' + \t$3 + + """ + 'c:forTokens': + 'prefix': ' + \t$4 + + """ +'.text.html.jsp .punctuation.begin': + 'scriptlet': + 'prefix': '<%' + 'body': """ + <% + \t$1 + %> + """ + 'declaration': + 'prefix': '<%!' + 'body': """ + <%! + \t$1 + %> + """ + 'expression': + 'prefix': '<%=' + 'body': """ + <%= + \t$1 + %> + """ +'.text.html.jsp .punctuation.comment': + 'comment': + 'prefix': '<%--' + 'body': """ + <%-- + \t$1 + --%> + """