From 292e79137f169b7363f002c4ce38df3abd474355 Mon Sep 17 00:00:00 2001 From: Pojok Code Date: Mon, 11 Nov 2024 22:47:41 +0700 Subject: [PATCH] enc: add dynamic project gradle and maven --- lazy-lock.json | 22 +- lua/pcode/plugins/lang/java.lua | 546 ++++++++++++++++---------------- lua/pcode/user/default.lua | 2 +- 3 files changed, 287 insertions(+), 283 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 76dd51a..18f86c5 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,7 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "Eva-Theme.nvim": { "branch": "master", "commit": "5e0ee05b7b803cbd781612d484b0796c45946a3d" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "2737edc9e674e537dc0a97e3405658d57d2d31ed" }, "alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" }, "auto-bufferline.nvim": { "branch": "main", "commit": "f5835a4b62bfb6f6c829f8f050e5102ccf230b3e" }, @@ -18,14 +19,13 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "code_runner.nvim": { "branch": "main", "commit": "dcedccbf969a0f3bc00db446172b4966e83101dd" }, "codeium.vim": { "branch": "main", "commit": "8c01979323b2b480c8bf160d3ff85bd1668baa49" }, - "conform.nvim": { "branch": "master", "commit": "e3263eabbfc1bdbc5b6a60ba8431b64e8dca0a79" }, - "dressing.nvim": { "branch": "master", "commit": "6ef1ca479d37d4ff66f13eed44d08912caff483a" }, + "conform.nvim": { "branch": "master", "commit": "8c354323201d04530727d8bdcc4669791ee082ef" }, + "dressing.nvim": { "branch": "master", "commit": "43b8f74e0b1e3f41e51f640f8efa3bcd401cea0d" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" }, "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, - "indent-blankline.nvim": { "branch": "master", "commit": "e51b651ca26cba250ef3a1150c8d35045eee2a84" }, - "lazy.nvim": { "branch": "main", "commit": "60cf258a9ae7fffe04bb31141141a91845158dcc" }, - "lua-async-await": { "branch": "main", "commit": "652d94df34e97abe2d4a689edbc4270e7ead1a98" }, + "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, + "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, @@ -33,6 +33,8 @@ "menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" }, "mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" }, "minty": { "branch": "main", "commit": "1b604ed0d741294cfb56c0ce3aa6161e9ae7dd8b" }, + "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, + "neotest-java": { "branch": "main", "commit": "320f31c71b183f2c584198f33f93542fd0e5a768" }, "noice.nvim": { "branch": "main", "commit": "2087bbf8cd64482b47fb5f33b5e0eabf329ab14b" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, @@ -41,11 +43,7 @@ "nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, - "nvim-java": { "branch": "main", "commit": "905013eb83c58bda992724b3ecbe20f60b58513f" }, - "nvim-java-core": { "branch": "main", "commit": "5b03dca22fee76524a89e1c2dc1d73a9f0b1a3bb" }, - "nvim-java-dap": { "branch": "main", "commit": "55f239532f7a3789d21ea68d1e795abc77484974" }, - "nvim-java-refactor": { "branch": "main", "commit": "ea1420fed5463c9cc976c2b4175f434b3646f0f7" }, - "nvim-java-test": { "branch": "main", "commit": "7f0f40e9c5b7eab5096d8bec6ac04251c6e81468" }, + "nvim-jdtls": { "branch": "master", "commit": "c4279b8ffce9b64eb302056d78dfebc2968a49bc" }, "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, "nvim-lspconfig": { "branch": "master", "commit": "4cb925e96288a71409a86c84fd97f4434a95453e" }, "nvim-material-icon": { "branch": "main", "commit": "38fc13fe4811c4bf62533180ff5e7bbd237c5ef5" }, @@ -54,7 +52,7 @@ "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, "nvim-scrollview": { "branch": "main", "commit": "f7f611330a8f7cd00dc81538fec369611be678ed" }, "nvim-tree.lua": { "branch": "master", "commit": "28eac2801b201f301449e976d7a9e8cfde053ba3" }, - "nvim-treesitter": { "branch": "master", "commit": "8e40904e49bbad5812798eb54be8c00d77cdd301" }, + "nvim-treesitter": { "branch": "master", "commit": "bb06afa3f1111780932b3c5493ad65473ce85f9d" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, @@ -62,7 +60,7 @@ "rainbow-delimiters.nvim": { "branch": "master", "commit": "f22496dfdd46da4d571f5254c72eff65ff5a1c27" }, "refactoring.nvim": { "branch": "master", "commit": "53ed6854e0bba64d467c58e87084dcf8b1c22d36" }, "smart-splits.nvim": { "branch": "master", "commit": "ea4702652cb1d18811d60f2e206787602a2e946c" }, - "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, + "symbols-outline.nvim": { "branch": "master", "commit": "964c5902243446124417a3a9e9454f5ef032cc36" }, "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "a39fa4c92268832f6034306793b8acbfec2a7549" }, "toggleterm.nvim": { "branch": "main", "commit": "87b2d6a3cab8e2bd9a0255427074285f0365398d" }, diff --git a/lua/pcode/plugins/lang/java.lua b/lua/pcode/plugins/lang/java.lua index 5f4fdd1..abb776d 100644 --- a/lua/pcode/plugins/lang/java.lua +++ b/lua/pcode/plugins/lang/java.lua @@ -7,248 +7,254 @@ local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" } ---@param config table ---@param custom function | table | nil local function extend_or_override(config, custom, ...) - if type(custom) == "function" then - config = custom(config, ...) or config - elseif custom then - config = vim.tbl_deep_extend("force", config, custom) --[[@as table]] - end - return config + if type(custom) == "function" then + config = custom(config, ...) or config + elseif custom then + config = vim.tbl_deep_extend("force", config, custom) --[[@as table]] + end + return config end M = { - { - "williamboman/mason-lspconfig.nvim", - opts = function(_, opts) - opts.skip_config = opts.skip_config or {} - vim.list_extend(opts.skip_config, { "jdtls" }) - end, - }, - { - "mfussenegger/nvim-jdtls", - ft = java_filetypes, - enabled = true, - opts = function() - return { - root_dir = require("jdtls.setup").find_root(root_markers), - project_name = function() - return vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") - end, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + opts.skip_config = opts.skip_config or {} + vim.list_extend(opts.skip_config, { "jdtls" }) + end, + }, + { + "mfussenegger/nvim-jdtls", + ft = java_filetypes, + enabled = true, + opts = function() + return { + root_dir = require("jdtls.setup").find_root(root_markers), + project_name = function() + return vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") + end, - -- Where are the config and workspace dirs for a project? - jdtls_config_dir = function(project_name) - return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config" - end, - jdtls_workspace_dir = function(project_name) - return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/workspace" - end, - cmd = { vim.fn.exepath("jdtls") }, - full_cmd = function(opts) - local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") - local cmd = vim.deepcopy(opts.cmd) - if project_name then - vim.list_extend(cmd, { - "-configuration", - opts.jdtls_config_dir(project_name), - "-data", - opts.jdtls_workspace_dir(project_name), - }) - end - return cmd - end, + -- Where are the config and workspace dirs for a project? + jdtls_config_dir = function(project_name) + return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config" + end, + jdtls_workspace_dir = function(project_name) + return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/workspace" + end, + cmd = { vim.fn.exepath("jdtls") }, + full_cmd = function(opts) + local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") + local cmd = vim.deepcopy(opts.cmd) + if project_name then + vim.list_extend(cmd, { + "-configuration", + opts.jdtls_config_dir(project_name), + "-data", + opts.jdtls_workspace_dir(project_name), + }) + end + return cmd + end, - -- These depend on nvim-dap, but can additionally be disabled by setting false here. - dap = { hotcodereplace = "auto", config_overrides = {} }, - dap_main = {}, - test = true, - settings = { - java = { - inlayHints = { - parameterNames = { - enabled = "all", - }, - }, - }, - }, - } - end, - config = function(_, opts) - local opt = vim.opt - opt.shiftwidth = 4 - opt.tabstop = 4 - opt.softtabstop = 4 - opt.ts = 4 - opt.expandtab = true + -- These depend on nvim-dap, but can additionally be disabled by setting false here. + dap = { hotcodereplace = "auto", config_overrides = {} }, + dap_main = {}, + test = true, + settings = { + java = { + inlayHints = { + parameterNames = { + enabled = "all", + }, + }, + }, + }, + } + end, + config = function(_, opts) + local opt = vim.opt + opt.shiftwidth = 4 + opt.tabstop = 4 + opt.softtabstop = 4 + opt.ts = 4 + opt.expandtab = true - local mason_registry = require("mason-registry") - local bundles = {} ---@type string[] - if opts.dap and mason_registry.is_installed("java-debug-adapter") then - local java_dbg_pkg = mason_registry.get_package("java-debug-adapter") - local java_dbg_path = java_dbg_pkg:get_install_path() - local jar_patterns = { - java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar", - } - -- java-test also depends on java-debug-adapter. - if opts.test and mason_registry.is_installed("java-test") then - local java_test_pkg = mason_registry.get_package("java-test") - local java_test_path = java_test_pkg:get_install_path() - vim.list_extend(jar_patterns, { - java_test_path .. "/extension/server/*.jar", - }) - end - for _, jar_pattern in ipairs(jar_patterns) do - for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do - table.insert(bundles, bundle) - end - end - end + local mason_registry = require("mason-registry") + local bundles = {} ---@type string[] + if opts.dap and mason_registry.is_installed("java-debug-adapter") then + local java_dbg_pkg = mason_registry.get_package("java-debug-adapter") + local java_dbg_path = java_dbg_pkg:get_install_path() + local jar_patterns = { + java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar", + } + -- java-test also depends on java-debug-adapter. + if opts.test and mason_registry.is_installed("java-test") then + local java_test_pkg = mason_registry.get_package("java-test") + local java_test_path = java_test_pkg:get_install_path() + vim.list_extend(jar_patterns, { + java_test_path .. "/extension/server/*.jar", + }) + end + for _, jar_pattern in ipairs(jar_patterns) do + for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do + table.insert(bundles, bundle) + end + end + end - local function attach_jdtls() - local fname = vim.api.nvim_buf_get_name(0) + local function attach_jdtls() + local fname = vim.api.nvim_buf_get_name(0) - -- Configuration can be augmented and overridden by opts.jdtls - local config = extend_or_override({ - cmd = opts.full_cmd(opts), - root_dir = require("jdtls.setup").find_root(root_markers), - init_options = { - bundles = bundles, - }, - settings = opts.settings, - -- enable CMP capabilities - -- capabilities = require("user.lsp.handlers").capabilities or nil, - capabilities = require("auto-lsp.lsp.handlers").capabilities or nil, - }, opts.jdtls) + -- Configuration can be augmented and overridden by opts.jdtls + local config = extend_or_override({ + cmd = opts.full_cmd(opts), + root_dir = require("jdtls.setup").find_root(root_markers), + init_options = { + bundles = bundles, + }, + settings = opts.settings, + -- enable CMP capabilities + -- capabilities = require("user.lsp.handlers").capabilities or nil, + capabilities = require("auto-lsp.lsp.handlers").capabilities or nil, + }, opts.jdtls) - -- Existing server will be reused if the root_dir matches. - require("jdtls").start_or_attach(config) - -- not need to require("jdtls.setup").add_commands(), start automatically adds commands - end + -- Existing server will be reused if the root_dir matches. + require("jdtls").start_or_attach(config) + -- not need to require("jdtls.setup").add_commands(), start automatically adds commands + end - vim.api.nvim_create_autocmd("FileType", { - pattern = java_filetypes, - callback = attach_jdtls, - }) + vim.api.nvim_create_autocmd("FileType", { + pattern = java_filetypes, + callback = attach_jdtls, + }) - -- Setup keymap and dap after the lsp is fully attached. - -- https://github.com/mfussenegger/nvim-jdtls#nvim-dap-configuration - -- https://neovim.io/doc/user/lsp.html#LspAttach - vim.api.nvim_create_autocmd("LspAttach", { - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client and client.name == "jdtls" then - local wk = require("which-key") - wk.add({ - { - mode = "n", - buffer = args.buf, - { "cx", group = "extract" }, - { "cxv", require("jdtls").extract_variable_all, desc = "Extract Variable" }, - { "cxc", require("jdtls").extract_constant, desc = "Extract Constant" }, - { "gs", require("jdtls").super_implementation, desc = "Goto Super" }, - { "co", require("jdtls").organize_imports, desc = "Organize Imports" }, - }, - }) - wk.add({ - { - mode = "v", - buffer = args.buf, - { "cx", group = "extract" }, - { - "cxm", - [[lua require('jdtls').extract_method(true)]], - desc = "Extract Method", - }, - { - "cxv", - [[lua require('jdtls').extract_variable_all(true)]], - desc = "Extract Variable", - }, - { - "cxc", - [[lua require('jdtls').extract_constant(true)]], - desc = "Extract Constant", - }, - }, - }) - if opts.dap and mason_registry.is_installed("java-debug-adapter") then - -- custom init for Java debugger - require("jdtls").setup_dap(opts.dap) - require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main) + -- Setup keymap and dap after the lsp is fully attached. + -- https://github.com/mfussenegger/nvim-jdtls#nvim-dap-configuration + -- https://neovim.io/doc/user/lsp.html#LspAttach + vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client and client.name == "jdtls" then + local wk = require("which-key") + wk.add({ + { + mode = "n", + buffer = args.buf, + { "cx", group = "extract" }, + { "cxv", require("jdtls").extract_variable_all, desc = "Extract Variable" }, + { "cxc", require("jdtls").extract_constant, desc = "Extract Constant" }, + { "gs", require("jdtls").super_implementation, desc = "Goto Super" }, + { "co", require("jdtls").organize_imports, desc = "Organize Imports" }, + }, + }) + wk.add({ + { + mode = "v", + buffer = args.buf, + { "cx", group = "extract" }, + { + "cxm", + [[lua require('jdtls').extract_method(true)]], + desc = "Extract Method", + }, + { + "cxv", + [[lua require('jdtls').extract_variable_all(true)]], + desc = "Extract Variable", + }, + { + "cxc", + [[lua require('jdtls').extract_constant(true)]], + desc = "Extract Constant", + }, + }, + }) + if opts.dap and mason_registry.is_installed("java-debug-adapter") then + -- custom init for Java debugger + require("jdtls").setup_dap(opts.dap) + require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main) - -- Java Test require Java debugger to work - -- if opts.test and mason_registry.is_installed("java-test") then - -- -- custom keymaps for Java test runner (not yet compatible with neotest) - -- wk.register({ - -- ["t"] = { name = "+test" }, - -- ["tt"] = { require("jdtls.dap").test_class, "Run All Test" }, - -- ["tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" }, - -- ["tT"] = { require("jdtls.dap").pick_test, "Run Test" }, - -- }, { mode = "n", buffer = args.buf }) - -- end - end + -- Java Test require Java debugger to work + -- if opts.test and mason_registry.is_installed("java-test") then + -- -- custom keymaps for Java test runner (not yet compatible with neotest) + -- wk.register({ + -- ["t"] = { name = "+test" }, + -- ["tt"] = { require("jdtls.dap").test_class, "Run All Test" }, + -- ["tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" }, + -- ["tT"] = { require("jdtls.dap").pick_test, "Run Test" }, + -- }, { mode = "n", buffer = args.buf }) + -- end + end - -- User can set additional keymaps in opts.on_attach - if opts.on_attach then - opts.on_attach(args) - end - end - end, - }) + -- User can set additional keymaps in opts.on_attach + if opts.on_attach then + opts.on_attach(args) + end + end + end, + }) - -- Avoid race condition by calling attach the first time, since the autocmd won't fire. - attach_jdtls() - end, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "java" }) - end, - }, - { - "williamboman/mason-lspconfig.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "jdtls" }) - end, - }, - { - "pojokcodeid/auto-conform.nvim", - event = "VeryLazy", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { "java-debug-adapter", "java-test" }) - opts.formatters_by_ft.java = { "lsp_fmt" } - end, - }, - { - "nvim-neotest/neotest", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "andy-bell101/neotest-java", - }, - config = function() - require("neotest").setup({ - adapters = { - require("neotest-java")({ - -- function to determine which runner to use based on project path - determine_runner = function(project_root_path) - -- return should be "maven" or "gradle" - return "gradle" - end, - -- override the builtin runner discovery behaviour to always use given - -- tool. Default is "nil", so no override - force_runner = nil, - -- if the automatic runner discovery can't uniquely determine whether - -- to use Gradle or Maven, fallback to using this runner. Default is - -- "gradle or maven" - fallback_runner = "gradle", - }), - }, - }) - end, + -- Avoid race condition by calling attach the first time, since the autocmd won't fire. + attach_jdtls() + end, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "java" }) + end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "jdtls" }) + end, + }, + { + "pojokcodeid/auto-conform.nvim", + event = "VeryLazy", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { "java-debug-adapter", "java-test" }) + opts.formatters_by_ft.java = { "lsp_fmt" } + end, + }, + { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "andy-bell101/neotest-java", + }, + config = function() + local project_type = "maven" + local gradle_file = vim.fn.findfile("build.gradle", vim.fn.getcwd()) + if gradle_file then + project_type = "gradle" + end + + require("neotest").setup({ + adapters = { + require("neotest-java")({ + -- function to determine which runner to use based on project path + determine_runner = function(project_root_path) + -- return should be "maven" or "gradle" + return project_type + end, + -- override the builtin runner discovery behaviour to always use given + -- tool. Default is "nil", so no override + force_runner = nil, + -- if the automatic runner discovery can't uniquely determine whether + -- to use Gradle or Maven, fallback to using this runner. Default is + -- "gradle or maven" + fallback_runner = project_type, + }), + }, + }) + end, -- stylua: ignore keys = { { "T","",desc="  Test"}, @@ -262,48 +268,48 @@ M = { { "TS", function() require("neotest").run.stop() end, desc = "Stop" }, { "rg", "terminalgradle run", desc = "Run Gradle", mode = "n" }, }, - }, - { - "rockerBOO/symbols-outline.nvim", - cmd = "SymbolsOutline", - config = function() - require("symbols-outline").setup({ - symbols = { - File = { icon = "󰈔", hl = "@text.uri" }, - Module = { icon = "", hl = "@namespace" }, - Namespace = { icon = "󰅪", hl = "@namespace" }, - Package = { icon = "", hl = "@namespace" }, - Class = { icon = "𝓒", hl = "@type" }, - Method = { icon = "ƒ", hl = "@method" }, - Property = { icon = "", hl = "@method" }, - Field = { icon = "", hl = "@field" }, - Constructor = { icon = "", hl = "@constructor" }, - Enum = { icon = "ℰ", hl = "@type" }, - Interface = { icon = "", hl = "@type" }, - Function = { icon = "", hl = "@function" }, - Variable = { icon = "", hl = "@constant" }, - Constant = { icon = "", hl = "@constant" }, - String = { icon = "𝓐", hl = "@string" }, - Number = { icon = "#", hl = "@number" }, - Boolean = { icon = "󰨙 ", hl = "@boolean" }, - Array = { icon = "", hl = "@constant" }, - Object = { icon = "⦿", hl = "@type" }, - Key = { icon = "🔐", hl = "@type" }, - Null = { icon = "NULL", hl = "@type" }, - EnumMember = { icon = "", hl = "@field" }, - Struct = { icon = "𝓢", hl = "@type" }, - Event = { icon = "🗲", hl = "@type" }, - Operator = { icon = "+", hl = "@operator" }, - TypeParameter = { icon = "𝙏", hl = "@parameter" }, - Component = { icon = "󰅴", hl = "@function" }, - Fragment = { icon = "󰅴", hl = "@constant" }, - }, - }) - end, - keys = { - { "S", "SymbolsOutline", desc = "Toggle Outline" }, - }, - }, + }, + { + "rockerBOO/symbols-outline.nvim", + cmd = "SymbolsOutline", + config = function() + require("symbols-outline").setup({ + symbols = { + File = { icon = "󰈔", hl = "@text.uri" }, + Module = { icon = "", hl = "@namespace" }, + Namespace = { icon = "󰅪", hl = "@namespace" }, + Package = { icon = "", hl = "@namespace" }, + Class = { icon = "𝓒", hl = "@type" }, + Method = { icon = "ƒ", hl = "@method" }, + Property = { icon = "", hl = "@method" }, + Field = { icon = "", hl = "@field" }, + Constructor = { icon = "", hl = "@constructor" }, + Enum = { icon = "ℰ", hl = "@type" }, + Interface = { icon = "", hl = "@type" }, + Function = { icon = "", hl = "@function" }, + Variable = { icon = "", hl = "@constant" }, + Constant = { icon = "", hl = "@constant" }, + String = { icon = "𝓐", hl = "@string" }, + Number = { icon = "#", hl = "@number" }, + Boolean = { icon = "󰨙 ", hl = "@boolean" }, + Array = { icon = "", hl = "@constant" }, + Object = { icon = "⦿", hl = "@type" }, + Key = { icon = "🔐", hl = "@type" }, + Null = { icon = "NULL", hl = "@type" }, + EnumMember = { icon = "", hl = "@field" }, + Struct = { icon = "𝓢", hl = "@type" }, + Event = { icon = "🗲", hl = "@type" }, + Operator = { icon = "+", hl = "@operator" }, + TypeParameter = { icon = "𝙏", hl = "@parameter" }, + Component = { icon = "󰅴", hl = "@function" }, + Fragment = { icon = "󰅴", hl = "@constant" }, + }, + }) + end, + keys = { + { "S", "SymbolsOutline", desc = "Toggle Outline" }, + }, + }, } return M diff --git a/lua/pcode/user/default.lua b/lua/pcode/user/default.lua index a88bd17..daf97c2 100644 --- a/lua/pcode/user/default.lua +++ b/lua/pcode/user/default.lua @@ -6,7 +6,7 @@ pcode.lang = { deno = false, golang = false, java = false, - java2 = true, + java2 = false, javascript = false, kotlin = false, markdown = false,