put common luasnip functions in a seperate file and modify some
java snippets
This commit is contained in:
@ -1,8 +1,5 @@
|
||||
require('core.snippets.shorthands')
|
||||
|
||||
local function file_name(args, parent, user_args)
|
||||
return vim.fn.expand("%:t:r")
|
||||
end
|
||||
require('core.snippets.functions')
|
||||
|
||||
return {
|
||||
-- method snippet
|
||||
@ -34,6 +31,12 @@ return {
|
||||
t({ "", "}" }),
|
||||
}),
|
||||
|
||||
s("main", {
|
||||
t({ "public static void main(String[] args) {", "\t" }),
|
||||
i(0),
|
||||
t({ "", "}" }),
|
||||
}),
|
||||
|
||||
-- constructor snippet
|
||||
s("constr", {
|
||||
c(1, {
|
||||
@ -59,14 +62,18 @@ return {
|
||||
c(1, {
|
||||
t("public "),
|
||||
t("private "),
|
||||
t("protected ")
|
||||
t("protected "),
|
||||
t("")
|
||||
}),
|
||||
c(2, {
|
||||
t("class "),
|
||||
t("interface ")
|
||||
}),
|
||||
f(file_name, {}),
|
||||
c(3, {
|
||||
i(0, "MyClass"),
|
||||
f(file_name, {})
|
||||
}),
|
||||
c(4, {
|
||||
t(" "),
|
||||
sn(nil, { t({" implements "}), i(1), t(" ") }),
|
||||
sn(nil, { t({" extends "}), i(1), t(" ") }),
|
||||
|
Reference in New Issue
Block a user