ray-x / lsp_signature.nvim

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

Can hint text show the entire set of arguments? #111

Closed tomleavy closed 2 years ago

tomleavy commented 3 years ago

I like having hint only mode vs the full window because it doesn't get in the way of reading the code above where I'm typing. The only issue I have with it is that it doesn't show the entire signature of the function, only the current argument. I there a way there can be a super compact mode like how hint works but still shows all the arguments?

ray-x commented 3 years ago

You can either set floating_window to false and use virtual text only mode Also you can set doc_lines=0 and border='none' so the hint will be one line in height.

tomleavy commented 3 years ago

What I would love to see is the text hint show you the full set of arguments and bold the one you are currently on rather than just the current argument

mflova commented 2 years ago

Similar to this issue, I would propose a mix between this mode and the current one. This mode would give you the current available options. For example, given a python function like this:

def addition(num: int, num2: int = 2, num3: int = 3):
    return num + num2 + num3

I would like to see num as the first argument, and then, once the default argument zone is reached, the current mode only displays num2. However, since these are optional, it would be a good idea to display my available options (which in this case, they are num2 and num3) I also understand that this might not be possible given teh fact that a few more languages are also supported.

ray-x commented 2 years ago

@tomleavy You can use the api status_line() please check the README.md

tomleavy commented 2 years ago

Thanks, will give that a shot

ray-x commented 2 years ago

@mflova Seems that require LSP server supports. I tried pyright

image

The response does not show which parameter is optional. It not a rival task for lsp-signature to identify the optional arguments.