Open zippeurfou opened 1 year ago
For 1: You can try virtual text mode For 2: It related to your LSP server response. In the example you posted. The response is in string match mode, so it is not accurate. You can change to another LSP server to see if its behaviour differently
@ray-x thanks, for 1, I meant instead of seeing the full list of all the argument on the window, only show the current one (so basically in my screenshot having the green text as a window not as a text next to it). For 2, this is because of pyright. that's what you're saying right? So if I want to use python I don''t have a choice unless I use another server which most likely is less good.
For 4 I have been editing my source with this:
sources = cmp.config.sources({
{ name = "nvim_lsp", max_item_count = 15,
entry_filter= function (entry,context)
local kind = entry:get_kind()
local node = ts_utils.get_node_at_cursor():type()
if node == "ERROR" and kind == 6 then
-- This happen when the parenthesis is open but not closed. I need to figure out a way there
end
if node == "argument_list" and context.filetype =="python" then
local str = entry:get_word()
local last_char = string.sub(str,string.len(str))
if kind == 6 and last_char=='=' then
return true
else
return false
end
end
return true
end
},
This is very messy code but I am hoping I can figure out with looking at your plugin source code maybe a cleaner way.
I still see the same issues with the hint being hard to read but it is a start at least.
If I could move the hint to what I am asking for 3 this would be fantastic. I just have no idea how to do so :/
In fact for 3, you can refer to this PR https://github.com/ray-x/lsp_signature.nvim/issues/248 Both off_y and off_x can be functions and you can calculate the position
Thanks again @ray-x for your help. Really appreciate it. For 3 I am a bit confused as I guess there are 2 things to change which I am not sure how to do it.
For 1. I still feel you can check the virtual text only option work for you or not. If you want a floating windows with boarder and only show the active parameter. You can create a new floating window, instead of put the full signature inside, you can put the virtual text. something like this:
_LSP_SIG_CFG.bufnr, _LSP_SIG_CFG.winnr = vim.lsp.util.open_floating_preview({'the_virtual_text_of_signature'}, syntax, config)
Hey @ray-x , Thanks for this awesome plugin. I have been trying to use your plugin for my completion and I have a few questions:
is it possible to edit what goes into the floating window. eg. showing "LspSignatureActiveParameter" instead of the whole thing?
I do have cases where the hint position is pretty odd. Is this expected/configurable?
I would like the "LspSignatureActiveParameter" to be on the right side of my menu rather than as a hint text. See for example this
compared to this . How could I configure it to behave like that?
This might not be related to your plugin but I'd like to say that when I am inside a function call in python I'd like to only display the variable with
=
at the end that have a signature. See how this create noise vs the vscode equivalent.See how in vscode in the window it add the LspSignatureActiveParameter inside the window (
callback
in the screenshot). Is there a way to do that with your plugin?Sorry for all theses questions. I just am not sure where to go :(