ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.02k stars 57 forks source link

colorscheme config #227

Closed kdamaski closed 1 year ago

kdamaski commented 1 year ago

Hi thanks for this cool extension. I have the latest version of it. The issue i find is that the effectiveness depends a lot on the colorscheme (for example for most colorschemes (from the git repo awesome-nvim-colorschemes) doesn't even trigger. In some others (like aurora, PaperColor) it triggers even in normal mode. So my clue is that the code depends heavily on what the colorscheme provides to the environment. Do you have any suggestions on how to provide some defaults that the extension won't brake after colorscheme switch. Also regarding the second behavior (the extra triggering) that could perhaps be an issue with the autocommands? Thanks in advance

ray-x commented 1 year ago

I do not think this plugin depends on any colorscheme. Do you have a minium config I can reproduce? You can start with https://github.com/ray-x/lsp_signature.nvim/blob/master/tests/init_pack.lua

kdamaski commented 1 year ago

Thanks for the answer. As i tried reproducing some bug with the same config (without touching anything) i saw that the colorcheme indeed had nothing to do. What i notice at first though is that when i switch tabs, then the extension is not active on the new tab. It works only for the first tab/buffer. I have lunarvim project installed and in a lunarvim extension config they have added that whenever a tab closes then the associated buffer is wiped as well. I don't think that's the exact issue, but now it seems like a buffnr recognition issue of the code. Also after i open a new tab and try to activate lsp_signature then bugs start occuring. For example, it triggers in insert mode correctly, then i press esc and enter normal mode , then it triggers in normal mode automatically. In the second tab opened it won't be triggered by autocommands. Though i have mapped to manually trigger "lua require('lsp_signature').toggle_float_win()" (by touching the toggle_key option in the init.lua) and when i manually trigger in the second tab it shows, but after i enter normal mode the virtual text is still on screen. The same behaviour happens when i put require "lsp_signature".setup({}) on the end of my lua config

ray-x commented 1 year ago

You can also try to use on_attach (see readme first example) to setup lsp_signature. This will make sure lsp_signature attach to the lsp server and buffer you editing.

kdamaski commented 1 year ago

Yes i am using that in the plugin list: "...,{ "ray-x/lsp_signature.nvim", config = function() require "lsp_signature".on_attach() end, event = "BufRead" }". That's set by default in the lunarvim config file (using wbthomason/packer.nvim)

I am sending a video for demonstration (i use virtual text only, not float window): Screencast from 10-31-2022 02:24:01 PM.webm

What i try to show in the video is that the lsp_signature won't trigger in buffer/tab other than the first and it can only be triggered with the keymap i am manually hitting while letting the virtual text on screen uncleared.

ray-x commented 1 year ago

lsp_signature.on_attach() should be called inside lsp on_attach method with bufnr parameter. Otherwise pls use setup.

kdamaski commented 1 year ago

Oh okay now it works thanks for the help <3