ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.01k stars 56 forks source link

Could not toggle signature #267

Closed eeeXun closed 1 year ago

eeeXun commented 1 year ago

I'm using gopls with go, and I use <C-s> to toggle signature

require("lsp_signature").setup({
    bind = true,
    hint_prefix = "🌟",
    toggle_key = "<C-s>",
})

<C-s> works on c with clangd. But it does not work on gopls

https://user-images.githubusercontent.com/58657914/235280772-16e3b136-7d66-4f0e-8359-466822fe30f2.mp4

My lspconfig

```lua local lspconfig = require("lspconfig") vim.lsp.set_log_level("warn") local signs = { Error = "", Warn = "", Hint = "󰌡", Info = "" } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end vim.diagnostic.config({ underline = true, update_in_insert = false, float = { source = "always", border = "rounded", }, virtual_text = { spacing = 2, prefix = "●", source = "always", }, }) vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", }) local capabilities = require("cmp_nvim_lsp").default_capabilities() local servers = { "clangd", "cmake", "emmet_ls", "gopls", "html", "jedi_language_server", "rust_analyzer", "solidity", "texlab", "tsserver", "volar", } for _, server in ipairs(servers) do lspconfig[server].setup({ capabilities = capabilities, }) end ```
$ nvim --version
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
AmmarAbouZor commented 1 year ago

After the commit 9616a1adde75a108495dd97ec8bb46f908d552e7 you need to add this option to your configs: toggle_key_flip_floatwin_setting = true I don't know if this is intended or it's a bug that came with the new feature

eeeXun commented 1 year ago

Yes, toggle_key_flip_floatwin_setting = true fix that. But it's weird. Having toggle_key, but do nothing.

ray-x commented 1 year ago

the purpose of toggle_key_flip_floatwin_setting is described here: https://github.com/ray-x/lsp_signature.nvim/issues/265 It will prevent toggle key re-enable floating_windows when pressed. I may need to take a look on what make it behavior differently for gopls compared to clangd. Do you use default config?

eeeXun commented 1 year ago

Oh, sorry. I've just checked that gopls behaves the same as clangd.

the purpose of toggle_key_flip_floatwin_setting is described here: #265 It will prevent toggle key re-enable floating_windows when pressed.

Hmm. I suppose that should be the default behavior. Anyway, thank you @ray-x