diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-09-07 17:32:59 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-09-07 17:32:59 +0200 |
| commit | 7152b5c26fbbfc4e84d8ccfa6917ca71fab14cc5 (patch) | |
| tree | b8e6356c47cfd36bd73f686d89a732297712c615 | |
| parent | 75c19f44876bc6833ecd5ccb0d715cab8d70416b (diff) | |
| download | nvim-conf-7152b5c26fbbfc4e84d8ccfa6917ca71fab14cc5.tar.gz nvim-conf-7152b5c26fbbfc4e84d8ccfa6917ca71fab14cc5.zip | |
updates and improvements
| -rw-r--r-- | lazy-lock.json | 27 | ||||
| -rw-r--r-- | lua/alpha/lsp/attach.lua | 45 | ||||
| -rw-r--r-- | lua/alpha/lsp/null-ls.lua | 16 | ||||
| -rw-r--r-- | lua/alpha/lsp/servers.lua | 16 | ||||
| -rw-r--r-- | lua/plugins/direnv.lua | 5 | ||||
| -rw-r--r-- | lua/plugins/neotest.lua | 10 |
6 files changed, 97 insertions, 22 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index 2503909..c8af79a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,6 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, "NeoColumn.nvim": { "branch": "main", "commit": "456bd054b65a5a8bb8a8cb4b3afc5bbbedcb0994" }, "SmoothCursor.nvim": { "branch": "main", "commit": "b61173fb107455f18099715b88d86002579f2736" }, @@ -14,19 +15,22 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, + "composer.nvim": { "branch": "main", "commit": "ec9537969adc7fc128cfe9c3a9925850455896c8" }, "copilot-cmp": { "branch": "master", "commit": "11eb015fbf9f07ad1c72dbdc9d830ebac610b5cd" }, "copilot.lua": { "branch": "master", "commit": "2c942f33ba5c621c906e625e00a1bb504b65e2f0" }, + "direnv.vim": { "branch": "master", "commit": "165031fa2c8dbb1e78dfd7054fe064ea926384cb" }, "dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" }, "duck.nvim": { "branch": "main", "commit": "8f18dd79c701698fc150119ef642c1881ce6a538" }, "fzf": { "branch": "master", "commit": "0f50dc848e58b47408713c2c31f2be73287c030a" }, - "fzf.vim": { "branch": "master", "commit": "5ab282c2f4a597fa655f39f36e7ee8e97bf51650" }, + "fzf.vim": { "branch": "master", "commit": "587f55bf5051ff40600837778ea01ead6283f399" }, "git-worktree.nvim": { "branch": "master", "commit": "d7f4e2584e81670154f07ca9fa5dd791d9c1b458" }, - "gitsigns.nvim": { "branch": "main", "commit": "d927caa075df63bf301d92f874efb72fd22fd3b4" }, + "gitsigns.nvim": { "branch": "main", "commit": "983f1a216cca1a079399ba050bc4b9ce130de83a" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "icon-picker.nvim": { "branch": "master", "commit": "e6dca182518eeb7a51470c13605a5bce08a816e4" }, "image.nvim": { "branch": "main", "commit": "dcabdf47b0b974b61d08eeafa2c519927e37cf27" }, "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, + "laravel.nvim": { "branch": "main", "commit": "8f8a0eab84191b1867b2f188cf475e6a05203908" }, "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, "lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, @@ -37,27 +41,34 @@ "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, "neodev.nvim": { "branch": "main", "commit": "dcd34653b0f1d3e7ea9aeb3e37dc7c8da445c4fe" }, "neogen": { "branch": "main", "commit": "1dd0319ccf41b2498f45a3c7607f2ee325ffc6a0" }, - "neorg": { "branch": "main", "commit": "20502e50e9087248f6f8ed8d29fae9c849c1c77f" }, + "neorg": { "branch": "main", "commit": "a6c2c4d17c139e942c069cac458c12e65d7e75d3" }, + "neotest": { "branch": "master", "commit": "bec7be0f13ee19c85561943fc5f7b8daa4f4d465" }, + "neotest-go": { "branch": "main", "commit": "f2580cad67ef0181403cf65858ab638ffd3ede9f" }, + "neotest-plenary": { "branch": "master", "commit": "e0d9b1530307a03abcc52fc0ae28f054dea3f752" }, + "neotest-rust": { "branch": "main", "commit": "dd49d0de3a4ccde0c8ce99dbae9e7b04bcdbfc85" }, + "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, "noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" }, - "nui.nvim": { "branch": "main", "commit": "aa1b4c1e05983ff7debd2b4b2788651db099de2f" }, + "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" }, "nvim-autopairs": { "branch": "master", "commit": "35493556b895f54c129918aca43ae9a63af42a1f" }, "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-dap": { "branch": "master", "commit": "31e1ece773e10448dcb616d5144290946a6264b7" }, + "nvim-dap": { "branch": "master", "commit": "0e6b7c47dd70e80793ed39271b2aa712d9366dbc" }, "nvim-dap-go": { "branch": "main", "commit": "1b508e9db330108d3b5d62a6d9cc01fe6bbdd4e0" }, "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-lspconfig": { "branch": "master", "commit": "499314f76fa6e8f82f7cfd116578906d61ba2560" }, + "nvim-lspconfig": { "branch": "master", "commit": "0517d8522dcec286b1dba47aa3ee1ed8f523aed6" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-projectconfig": { "branch": "master", "commit": "05fd34831e170db269d1b84597615bcdcdde930e" }, "nvim-spectre": { "branch": "master", "commit": "411cee67fe3f8242023eb8d9edafefbbfb2d06f1" }, "nvim-transparent": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" }, - "nvim-treesitter": { "branch": "master", "commit": "95d02cdafe704fa5b86eac81f2eb1de3d8f52330" }, + "nvim-treesitter": { "branch": "master", "commit": "80b4fa7970ee159e5c2c715bbcd386143c48dcb1" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, "nvim-web-devicons": { "branch": "master", "commit": "bc11ee2498de2310de5776477dd9dce65d03b464" }, + "php-code-actions.nvim": { "branch": "main", "commit": "31831cb7c3227ac00ddc7590b31f11148ff4a81c" }, + "phpactor.nvim": { "branch": "main", "commit": "0aa4ad09c2024e24d630c0ec616d65396caa39e0" }, "plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "2ec9bc0fb5f3c8c6a0f776f0159dd2a3b1663554" }, @@ -80,7 +91,7 @@ "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, "vim-enfocado": { "branch": "main", "commit": "845835a58d285eb8c1ced5dba83bfdec6e40d828" }, "vim-eunuch": { "branch": "master", "commit": "67f3dd32b4dcd1c427085f42ff5f29c7adc645c6" }, - "vim-fugitive": { "branch": "master", "commit": "572c8510123cbde02e8a1dafcd376c98e1e13f43" }, + "vim-fugitive": { "branch": "master", "commit": "d4914b361b081c4d983e924f1dd337c143152833" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, diff --git a/lua/alpha/lsp/attach.lua b/lua/alpha/lsp/attach.lua index e15ad92..6fc415c 100644 --- a/lua/alpha/lsp/attach.lua +++ b/lua/alpha/lsp/attach.lua @@ -5,6 +5,51 @@ local filetype_attach = setmetatable({ vim.api.nvim_buf_create_user_command(bufnr, "LspPhpactorReindex", function() vim.lsp.buf_notify(bufnr, "phpactor/index/reindex", {}) end, {}) + + vim.api.nvim_buf_create_user_command(bufnr, 'LspPhpactorStatus', function() + local results, _ = vim.lsp.buf_request_sync(bufnr, "phpactor/status", {["return"]=true}) + + local content = '' + + for _, res in pairs(results or {}) do + if res ~= nil and res["result"] ~= nil then + content = content .. res["result"] + end + end + + + local Popup = require("nui.popup") + local event = require("nui.utils.autocmd").event + + local popup = Popup({ + enter = true, + focusable = true, + border = { + style = "rounded", + }, + position = "50%", + size = { + width = "80%", + height = "60%", + }, + }) + + -- mount/open the component + popup:mount() + + -- unmount component when cursor leaves buffer + popup:on(event.BufLeave, function() + popup:unmount() + end) + local out = {}; + for match in string.gmatch(content, "[^\n]+") do + table.insert(out, match); + end + + vim.api.nvim_buf_set_option(popup.bufnr, "filetype", "markdown") + vim.api.nvim_buf_set_lines(popup.bufnr, 0, 1, false, out) + + end, {}) end, }, { __index = function() diff --git a/lua/alpha/lsp/null-ls.lua b/lua/alpha/lsp/null-ls.lua index 3428ec6..b329ba6 100644 --- a/lua/alpha/lsp/null-ls.lua +++ b/lua/alpha/lsp/null-ls.lua @@ -16,14 +16,14 @@ null_ls.setup { -- php_actions.getter_setter, -- php_actions.file_creator, - null_ls.builtins.diagnostics.phpstan.with { - to_temp_file = false, - method = null_ls.methods.DIAGNOSTICS_ON_SAVE, - -- command = "./bin/phpstan", - -- condition = function () - -- return vim.fn.findfile("bin/phpstan") ~= "" - -- end - }, + -- null_ls.builtins.diagnostics.phpstan.with { + -- to_temp_file = false, + -- method = null_ls.methods.DIAGNOSTICS_ON_SAVE, + -- -- command = "./bin/phpstan", + -- -- condition = function () + -- -- return vim.fn.findfile("bin/phpstan") ~= "" + -- -- end + -- }, null_ls.builtins.diagnostics.phpcs.with { method = null_ls.methods.DIAGNOSTICS_ON_SAVE, condition = function(utils) diff --git a/lua/alpha/lsp/servers.lua b/lua/alpha/lsp/servers.lua index 14ec9d3..c849c13 100644 --- a/lua/alpha/lsp/servers.lua +++ b/lua/alpha/lsp/servers.lua @@ -12,6 +12,18 @@ local default = function() end return { + -- ["cucumber_language_server"] = function() + -- return { + -- on_attach = lsp_attach, + -- flags = lsp_flags, + -- settings = { + -- cucumber = { + -- features = { "tests/Behat/features/*.feature" }, + -- glue = { "tests/Behat/*.php" }, + -- }, + -- }, + -- } + -- end, ["emmet_ls"] = function() local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) @@ -78,7 +90,7 @@ return { end, ["omnisharp"] = function() return { - cmd = {"OmniSharp"}, + cmd = { "OmniSharp" }, on_attach = lsp_attach, flags = lsp_flags, } @@ -88,7 +100,7 @@ return { return { on_attach = lsp_attach, flags = lsp_flags, - filetypes = { "php", "cucumber" }, + filetypes = { "php" }, init_options = { ["language_server_worse_reflection.inlay_hints.enable"] = true, ["language_server_worse_reflection.inlay_hints.params"] = true, diff --git a/lua/plugins/direnv.lua b/lua/plugins/direnv.lua new file mode 100644 index 0000000..df3d01d --- /dev/null +++ b/lua/plugins/direnv.lua @@ -0,0 +1,5 @@ +return { + "direnv/direnv.vim", + lazy = false, + priority = 900, +} diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua index 00ed18d..09e99b0 100644 --- a/lua/plugins/neotest.lua +++ b/lua/plugins/neotest.lua @@ -1,6 +1,7 @@ return { "nvim-neotest/neotest", - enabled = false, + enabled = true, + keys = { { "<c-t>", desc = "Open Test menu" } }, dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", @@ -18,11 +19,12 @@ return { require "neotest-go", require "neotest-rust", require "neotest-plenary", - require "neotest-vim-test" { - ignore_file_types = { "go", "lua", "rust", "php" }, - }, + -- require "neotest-vim-test" { + -- ignore_file_types = { "go", "lua", "rust", "php" }, + -- }, -- require("laravel.neotest"), }, + library = { plugins = { "neotest" }, types = true }, } local hydra = require "hydra" |