feat(lsp): signature help (manually triggered) (#15233)

# Description

To check for missing parameters

<img width="417" alt="image"
src="https://github.com/user-attachments/assets/5e2a8356-5fd9-4d15-8ae6-08321f9d6e0b"
/>

# User-Facing Changes

For other languages, the help request can be triggered by the `(`
character of the function call.
Editors like nvim refuse to set the trigger character to space, and
space is probably way too common for that.

So this kind of request has to be triggered manually for now.
example of nvim config:

```lua
vim.api.nvim_create_autocmd("FileType", {
  pattern = "nu",
  callback = function(event)
    vim.bo[event.buf].commentstring = "# %s"
    vim.api.nvim_buf_set_keymap(event.buf, "i", "<C-f>", "", {
      callback = function()
        vim.lsp.buf.signature_help()
      end,
    })
  end,
})
```

# Tests + Formatting

+2

# After Submitting
This commit is contained in:
zc he
2025-03-03 20:54:42 +08:00
committed by GitHub
parent 8e1385417e
commit fc72aa6abe
4 changed files with 375 additions and 24 deletions

17
tests/fixtures/lsp/hints/signature.nu vendored Normal file
View File

@@ -0,0 +1,17 @@
str substring ..2 -g foo bar b
(
# inside parenthesis
str substring
..2 -b
foo
b
)
foo bar 1 2 3
foo baz 1 2 3
def "foo baz" [
p1: int
p2: string,
p3?: int = 1 # doc
] {}
echo