diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua index bb83cb5..f46e01d 100644 --- a/after/ftplugin/java.lua +++ b/after/ftplugin/java.lua @@ -21,7 +21,7 @@ extendedClientCapabilities.document_formatting = false local root_dir = vim.fs.root(0, { ".git", "mvnw", "gradlew", "pom.xml" }) or vim.uv.cwd() local cache_dir = vim.fn.stdpath "cache" -local project_name = vim.fn.fnamemodify(root_dir, ":t") +local project_name = vim.fs.basename(root_dir) local workspace_dir = string.format("%s/java/wksp/%s", cache_dir, project_name) local launcher_path = vim.fn.glob(data_path .. "/mason/packages/jdtls/plugins/org.eclipse.equinox.launcher_*.jar", true) @@ -46,8 +46,11 @@ local function get_config_dir() end elseif os_uname.sysname == "Linux" then sys_config = "linux" - else + elseif os_uname.sysname == "Windows_NT" then sys_config = "win" + else + vim.notify "OS not supported!" + return end return string.format("%s/mason/packages/jdtls/config_%s", vim.fn.stdpath "data", sys_config) @@ -118,11 +121,15 @@ local config = { runtimes = { { name = "JavaSE-17", - path = "/Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home", + path = "C:/Program Files/Amazon Corretto/jdk17.0.13_11", }, { - name = "JavaSE-21", - path = "/Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home", + name = "JavaSE-1.8", + path = "C:/Program Files/Amazon Corretto/jdk1.8.0_432", + }, + { + name = "JavaSE-11", + path = "C:/Program Files/Amazon Corretto/jdk11.0.25_9", }, }, }, @@ -357,4 +364,4 @@ if vim.fn.filereadable(root_dir .. "/gradlew") then nargs = "?", complete = get_gradle_tasks, }) -end +end \ No newline at end of file diff --git a/after/indent/freemarker.vim b/after/indent/freemarker.vim new file mode 100644 index 0000000..642b34d --- /dev/null +++ b/after/indent/freemarker.vim @@ -0,0 +1,71 @@ +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +runtime! indent/html.vim +let s:htmlindent = &indentexpr +setlocal indentexpr=FreemarkerIndent() + +let s:tags = [] +let s:closetags = [] +let s:special= [] + +" Conditional and block tags. +call add(s:tags, 'if') +call add(s:tags, 'elseif') +call add(s:tags, 'else') +call add(s:tags, 'attempt') +call add(s:tags, 'recover') +call add(s:tags, 'list') +call add(s:tags, 'break') +call add(s:tags, 'macro') +call add(s:tags, 'nested') +call add(s:tags, 'switch') +call add(s:tags, 'case') +call add(s:tags, 'default') +call add(s:tags, 'items') + +" Conditional and block ending tags. +call add(s:closetags, 'if') +call add(s:closetags, 'attempt') +call add(s:closetags, 'list') +call add(s:closetags, 'macro') +call add(s:closetags, 'switch') +call add(s:closetags, 'items') + +" Special tags that indent back. +call add(s:special, 'elseif') +call add(s:special, 'else') +call add(s:special, 'recover') + +let s:tag_expr = join(s:tags, '\|') +let s:tag_close_expr = join(s:closetags, '\|') +let s:special_expr = join(s:special, '\|') + +function! FreemarkerIndent() + let line = getline(v:lnum) + let previousNum = prevnonblank(v:lnum - 1) + + " Hit the start of the file, use zero indent. + if previousNum == 0 + return 0 + endif + + let previous = getline(previousNum) + + if previous =~'<#\('.s:tag_expr.'\)' + return indent(previousNum) + &tabstop + endif + + if line =~'" +syntax match freemarkerFunction "(" +syntax match freemarkerFunction ")" +syntax match freemarkerFunction "\[" +syntax match freemarkerFunction "\]" +syntax match freemarkerFunction "\v/" +"}}} + +"variables {{{ +"variable type @s.example +syntax match freemarkerFunction "\v\@\S*" + +"External variables ${example.test} +syntax region freemarkerSpecialChar start=+${+ end=+}+ +"}}} + +"Conditionals and blocs {{{ +syntax match freemarkerConditional "\v\v\#if|\#else" +syntax match freemarkerConditional "\v\#elseif" +syntax match freemarkerConditional "\v\#attemp" +syntax match freemarkerConditional "\v\#recover" +syntax match freemarkerConditional "\v\#list" +syntax match freemarkerConditional "\v\#break" +syntax match freemarkerConditional "\v\#macro" +syntax match freemarkerConditional "\v\#nested" +syntax match freemarkerConditional "\v\#switch" +syntax match freemarkerConditional "\v\#case" +syntax match freemarkerConditional "\v\#default" +syntax match freemarkerConditional "\v\#items" +"}}} + +"Basic operators {{{ +syntax match freemarkerOperator "\v\*" +syntax match freemarkerOperator "\v/" +syntax match freemarkerOperator "\v\+" +syntax match freemarkerOperator "\v-" +syntax match freemarkerOperator "\v\?" +syntax match freemarkerOperator "\v\*\=" +syntax match freemarkerOperator "\v/\=" +syntax match freemarkerOperator "\v\+\=" +syntax match freemarkerOperator "\v-\=" +syntax match freemarkerOperator "\v\=" +"}}} + +"Strings and comments {{{ +syntax match freemarkerString '\v".*"' +syntax match freemarkerComment "\v\<#--.*--\>" +"}}} + +"highlighting groups {{{ +highlight link freemarkerConditional Conditional +highlight link freemarkerOperator Operator +highlight link freemarkerFunction Function +highlight link freemarkerSpecialChar SpecialChar +highlight link freemarkerString String +highlight link freemarkerComment Comment +highlight link freemarkerKeyword Keyword +highlight link freemarkerBoolean Boolean +"}}} + +let b:current_syntax = "freemarker" \ No newline at end of file diff --git a/lazy-lock.json b/lazy-lock.json index 296b268..3e824da 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,16 +1,15 @@ { - "SchemaStore.nvim": { "branch": "main", "commit": "e43f3e47991bc9f6cbc1d8b4d0f6a0d8d6c29284" }, + "SchemaStore.nvim": { "branch": "main", "commit": "fa47222e29d6f6e80eddcdd0f125c27edf274ad5" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, - "blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" }, + "blink.cmp": { "branch": "main", "commit": "d534f9e8bf39299c480e0c2e11dad21f51cfb2fe" }, "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, - "conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" }, + "conform.nvim": { "branch": "master", "commit": "990d37017e193fe40bdabf058e598e76f5e7d929" }, "data-viewer.nvim": { "branch": "main", "commit": "40ddf37bb7ab6c04ff9e820812d1539afe691668" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, "kurayami.nvim": { "branch": "main", "commit": "cea7998ddbad73aa834e8fb3765711750c40c18a" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, - "markdown.nvim": { "branch": "main", "commit": "6fbd1491abc104409f119685de5353c35c97c005" }, + "markdown.nvim": { "branch": "main", "commit": "c00cc1e2cbd5a55ca0c6c2e27fcf4a02ff731434" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" }, @@ -19,15 +18,15 @@ "molten-nvim": { "branch": "main", "commit": "c621baf53459a6c45dfd98dcc11cbba7a7ae9470" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "ffb077e65259f13be096ea6d603e3575a76b214a" }, + "nvim-dap": { "branch": "master", "commit": "0e673accbb512e1e191dfb4fecea89cc38c1bcdd" }, "nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" }, "nvim-dbee": { "branch": "master", "commit": "21d2cc0844a16262bb6ea93ab3d0a0f20bd87853" }, - "nvim-jdtls": { "branch": "master", "commit": "8f14aa1922ee5491ded1079a6576fae834535658" }, + "nvim-jdtls": { "branch": "master", "commit": "266d0cb912bbe61d66b43c5e73db19a364380360" }, "nvim-lint": { "branch": "master", "commit": "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55" }, - "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, + "nvim-lspconfig": { "branch": "master", "commit": "a8ef5e6e497b3ebeaaf35b939c07c211563b2e05" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-notify": { "branch": "master", "commit": "c3797193536711b5d8983975791c4b11dc35ab3a" }, - "nvim-treesitter": { "branch": "master", "commit": "4b222913486ec0a5983efa82b0649a2ab87cf1f0" }, + "nvim-notify": { "branch": "master", "commit": "bd9cd51f9ef2f6326fc2bc9931d0718c1794e247" }, + "nvim-treesitter": { "branch": "master", "commit": "cfbc1c0e0ff63e5b5e37b465b915b95fc2e98cef" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "d8b74fa87afc6a1e97b18da23e762efb032dc270" }, "nvim-ufo": { "branch": "main", "commit": "32cb247b893a384f1888b9cd737264159ecf183c" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, @@ -36,10 +35,9 @@ "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "quarto-nvim": { "branch": "main", "commit": "1cb2d24d7793241bd43f38e3a6f99a6d11f84458" }, - "rest.nvim": { "branch": "main", "commit": "c7944769dc489b9e4bc493e40820c2818eab2569" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, - "vimtex": { "branch": "master", "commit": "b8bb79b5fb27e9030ade92e75cd9375416f2c666" }, + "vimtex": { "branch": "master", "commit": "56def42c4f3007979c38001518ebb92ea8fb5f72" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } } diff --git a/lua/lib/init.lua b/lua/lib/init.lua index 1346766..296d185 100644 --- a/lua/lib/init.lua +++ b/lua/lib/init.lua @@ -89,9 +89,10 @@ end ---Projects function M.projects() local projs_folders = { - vim.fn.expand "~/Documents/developer", - vim.fn.expand "~/dev", - vim.fn.expand "~/uni", + vim.fn.expand "C:/Users/kmanca/work/spagic/wksp", + vim.fn.expand "C:/wso2/wksp/Git", + vim.fn.expand "C:/wso2/wksp", + vim.fn.expand "C:/ENG", } local projects = {} for _, value in pairs(projs_folders) do diff --git a/lua/plugins/editor/completion.lua b/lua/plugins/editor/completion.lua index 46f8cf3..f07443a 100644 --- a/lua/plugins/editor/completion.lua +++ b/lua/plugins/editor/completion.lua @@ -16,13 +16,16 @@ return { [""] = {}, [""] = { "select_prev", "fallback" }, [""] = { "select_next", "fallback" }, - [""] = { "select_and_accept" }, + [""] = { "select_and_accept", "show" }, [""] = { "snippet_forward", "fallback" }, [""] = { "snippet_backward", "fallback" }, - [""] = { "show", "show_documentation", "hide_documentation" }, + [""] = { "show", "show_documentation", "hide_documentation" }, cmdline = { + [""] = { "select_and_accept" }, [""] = { "select_and_accept", "fallback" }, + [""] = { "select_next", "fallback" }, + [""] = { "select_prev", "fallback" }, [""] = { "select_prev", "fallback" }, [""] = { "select_next", "fallback" }, [""] = { "show", "hide" }, @@ -34,13 +37,8 @@ return { }, sources = { - default = { "snippets", "lsp", "path", "buffer", "lazydev" }, + default = { "snippets", "lsp", "path", "buffer" }, providers = { - lazydev = { - name = "LazyDev", - module = "lazydev.integrations.blink", - score_offset = 100, - }, snippets = { opts = { extended_filetypes = { @@ -63,10 +61,10 @@ return { }, }, completion = { - keyword = { - regex = "[-_/]\\|\\k", - exclude_from_prefix_regex = "[\\.]", - }, + -- keyword = { + -- regex = "[-_/]\\|\\k", + -- exclude_from_prefix_regex = "[\\.]", + -- }, accept = { auto_brackets = { enabled = true }, }, diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index d511b4c..0d4680d 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -218,22 +218,7 @@ return { local lspconfig = require "lspconfig" local default_lsp_config = get_default_lsp_config() - -- require("lspconfig.ui.windows").default_options.border = "rounded" - - -- sourcekit is still not available on mason-lspconfig - lspconfig.sourcekit.setup(vim.tbl_deep_extend("force", default_lsp_config, { - cmd = { - vim.fn.glob( - "/Applications/Xcode*.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp", - true, - true - )[1], - }, - filetypes = { "swift" }, - root_dir = function() - vim.fs.root(0, ".git") - end, - })) + -- lspconfig.freemarker_ls.setup(vim.tbl_deep_extend("keep", default_lsp_config, {})) vim.keymap.set("n", "l", function() end, { desc = "LSP" }) -- Global Diagnostics keymaps @@ -285,6 +270,7 @@ return { -- "lua_ls", -- "vimls", "marksman", + "groovyls", -- "ts_ls", -- "sqls", -- "pyright", @@ -312,6 +298,37 @@ return { -- 'ftplugin/java.lua' jdtls = function() end, + groovyls = function() + lspconfig.groovyls.setup(vim.tbl_deep_extend("force", default_lsp_config, { + + root_dir = function() + return vim.fs.dirname(vim.api.nvim_buf_get_name(0)) + end, + settings = { + groovy = { + classpath = { + [[C:\Program Files\Java\jre1.8.0_421\lib\rt.jar]], + [[C:\Intel\spagic-studio-win-3.5.1-64Bit\spagic-studio-win-3.5.1-64Bit\spagic-studio\plugins\]], + [[C:\Intel\spagic-studio-win-3.5.1-64Bit\spagic-studio-win-3.5.1-64Bit\spagic-studio\]], + [[C:\Intel\eclipseWSO2\plugins\]], + [[C:\wso2ei\wso2\components\plugins\]], + -- [[C:\wso2ei-eng-1.1.1\patches\patch0000]], + [[C:\wso2ei\patches\patch00001]], + [[C:\wso2ei\patches\patch00002]] + }, + project = { + referencedLibraries = { + include = { + "C:/wso2_Developer/plugins/**/*.jar", + "C:/wso2/wksp/**/*.jar", + } + } + } + } + } + })) + end, + -- Custom setup and overrides for servers lua_ls = function() local runtime_path = vim.split(package.path, ";") @@ -422,88 +439,6 @@ return { })) end, - pyright = function() - lspconfig.pyright.setup(vim.tbl_deep_extend("force", default_lsp_config, { - settings = { - python = { - analysis = { - autoSearchPaths = true, - useLibraryCodeForTypes = false, - diagnosticMode = "workspace", - }, - }, - }, - root_dir = function(fname) - return vim.fs.root(0, { - ".git", - "setup.py", - "setup.cfg", - "pyproject.toml", - "requirements.txt", - fname, - }) or vim.fs.dirname(fname) - end, - })) - end, - - clangd = function() - lspconfig.clangd.setup(vim.tbl_deep_extend("force", default_lsp_config, { - init_options = { - clangdFileStatus = true, - }, - inlayHints = { - enabled = true, - parameterNames = true, - deducedTypes = true, - }, - })) - end, - - gopls = function() - lspconfig.gopls.setup(vim.tbl_deep_extend("force", default_lsp_config, { - root_dir = function(fname) - return lsputil.root_pattern("go.mod", "go.work", ".git")(fname) - end, - settings = { - gopls = { - codelenses = { - test = true, - gc_details = true, - generate = true, - regenerate_cgo = true, - tidy = true, - upgrade_dependency = true, - vendor = true, - }, - analyses = { - unusedparams = true, - }, - staticcheck = true, - }, - }, - })) - end, - - ts_ls = function() - lspconfig.ts_ls.setup(vim.tbl_deep_extend("force", default_lsp_config, { - filetypes = { "js", "javascript", "typescript", "ojs", "typescriptreact", "typescript.tsx" }, - root_dir = function() - return vim.fs.root(0, { - "tsconfig.json", - "package.json", - "jsconfig.json", - ".git", - }) or vim.uv.cwd() - end, - init_options = { - preferences = { - includeCompletionsWithSnippetText = true, - includeCompletionsForImportStatements = true, - }, - }, - })) - end, - bashls = function() lspconfig.bashls.setup(vim.tbl_deep_extend("force", default_lsp_config, { cmd = { "bash-language-server", "start" }, @@ -517,18 +452,6 @@ return { -- end, })) end, - - intelephense = function() - lspconfig.intelephense.setup(vim.tbl_deep_extend("force", default_lsp_config, { - root_dir = function() - return vim.fs.root(0, { "composer.json", ".git" }) or vim.uv.cwd() - end, - init_options = { - globalStoragePath = vim.fn.expand "~/.local/php/", - -- clearCache = true - }, - })) - end, } end, }, @@ -584,15 +507,16 @@ return { }, config = function(_, o) local conform = require "conform" + vim.g.disable_autoformat = true o.formatters_by_ft = { - lua = { "stylua" }, - python = { "black" }, + -- lua = { "stylua" }, + -- python = { "black" }, bash = { "beautysh" }, - zsh = { "beautysh" }, + -- zsh = { "beautysh" }, -- css = { "prettier" }, - javascript = { "prettier" }, - typescriptreact = { "prettier" }, + -- javascript = { "prettier" }, + -- typescriptreact = { "prettier" }, html = { "prettier" }, json = { "prettier" }, yaml = { { "yamlfmt", "prettier" } }, @@ -645,6 +569,9 @@ return { ---NeovimDevelopment { "folke/lazydev.nvim", + enabled = function() + return vim.fn.has "win32" ~= 1 + end, ft = "lua", opts = {}, }, diff --git a/plugin/autocommands.lua b/plugin/autocommands.lua index b01e226..1c0ad05 100644 --- a/plugin/autocommands.lua +++ b/plugin/autocommands.lua @@ -292,6 +292,15 @@ autocmd("FileType", { end, }) +---Freemarker +autocmd({ "BufNewFile", "BufRead" }, { + group = augroup("_freemarker", { clear = true }), + pattern = { "*.ftl" }, + callback = function(e) + vim.bo[e.buf].filetype = "freemarker" + end, +}) + ---Templates autocmd("BufNewFile", { group = vim.api.nvim_create_augroup("templates", { clear = true }), @@ -324,4 +333,4 @@ autocmd("BufNewFile", { end end end, -}) +}) \ No newline at end of file diff --git a/plugin/keymaps.lua b/plugin/keymaps.lua index fefe867..c7c41b2 100644 --- a/plugin/keymaps.lua +++ b/plugin/keymaps.lua @@ -90,20 +90,8 @@ nmap { end, "Quit", } -nmap { - "nn", - function() - vim.cmd.Notifications() - end, - "Notifications", -} -nmap { - "nm", - function() - vim.cmd.messages() - end, - "Messages", -} +nmap { "nn", "Notifications", "Notifications" } +nmap { "nm", "messages", "Messages" } nmap { "Q", function() diff --git a/snippets/general/freemarker.json b/snippets/general/freemarker.json new file mode 100644 index 0000000..fd19113 --- /dev/null +++ b/snippets/general/freemarker.json @@ -0,0 +1,39 @@ +{ + "define-variable": { + "prefix": "as", + "body": "<#assign ${1:varName} = ${2:value}>$0", + "description": "Assign value to variable" + }, + "if-statement": { + "prefix": "if", + "body": [ + "<#if ${1:condition}>", + "\t${2:body}", + "", + "$0" + ], + "description": "If statement" + }, + "if-else-statement": { + "prefix": "ife", + "body": [ + "<#if ${1:condition}>", + "\t${2:body}", + "<#else>", + "\t${3:body2}", + "", + "$0" + ], + "description": "If-else statement" + }, + "list-statement": { + "prefix": "lst", + "body": [ + "<#list ${1:listToIterate}>", + "\t${2:body}", + "", + "$0" + ], + "description": "If statement" + } +} \ No newline at end of file diff --git a/snippets/general/groovy.json b/snippets/general/groovy.json new file mode 100644 index 0000000..9f0493e --- /dev/null +++ b/snippets/general/groovy.json @@ -0,0 +1,170 @@ +{ + "var": { + "prefix": "def", + "body": ["def ${1:varName} = ${2:value}$0"], + "description": "Define Variable without type" + }, + "string_literal": { + "prefix": "slt", + "body": ["\"\"\"${1:stringValue}\"\"\"$0"], + "description": "String Literal" + }, + "fileappend": { + "prefix": "filea", + "body": ["file.append(${1:valueToAppend});$0"], + "description": "Append data to file" + }, + "main": { + "prefix": "main", + "body": ["public static void main(String[] args) {", "\t$0", "}"], + "description": "Public static main method" + }, + "class": { + "prefix": "class", + "body": ["public class ${TM_FILENAME_BASE} {", "\t$0", "}"], + "description": "Public class" + }, + "sysout": { + "prefix": "println", + "body": ["println($0);"], + "description": "Print to standard out" + }, + "fori": { + "prefix": "fori", + "body": [ + "for (${1:int} ${2:i} = ${3:0}; $2 < ${4:max}; $2++) {", + "\t$0", + "}" + ], + "description": "Indexed for loop" + }, + "foreach": { + "prefix": "foreach", + "body": ["for (${1:type} ${2:var} : ${3:iterable}) {", "\t$0", "}"], + "description": "Enhanced for loop" + }, + "Public constructor": { + "prefix": "ctor", + "body": [ + "public ${1:${TM_FILENAME_BASE}}($2) {", + "\t${0:super();}", + "}" + ], + "description": "Public constructor" + }, + "if": { + "prefix": "if", + "body": ["if (${1:condition}) {", "\t$0", "}"], + "description": "if statement" + }, + "ifelse": { + "prefix": "ifelse", + "body": ["if (${1:condition}) {", "\t$2", "} else {", "\t$0", "}"], + "description": "if/else statement" + }, + "ifnull": { + "prefix": "ifnull", + "body": ["if (${1:condition} == null) {", "\t$0", "}"], + "description": "if statement checking for null" + }, + "ifnotnull": { + "prefix": "ifnotnull", + "body": ["if (${1:condition} != null) {", "\t$0", "}"], + "description": "if statement checking for not null" + }, + "trycatch": { + "prefix": "try_catch", + "body": [ + "try {", + "\t$1", + "} catch (${2:Exception} ${3:e}) {", + "\t$4//${0:TODO}: handle exception", + "}" + ], + "description": "try/catch block" + }, + "tryresources": { + "prefix": "try_resources", + "body": [ + "try ($1) {", + "\t$2", + "} catch (${3:Exception} ${4:e}) {", + "\t$5//${0:TODO}: handle exception", + "}" + ] + }, + "private_method": { + "prefix": "private_method", + "body": ["private ${1:void} ${2:name}($3) {", "\t$0", "}"], + "description": "private method" + }, + "Public method": { + "prefix": "public_method", + "body": ["public ${1:void} ${2:name}(${3}) {", "\t$0", "}"], + "description": "public method" + }, + "Private static method": { + "prefix": "private_static_method", + "body": ["private static ${1:Type} ${2:name}(${3}) {", "\t$0", "}"], + "description": "private static method" + }, + "Public static method": { + "prefix": "public_static_method", + "body": ["public static ${1:void} ${2:name}(${3}) {", "\t$0", "}"], + "description": "public static method" + }, + "Protected Method": { + "prefix": "protected_method", + "body": ["protected ${1:void} ${2:name}(${3}) {", "\t$0", "}"], + "description": "Protected method" + }, + "Switch Statement": { + "prefix": "switch", + "body": [ + "switch (${1:key}) {", + "\tcase ${2:value}:", + "\t\t$0", + "\t\tbreak;", + "", + "\tdefault:", + "\t\tbreak;", + "}" + ], + "description": "Switch Statement" + }, + "While Statement": { + "prefix": "while", + "body": ["while (${1:condition}) {", "\t$0", "}"], + "description": "While Statement" + }, + "Do-While Statement": { + "prefix": "dowhile", + "body": ["do {", "\t$0", "} while (${1:condition});"], + "description": "Do-While Statement" + }, + "newObject": { + "prefix": "new", + "body": ["${1:Object} ${2:foo} = new ${1:Object}();"], + "description": "Create new Object" + }, + "Public field": { + "prefix": "public_field", + "body": ["public ${1:String} ${2:name};"], + "description": "Public field" + }, + "Private field": { + "prefix": "private_field", + "body": ["private ${1:String} ${2:name};"], + "description": "Private field" + }, + "Protected field": { + "prefix": "protected_field", + "body": ["protected ${1:String} ${2:name};"], + "description": "Protected field" + }, + "import": { + "prefix": "import", + "body": ["import ${1:PackageName}"], + "description": "Import statement" + } +} \ No newline at end of file diff --git a/snippets/general/xsl.json b/snippets/general/xsl.json new file mode 100644 index 0000000..cde26ce --- /dev/null +++ b/snippets/general/xsl.json @@ -0,0 +1,51 @@ +{ + "value": { + "prefix": "vof", + "body": "$0", + "description": "xsl value-of" + }, + "variable": { + "prefix": "var", + "body": "$0", + "description": "xsl variable" + }, + "for-each statement": { + "prefix": "fore", + "body": [ + "", + "\t${2:body}", + "", + "$0" + ], + "description": "xsl for-each" + }, + "choose statemnent": { + "prefix": "chs", + "body": [ + "", + "\t", + "\t\t", + "\t", + "\t", + "\t\t", + "\t", + "\t", + "\t\t", + "\t", + "" + ], + + "description": "xsl choose" + }, + "if statement": { + "prefix": "if", + "body": [ + "", + "\t${2:body}", + "", + "$0" + ], + "description": "xsl if statement" + } +} + diff --git a/snippets/package.json b/snippets/package.json index a03a278..e681fe6 100644 --- a/snippets/package.json +++ b/snippets/package.json @@ -100,8 +100,12 @@ "path": "./general/go.json" }, { - "language": "fennel", - "path": "./general/fennel.json" + "language": "groovy", + "path": "./general/groovy.json" + }, + { + "language": "freemarker", + "path": "./general/freemarker.json" }, { "language": "fsh", @@ -119,18 +123,10 @@ "language": "quarto", "path": "./general/quarto.json" }, - { - "language": "rescript", - "path": "./general/rescript.json" - }, { "language": "ruby", "path": "./general/ruby/ruby.json" }, - { - "language": "rdoc", - "path": "./general/ruby/rdoc.json" - }, { "language": "rust", "path": "./general/rust/rust.json" @@ -179,7 +175,7 @@ "path": "./general/latex.json" }, { - "language": "java", + "language": "java", "path": "./general/java/java.json" }, { @@ -391,7 +387,13 @@ "plist" ], "path": "./general/xml.json" + }, + { + "language": [ + "xsl", "xslt" + ], + "path": "./general/xsl.json" } ] } -} +} \ No newline at end of file