Improve java snippet

This commit is contained in:
Shougo Matsushita 2013-12-21 15:08:08 +09:00
parent 909c2c9fdb
commit f657404c22

View File

@ -1,21 +1,3 @@
snippet pu
public
snippet po
protected
snippet pr
private
snippet st
static
snippet fi
final
snippet ab
abstract
snippet class snippet class
class ${1} ${2:extends} ${3:#:Parent} ${4:implements} ${5:#:Interface} { class ${1} ${2:extends} ${3:#:Parent} ${4:implements} ${5:#:Interface} {
${0:TARGET} ${0:TARGET}
@ -34,16 +16,13 @@ snippet method
snippet var snippet var
${1:#:type} ${2:#:var}${3}; ${1:#:type} ${2:#:var}${3};
snippet co snippet const
static public final ${1:#:type} ${2:#:var} = ${3};${4} static public final ${1:#:type} ${2:#:var} = ${3};${4}
snippet cos snippet const_string
static public final String ${1:var} = "${2}";${4} static public final String ${1:var} = "${2}";${4}
snippet re snippet assert
return
snippet as
assert ${1:#:test} ${2:#:Failure message};${3} assert ${1:#:test} ${2:#:Failure message};${3}
snippet if snippet if
@ -52,6 +31,7 @@ snippet if
} }
snippet elif snippet elif
alias elseif
else if (${1}) { else if (${1}) {
${2:TARGET} ${2:TARGET}
} }
@ -78,7 +58,6 @@ snippet switch
} }
snippet case snippet case
abbr ce
case ${1}: case ${1}:
${2:TARGET} ${2:TARGET}
${0} ${0}
@ -86,13 +65,35 @@ abbr ce
snippet br snippet br
break; break;
snippet de snippet default
alias de
default: default:
${0} ${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 snippet catch
catch (${1:#:Exception} ${2:e}) { catch (${1:Exception} ${2:e}) {
${0} ${0:e.printStackTrace();}
}
snippet finally
finally {
${0:TARGET}
} }
snippet th snippet th
@ -101,13 +102,8 @@ snippet th
snippet sy snippet sy
synchronized synchronized
snippet im snippet testclass
import alias tc
snippet pa
package
snippet tc
public class ${1} extends ${2:TestCase} { public class ${1} extends ${2:TestCase} {
${0:TARGET} ${0:TARGET}
} }
@ -158,30 +154,24 @@ snippet author
@author ${0:$TM_FULLNAME} @author ${0:$TM_FULLNAME}
snippet {code snippet {code
abbr {
{@code ${0} {@code ${0}
snippet deprecated snippet deprecated
@deprecated ${0:#:description} @deprecated ${0:#:description}
snippet {docRoot snippet {docRoot
abbr {
{@docRoot {@docRoot
snippet {inheritDoc snippet {inheritDoc
abbr {
{@inheritDoc {@inheritDoc
snippet {link snippet {link
abbr {
{@link ${1:#:target} ${0:#:label} {@link ${1:#:target} ${0:#:label}
snippet {linkplain snippet {linkplain
abbr {
{@linkplain ${1:#:target} ${0:#:label} {@linkplain ${1:#:target} ${0:#:label}
snippet {literal snippet {literal
abbr {
{@literal ${0} {@literal ${0}
snippet param snippet param
@ -209,7 +199,6 @@ snippet throws
@throws ${1:#:class} ${0:#:description} @throws ${1:#:class} ${0:#:description}
snippet {value snippet {value
abbr {
{@value ${0} {@value ${0}
snippet version snippet version