-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't seem to work #1
Comments
Thanks for trying this out. Did a quick test with lua and python. It should work Can you check if your 'textDocument/hover' or Sometime when lsp can not find signature, pop up will not show. This may happen for the script where function definition is not strong typed. my lua lsp config is here: |
Yes, calling |
That is a bit wired. require "lsp_signature".on_attach() Should register the handler to Insert event. One more thing to check: I also exported the signature function, can you check if lua require'lsp_signature'.signature() give you same result of:
If it shows the same, that means the handler was not registered. If signature() also shows nothing, that there are other place need to check. So another thing to check is require "lsp_signature".on_attach()
lua require'lsp_signature'.signature() Togher to enforce on_attach to run again. I put my attach() in init.lua. Not sure it works same way in parker. |
Interesting, Did double check and Thanks for helping with debug! |
I just full back to a min config. It still works. call plug#begin('~/.vim/plugged')
" Group dependencies, vim-snippets depends on ultisnips
Plug 'neovim/nvim-lspconfig'
Plug 'ray-x/lsp_signature.nvim'
call plug#end()
lua <<EOF
local nvim_lsp = require('lspconfig')
-- require('lsp_config') -- you may need my lsp_config.lua
require('lsp_signature').on_attach()
local sumneko_root_path = vim.fn.expand("$HOME")..'/github/sumneko/lua-language-server'
local sumneko_binary = vim.fn.expand("$HOME")..'/github/sumneko/lua-language-server/bin/macOS/lua-language-server'
local on_attach = function(client, bufnr)
require'lsp_signature'.on_attach()
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
end
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
on_attach = on_attach,
}
EOF Can you send a minimum vimrc to reproduce the issue. I tried packer a few months before, but does not keep the configurations. |
Also tried following pack config vimrc it works as expected. lua <<EOF
vim.cmd [[packadd packer.nvim]]
-- Only if your version of Neovim doesn't have https://github.com/neovim/neovim/pull/12632 merged
-- vim._update_package_paths()
require('packer').startup(function()
use {
"neovim/nvim-lspconfig",
"ray-x/lsp_signature.nvim",
}
end)
local nvim_lsp = require('lspconfig')
-- require('lsp_config') -- you may need my lsp_config.lua
require('lsp_signature').on_attach()
local sumneko_root_path = vim.fn.expand("$HOME")..'/github/sumneko/lua-language-server'
local sumneko_binary = vim.fn.expand("$HOME")..'/github/sumneko/lua-language-server/bin/macOS/lua-language-server'
local on_attach = function(client, bufnr)
require'lsp_signature'.on_attach()
end
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
on_attach = on_attach,
}
EOF
let g:min_load = 1 "prevent other configure to load |
It works with minimal config, so something else in my configuration conflicts with your plugin. Will try to figure it out and come back to you. Thanks! |
It cut my configuration in many different ways, removed all plugins, settings and whatever else I could think of, but still no luck. Do you have any insight where to look exactly, as in, what could be stopping your plugin from working? |
It is really wired. Can you check if my minimum vimrc works for you or not? timer:start(100, 200, vim.schedule_wrap(function()
... This setup works for me. delay 100ms and refresh every 200ms. And my timeout setting in vimrc: The final check is to dump all InsertEnter/Leave registration in vim... That would be annoying to check the conflictions.
|
Ah, no, problem definitely is within my configuration. Your minimal configuration with packer does work. I am not sure if it is due to autocmd or not, but |
Is your plugin is lazyloading? Try opt=false? |
No, it's not lazy loaded: use {
"neovim/nvim-lspconfig",
requires = {
{
"kosayoda/nvim-lightbulb",
config = function()
vim.api.nvim_command("highlight LightBulbVirtualText guifg=red")
end
},
"nvim-lua/lsp-status.nvim",
{"ojroques/nvim-lspfuzzy", config = require "lspfuzzy".setup {}},
"ray-x/lsp_signature.nvim"
}
} I then have |
Hi, @cloggier Can you send me your minium vimrc, hopefully, 1 or 2 files so I can reproduce your issue? |
Does not work for me also. Is it because I use |
I may add this info - language server seems to provide this functionality. use {'neovim/nvim-lspconfig'}
require'lspconfig'.intelephense.setup{
on_attach = function(client, bufnr)
print(vim.inspect(client.resolved_capabilities))
end
} Outputs:
|
Hi.
when open the bracket. This is my config;
|
@talbergs lua <<EOF
vim.cmd [[packadd packer.nvim]]
require('packer').startup(function()
use {
"wbthomason/packer.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/nvim-compe",
"ray-x/lsp_signature.nvim"
}
end)
local lspconfig = require('lspconfig')
require'compe'.setup {
enabled = true;
autocomplete = true;
debug = false;
min_length = 1;
preselect = 'enable';
throttle_time = 80;
source_timeout = 200;
incomplete_delay = 400;
max_abbr_width = 100;
max_kind_width = 100;
max_menu_width = 100;
documentation = true;
source = {
nvim_lsp = true;
vsnip = true;
};
}
require "lsp_signature".on_attach()
require('lspconfig').intelephense.setup{
}
EOF
let g:min_load = 1 One thing, writeMsg() does not have a signature as there ar no arguments . |
@horseinthesky Should be fixed in the new version. Thanks for reporting. |
Thank you @ray-x ! use {'ray-x/lsp_signature.nvim',
config = function()
- require "lsp_signature".on_attach()
end
}
+require "lsp_signature".on_attach() |
That still does not solve the issue for me though, I am calling that function from my custom on_attach function from lsp initialisation. |
Thanks for the feedback. local golang_setup = {
on_attach = function(client, bufnr)
if lsp_status ~= nil then
lsp_status.on_attach(client, bufnr)
end
require "lsp_signature".on_attach() -- Note: add in lsp client on-attach
diagnostic_map(bufnr),
...
end,
...
} I updated the README.md as well |
@ray-x Apologies if I wasn't clear enough. It does not work for me still, even with |
In that case, I will leave the issue open ATM and I will wait on more info regarding how to reproduce the issue. |
Here is a minimum config that does not work for me: call plug#begin('~/.config/nvim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'ray-x/lsp_signature.nvim'
call plug#end()
lua require'lspconfig'.tsserver.setup{}
lua require'lsp_signature'.on_attach() Although running
|
@Milad-abbasi |
@ray-x |
@Milad-abbasi I can not reproduce with your minimum vimrc. One thing not sure about is I am using Mac+Kitty, may it affect the sequence of initilization. Can you check adjust your vimrc like this: lua <<EOF
local nvim_lsp = require('lspconfig')
require'lspconfig'.tsserver.setup{
on_attach = function(client)
require'lsp_signature'.on_attach()
end
}
EOF |
@ray-x |
I think I just have found a culprit. I had {
signature_help = false,
signature_help_trigger_characters = {},
} (amongst other capabilities). After disabling them and leaving only sumneko's lua lsp or tsserver active for buffer I do get signature hints. |
I thought the issue was fixed last week. Can you send the minimum vimrc to reproduce this issue? :lua print(vim.inspect(vim.lsp.buf_get_clients(0))) |
Here you go. I've extracted the minimal amount of code from my setup to reproduce this (configured for node project with typescript and eslint). Once I comment out the diagnosticsls section it all works as expected. call plug#begin()
Plug 'neovim/nvim-lspconfig'
Plug 'ray-x/lsp_signature.nvim'
call plug#end()
lua <<EOF
require'lspconfig'.tsserver.setup{}
require'lspconfig'.diagnosticls.setup{
root_dir = require'lspconfig'.util.root_pattern('package.json'),
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact'
},
init_options = {
linters = {
eslint = {
command = 'node_modules/.bin/eslint',
rootPatterns = { 'package.json' },
debounce = 100,
args = { '--stdin', '--stdin-filename', '%filepath', '--format', 'json' },
sourceName = 'eslint',
parseJson = {
errorsRoot = '[0].messages',
line = 'line',
column = 'column',
endLine = 'endLine',
endColumn = 'endColumn',
message = '[eslint] ${message} [${ruleId}]',
security = 'severity'
},
securities = {
[1] = 'error',
[2] = 'warning'
},
requiredFiles = {
'.eslintrc',
'package.json'
}
},
},
filetypes = {
javascript = 'eslint',
javascriptreact = 'eslint',
typescript = 'eslint',
typescriptreact = 'eslint',
}
}
}
require'lsp_signature'.on_attach()
EOF And here's the log you requested: buf_get_clients.txt |
I suspect this has something to do with how lsp_signature is displayed and how diagnostics is rendered in the UI. Might be a case of some internal neovim rendering action that just hides the signature help quickly so it looks like it's not working 🤔 I haven't really dug deep into this, so I might be way off on this, hehe. |
I am trying to fix your issue. But seems the latest neovim lsp signature for ts/js is broken. |
That seems to work @ray-x 👍 . Did your change also make it so the signature text no longer wraps ? I can't remember that being an issue before...but maybe it's just bad memory. |
It is great the plugin works for you. I did not change the wrap setup yesterday. And it seems to be wrap correct on my side. In fact, the plugin does not even has a wrap setup in the backend. |
Okay mr @ray-x . Then everything is solved! Thank you for fast response and fast fix :) |
It works for me in lua but it doesn't work for python with pyright-ls. This is the output of inspect client:
This is my pyright setup require'lspconfig'.pyright.setup {
cmd = {DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", "--stdio"},
on_attach = function(client, bufnr)
require"lsp_signature".on_attach()
print(vim.inspect(client.resolved_capabilities))
end
} I had also efm but I disabled it as I saw in the comments above. The :lua.vim.buf.signature_help() works but the :lua require'lsp_signature'.signature() does not. Any ideas? Thank you in advance |
This issue was caused by pyright cap does not support |
Yeah, it seems to work now! Thanks for the quick fix! |
Sometimes when I type fast in python I get the following
I guess it has something to do with the changing focus between the hover window of the signature help and the main window. |
This issue happen to me as well this week after I update my nvim nightly as well. I think the upstream has an bug when preview closed but not notify neovim. |
Hey, I couldn't follow what fixed your issue, I am having a similar setup as yours and I am running efm + sumeko_lua too. Can you please clarify what helped you? |
I have never tested efm. Could you please run and share the result of. |
I could get it working when I provide the config on
|
I think you can do something like this: |
It does not seem to work if I don't open a buffer directly. Let's say I have a file int test(int a, int b){
return a + b;
}
int main(){
test(|
} If I am inside the same folder and type |
@seblj
Or you can refer to Another solution is in you BufReadPre or FileReadPre auto event, run |
Oh, my bad for not reading carefully enough! Thanks! |
Looks like it only worked on named files, which is why I thought it was broken on this machine, because why would I test all the things and catch all the cases ;) Now it seems to work with both named files and files opened using Telescope. ray-x/lsp_signature.nvim#1
local servers = { "pyright", "rust_analyzer", "tsserver", "gopls", "clangd" }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = function()
require"lsp_signature".on_attach({
bind = false,
use_lspsaga = true,
floating_window = true,
fix_pos = true,
hint_enable = true,
hi_parameter = "Search",
handler_opts = {
"shadow"
}
})
end
}
end |
for functions defined in the common lib/system package. LSP might be slow in responding to the signature request. |
Commenting in the event that someone else comes across this. My config makes heavy use of
|
You should be able to use |
It is not happening anymore. |
I have the same problem, even after calling |
I'm using LunarVim with lazy plugin manager and recommended plugin config from docs was working only once on first buffer/file that I opened. {
"ray-x/lsp_signature.nvim",
event = "BufRead",
config = function() require"lsp_signature".on_attach() end,
}, Looks like lvim.autocommands = {
{
"BufEnter",
{
pattern = { "*" },
callback = function() require"lsp_signature".on_attach() end,
}
}
} Probably not the most correct workaround but at least it works. |
For lazy.nvim, maybe something like {
"ray-x/lsp_signature.nvim",
envent = "LspAttach",
cfg = {},
} |
Hi! I am quite keen to get try out this plugin, but as of now it doesn't work. Tried lua file with sumneko's lsp, and python with pyright; didn't get any popups with argument once in
()
after function call for neither of filetypes.Installed with packer like that:
I also have
nvim-compe
if that makes any difference.The text was updated successfully, but these errors were encountered: