Replace nvim_lsp_signature_help with lsp_signature.nvim

Mon, 26 Jun 2023 14:11:01 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 26 Jun 2023 14:11:01 -0500
changeset 1122
8a56361b077f
parent 1121
199d907c2f67
child 1123
b7a3f68c02b2

Replace nvim_lsp_signature_help with lsp_signature.nvim

.config/nvim/lua/config/maps.lua file | annotate | diff | comparison | revisions
.config/nvim/lua/plugins/completion.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/config/maps.lua
+++ b/.config/nvim/lua/config/maps.lua
@@ -88,7 +88,7 @@ vim.api.nvim_create_autocmd("LspAttach",
     map("n", "gd", vim.lsp.buf.definition, bufopts)
     map("n", "K", vim.lsp.buf.hover, bufopts)
     map("n", "gi", vim.lsp.buf.implementation, bufopts)
-    map("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
+    map("n", "<F12>", vim.lsp.buf.signature_help, bufopts)
     map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, bufopts)
     map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
     map("n", "<leader>wl", function()
--- a/.config/nvim/lua/plugins/completion.lua
+++ b/.config/nvim/lua/plugins/completion.lua
@@ -6,7 +6,6 @@ return {
       "hrsh7th/cmp-buffer",
       "hrsh7th/cmp-calc",
       "hrsh7th/cmp-nvim-lsp",
-      "hrsh7th/cmp-nvim-lsp-signature-help",
       "hrsh7th/cmp-nvim-lua",
       "hrsh7th/cmp-omni",
       "hrsh7th/cmp-path",
@@ -34,9 +33,7 @@ return {
         },
         formatting = {
           format = function(entry, vim_item)
-            if entry.source.name == "nvim_lsp_signature_help" then
-              vim_item.kind = ""
-            elseif vim_item.kind == "Text" then
+            if vim_item.kind == "Text" then
               vim_item.kind = entry.source.name
             end
             vim_item.menu = nil
@@ -83,7 +80,6 @@ return {
         }),
         sources = cmp.config.sources({
           { name = "nvim_lsp" },
-          { name = "nvim_lsp_signature_help" },
           { name = "nvim_lua" },
           { name = "buffer", option = { keyword_pattern = [[\k\+]] } },
           { name = "path" },
@@ -94,4 +90,17 @@ return {
       })
     end,
   },
+
+  {
+    "ray-x/lsp_signature.nvim",
+    events = { "LspAttach" },
+    opts = {
+      toggle_key = "<F12>",
+      toggle_key_flip_floatwin_setting = true,
+      floating_window = false,
+      fix_pos = true,
+      hint_enable = false,
+      handler_opts = { border = "none" },
+    },
+  },
 }

mercurial