Skip to content
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

require('nvim-dap-virtual-text').setup() has not enough argument according to LIPS LSP #65

Open
stephane-archer opened this issue Nov 12, 2023 · 1 comment

Comments

@stephane-archer
Copy link

my lips LPS complain about the following line not receiving enough arguments:
require('nvim-dap-virtual-text').setup() I imagine the solution would be require('nvim-dap-virtual-text').setup({}) but I'm not sure, I'm really a noob when it comes to configuring Neovim.
Please update the README

@theHamsta
Copy link
Owner

theHamsta commented Dec 27, 2023

This seems to be a bug in https://github.com/LuaLS/lua-language-server. It seems to count the number of arguments here

--- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
--- @param buf number
--- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
--- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
--- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
--- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
--- @diagnostic disable-next-line: unused-local
display_callback = function(variable, buf, stackframe, node, options)
if options.virt_text_pos == 'inline' then
return ' = ' .. variable.value
else
return variable.name .. ' = ' .. variable.value
end
end,
incorrectly because of this line. When I remove
--- @diagnostic disable-next-line: unused-local
then it recognizes correctly that the function has only 5 parameters and 1 return value.

Not sure why I can't repro it anymore. Maybe it has been fixed upstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants