From f657404c225fe66a2e7c04382850334d2ea29052 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 21 Dec 2013 15:08:08 +0900 Subject: [PATCH] Improve java snippet --- autoload/neosnippet/snippets/java.snip | 73 +++++++++++--------------- 1 file changed, 31 insertions(+), 42 deletions(-) diff --git a/autoload/neosnippet/snippets/java.snip b/autoload/neosnippet/snippets/java.snip index 955003b..cf2d805 100644 --- a/autoload/neosnippet/snippets/java.snip +++ b/autoload/neosnippet/snippets/java.snip @@ -1,21 +1,3 @@ -snippet pu - public - -snippet po - protected - -snippet pr - private - -snippet st - static - -snippet fi - final - -snippet ab - abstract - snippet class class ${1} ${2:extends} ${3:#:Parent} ${4:implements} ${5:#:Interface} { ${0:TARGET} @@ -34,16 +16,13 @@ snippet method snippet var ${1:#:type} ${2:#:var}${3}; -snippet co +snippet const static public final ${1:#:type} ${2:#:var} = ${3};${4} -snippet cos +snippet const_string static public final String ${1:var} = "${2}";${4} -snippet re - return - -snippet as +snippet assert assert ${1:#:test} ${2:#:Failure message};${3} snippet if @@ -52,6 +31,7 @@ snippet if } snippet elif +alias elseif else if (${1}) { ${2:TARGET} } @@ -78,7 +58,6 @@ snippet switch } snippet case -abbr ce case ${1}: ${2:TARGET} ${0} @@ -86,13 +65,35 @@ abbr ce snippet br break; -snippet de +snippet default +alias de default: ${0} +snippet try + try { + ${0:TARGET} + } catch (${1:#:Exception} ${2:e}) { + ${3:e.printStackTrace();} + } + +snippet try_finally + try { + ${0:TARGET} + } catch (${1:Exception} ${2:e}) { + ${3:e.printStackTrace();} + } finally { + ${4} + } + snippet catch - catch (${1:#:Exception} ${2:e}) { - ${0} + catch (${1:Exception} ${2:e}) { + ${0:e.printStackTrace();} + } + +snippet finally + finally { + ${0:TARGET} } snippet th @@ -101,13 +102,8 @@ snippet th snippet sy synchronized -snippet im - import - -snippet pa - package - -snippet tc +snippet testclass +alias tc public class ${1} extends ${2:TestCase} { ${0:TARGET} } @@ -158,30 +154,24 @@ snippet author @author ${0:$TM_FULLNAME} snippet {code -abbr { {@code ${0} snippet deprecated @deprecated ${0:#:description} snippet {docRoot -abbr { {@docRoot snippet {inheritDoc -abbr { {@inheritDoc snippet {link -abbr { {@link ${1:#:target} ${0:#:label} snippet {linkplain -abbr { {@linkplain ${1:#:target} ${0:#:label} snippet {literal -abbr { {@literal ${0} snippet param @@ -209,7 +199,6 @@ snippet throws @throws ${1:#:class} ${0:#:description} snippet {value -abbr { {@value ${0} snippet version