Giter Site home page Giter Site logo

lsp_signature.nvim's Introduction

Hi there 👋

Languages and Tools:

lsp_signature.nvim's People

Contributors

artemrakov avatar codewdy avatar dmbfm avatar edwarmv avatar fdioguardi avatar fildo7525 avatar fnune avatar gbrlsnchs avatar gelio avatar hanspinckaers avatar hungrybirder avatar k14lb3 avatar kair8m avatar kazu914 avatar korigamik avatar kulakilam avatar llllvvuu avatar ltratt avatar notomo avatar pysan3 avatar ray-x avatar ray-xu-deltatre avatar remi-labbe avatar sublimeful avatar tusqasi avatar weypare avatar zeertzjq avatar zeioth avatar zoriya avatar zwodahs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lsp_signature.nvim's Issues

Extra_trigger_chars don't seem to work

Hi,

I'm trying to trigger lsp-signature by the character '{' rather than '(' for invoking the constructor of a C++ class but it doesn't work, I get no signature pop-up when trying to use '{'.

I've added the character to the extra_trigger_chars in the configuration like shown below:

-- Setup lsp-signature
require'lsp_signature'.on_attach({
  bind = true,
  doc_lines = 10,
  hint_enable = false,
  handler_opts = {
    border = "none", -- double, single, shadow, none
  },
  extra_trigger_chars = {"{"},
})

MRPE:

struct Example
{
    Example(int a, int b, std::string name)
        : m_a(a), m_b(b), m_name(std::move(name))
    {}

    int m_a, m_b;
    std::string m_name;
};

int main()
{
   Example ex{10, <-------- Here I do not get the floating window pop-up
}

Packer fails to update this plugin

Packer fails to update this plugin with the following error message:

 ✗ Failed to update ray-x/lsp_signature.nvim
  Errors:
    fatal: refusing to merge unrelated histories
    2dfeb79

I think this is related to this comment which specifies it will fail if the public branch has been rebased. The feature of allowing unrelated git histories from the side of packer is ongoing.

I also think it's best practice to not rebase a public branch which a lot of people rely on. This will also prevent someone to know which new commits were added since the last update and thus what are the new features/fixes for the plugin.

If rebasing is not the cause of this error, then please ignore this and close it.

Showed only on the first function of the session

I tried add seems that in my tests the modal is showed only on the first function.
If I move in insert mode to another one I don't get anything. If I restart neovim and move to that function in insert mode the modal is showed.

Also with opening other files the issue is still there.

My dotfiles are there https://github.com/mte90/dotfiles

I have this with php files.

Floating window disappearing with snippets

Description

In the image below I start typing the function name, select the compe completion option from lsp. luasnip fills in the variable names for the arguments, and i can press <Tab> to move through the snippet positions.

Problem gif

  1. The floating signature initially appears while i enter the first argument.
  2. The floating signature disappears when i press tab to move to the second argument, and while i change it.
  3. I press <Tab> again to move to the third argument, enter normal mode, then enter insert mode with cw. On entering insert mode the floating window reappears as I would expect it.

Problem

I would expect the floating window to remain while I tab through the function arguments.

When I disable luasnip and set rust-analyzer to not send argument snippets (rust-analyzer.completion.AddCallArgumentSnippets=false), the signature float works fine with the rest of my config.

Setup

  • neovim 0.5
  • compe,
  • nvim-lspconfig
  • rust-tools

I set up lsp_signature like this:

  require'lsp_signature'.on_attach({
	  hint_enable=false,
  })

I have tab configured as described here: https://github.com/hrsh7th/nvim-compe#how-to-use-tab-to-navigate-completion-menu with an alteration for working with luasnp.

-- Example of modificaiton
_G.s_tab_complete = function()
	if vim.fn.pumvisible() == 1 then
		return t "<C-p>"
	elseif require("luasnip").jumpable(-1) then
		return t "<cmd>lua require'luasnip'.jump(-1)<Cr>"
	else
		return t "<S-Tab>"
	end
end

Option to extend `triggered_chars`

Why? I want to improve the experience while typing.

For example my LS returned the chars ( and ,.

Now if I am typing in_array('test', _) (where _ is the cursor) there is no completion. Now I am just before starting the next parameter but there is no completion anymore. For me I want to add (space) to the trigger list event at this point.

Use backtick decorator doesn't highlight parameter

Here is my lsp-signature config

cfg = {
  bind = true, -- This is mandatory, otherwise border config won't get registered.
              -- If you want to hook lspsaga or other signature handler, pls set to false
  doc_lines = 10, -- only show one line of comment set to 0 if you do not want API comments be shown

  hint_enable = true, -- virtual hint enable
  hint_prefix = "🐼 ",  -- Panda for parameter
  hint_scheme = "String",

  handler_opts = {
    border = "single"   -- double, single, shadow, none
  },
  decorator = {"`", "`"}  -- or decorator = {"***", "***"}  decorator = {"**", "**"} see markdown help
}

I 've changed decorator to * and **, It output italic and bold parameter. But when change to backtick, parameter isn't highlighted
image

Doesn't seem to work

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:

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",
      config = function()
        require "lsp_signature".on_attach()
      end
    }
  }
}

I also have nvim-compe if that makes any difference.

Does not work with omnisharp

The equivalent VS Code feature works with the same version of omnisharp, but for lsp_signature I get nothing.

I'm installing omnisharp via lsp_install:

require'lspinstall'.setup()

then :LspInstall csharp to install the csharp language server (followed by restarting neovim).

Setting up my csharp lsp config the same way I'm setting up tsserver. Using treesitter for typescript and C#. Everything works great when it comes to typescript and csharp completion, but lsp_signature is only working for typescript.

The following shows the signature:

lua vim.lsp.buf.signature_help()

But the following does not:

lua require'lsp_signature'.signature()

Running this manually makes no difference:

lua require "lsp_signature".on_attach()

(although that's already set up in my configuration anyway).

I tried disabling my entire neovim config except for nvim-lspconfig, nvm-lspinstall and lsp_signature but it still didn't work (but continued to work for typescript).

Empty lines in signature

Hi there, thanks for the cool plugin!

I see empty lines in my signature for when the signature is only one line:
Screenshot 2021-08-02 at 16 02 05

I have doc_lines=0 and max_height=3

Doesn't work on insert event

I installed the plugin this way
use "ray-x/lsp_signature.nvim"
and my added it to my config as follows

local on_attach = function()
  require('completion').on_attach()
  require'virtualtypes'.on_attach()
  require "lsp_signature".on_attach()
end
require'lspconfig'.pyright.setup{on_attach = on_attach}

calling lua vim.lsp.buf.signature_help() does give proper output
calling lua require'lsp_signature'.signature() also gives proper output

Malformed pattern

👋🏼

I'm primarily using javascript and typescript and I'm seeing this quite often:

image

I can replicate it with the default config and writing console.log('foo',.

Signature window occludes popup menu for completion as well as text

Please see this screenshot:

image

when LSP signature popup window is open, it will occlude and hide the popup menu triggered for completion.

Here is what would be shown if there were no signature displayed:

image

Similarily, the signature window will hide the main editor itself when the cursor moves to a position that overlaps the signature window:

image

Configuration is not read if signature_help handler defined

If i have this handler in my lsp configuration

["textDocument/signatureHelp"] = vim.lsp.with(
  vim.lsp.handlers.signature_help, {
    border = "rounded"
  }
)

the configuration of this plugin is not read, instead it is using the default one.

Is this expected ?

Why are we manually attaching?

The following snippet of code is what I use on my plugin lsp-rooter to attach automatically without having to attach it on the lspconfig config.

local on_attach = function(client, bufnr)
  -- Attach logic goes here
end
local _start_client = vim.lsp.start_client
vim.lsp.start_client = function(lsp_config)
  if lsp_config.on_attach == nil then
    lsp_config.on_attach = on_attach
  else
    local _on_attach = lsp_config.on_attach
    lsp_config.on_attach = function(client, bufnr)
      on_attach(client, bufnr)
      _on_attach(client, bufnr)
    end
  end
  return _start_client(lsp_config)
end

Would be great to stop the manual thing, and use the solution provided instead.

Feature request: Bold/recolor the current parameter in the popup

The textDocument/signatureHelp response includes an activeParameter field, which indicates where the cursor is in the list of parameters. It would be nice if this information could be use to bolden, or use a different color for the active parameter in the popup. Perhaps by using the parameter labels and changing the signature label based on that information.

{ {                                                                                                                                                                                                          
    result = {
      activeParameter = 1,
      activeSignature = 0,
      signatures = { {
          label = "SomeFunc(context.Context, string, string) error",
          parameters = { {
              label = "context.Context"
            }, {
              label = "string"
            }, {
              label = "string"
            } }
        } }
    }
  } }

Popup closes on last parameter

I'm having a strange problem: the popup containing function signature hints stays open while I'm typing for all parameters but the last one. Last one gets closed as soon as I insert a character.

Excerpt from my config:

lua << EOF
  local custom_on_attach = function (client)
    require'lsp_signature'.on_attach()
  end

  require'lspconfig'.tsserver.setup{ on_attach = custom_on_attach }
EOF

lua << EOF
  require "lsp_signature".setup({
    bind = true, -- This is mandatory, otherwise border config won't get registered.
    handler_opts = {
      border = "rounded"
    }
  })
EOF

Error on opening ( or start of signature help

Using latest version of neovim HEAD , lastest version of lsp_signature when it gets the signature help on lua/python code i receive the following error

Error executing vim.schedule lua callback: ...utoload/plugged/lsp_signature.nvim/lua/lsp_signature.lua:71: attempt to concatenate local 'hint' (a nil value)

focusable_preview expected string, got table

Hi, I am getting this error, when I am hitting a ( to start the completion

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1382: syntax: expected string, got table
stack traceback:
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1382: in function 'focusable_preview'
        ...ig/nvim/plugged/lsp_signature.nvim/lua/lsp_signature.lua:46: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:896: in function 'cb'
        vim.lua:277: in function <vim.lua:277>
$ nvim --version                  
NVIM v0.5.0-dev+1405-g2f0e5e7e6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

highlights

Is there a way to remove these ``` when highlighting a parameter?

Also is there a way to change fore/background of the signature since it doesn't really match anything:
image

As an example here is how Saga diagnostic looks like:
image

Use a highlight instead of backtick for formatting the current parameter

First of all, thank you for this plugin, I think it's very useful I think that some parts of how we display the current parameter can be improved. My case is the following:

  • Functions with 1 parameter don't show backticks or any special color for the first and unique parameter (and thus, the current one)
  • Functions with more than 1 parameter show correctly with backticks. In my case, though, only the backticks themselves have a different color. The parameter name itself appears with the same color as the rest of the text. My markdown inline code blocks have the correct color, so not sure which file format it's getting to show it. I'm trying it with Rust and rust-analyzer LSP.

My proposal will be, if possible, to add a highlight to them, instead of adding the backticks. By default, it can be linked to some other like Keyword, or have a default color provided by the plugin.

Signature help only activating on the first file opened.

The plugin is working fine on the first file opened:
image

but opening a new file, whether via Telescope or :e, it stops working:
image

  1. lua vim.lsp.buf.signature_help() shows the signature on the second file.
  2. lua require'lsp_signature'.signature() does not.
  3. Manually running require "lsp_signature".on_attach() on the second file fixes the issue.

I have this section in my init.vim file:

Plug 'ray-x/lsp_signature.nvim'

lua << EOF
  require'lsp_signature'.on_attach({
    extra_trigger_chars = {"(", ","}
  })
EOF

I've tried replacing it with simply require'lsp_signature'.on_attach() but that also doesn't work. It seems the on_attach isn't being called for new files being opened?

I've also removed lspsaga to see if that's the issue but the problem remains.

Some error about "outside range"

Thanks for this plugin, I like it alot (quite useful to do check signature of a method with a shortcut).

When I try to make use of the feature which shows me which argument I need to type, I keep getting this error.

Error executing vim.schedule lua callback: ...ck/packer/start/lsp_signature.nvim/lua/lsp_signature.lua:195: end_col value outside range
Error executing vim.schedule lua callback: ...ck/packer/start/lsp_signature.nvim/lua/lsp_signature.lua:195: end_col value outside range
Error executing vim.schedule lua callback: ...ck/packer/start/lsp_signature.nvim/lua/lsp_signature.lua:195: col value outside range

Maybe I'm doing something wrong. The language I'm testing this is python with pyright lsp

Lock the position of preview popup

It is hard ATM. Because I am using focus preview API neovim has and it does not have a position option. I will need to use floating windows API instead. In that case, will need to copy and paste codes from neovim lsp to lsp signature. Or I should submit a PR in neovim to add the option.
Either way, it not a quick fix and I am parking the request for now.

hint not working when using lspsaga

When use_lspsaga is enabled I can't see the hint text above the cursor and lspsaga's window has no indication of what parameter I am editing

Nvim breaking changes

Latest nvim:

focusable_preview is deprecated. Please use open_floating_preview and pass focus_id = [unique_name] instead
Error executing vim.schedule lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp/util.lua:1322: syntax: expected string, got table
stack traceback:
/usr/local/share/nvim/runtime/lua/vim/lsp/util.lua:1322: in function 'focusable_preview'
...ck/packer/start/lsp_signature.nvim/lua/lsp_signature.lua:139: in function 'handler'
/usr/local/share/nvim/runtime/lua/vim/lsp.lua:896: in function 'cb'
vim.lua:277: in function vim.lua:277

pyright lsp signature issues

I am trying to set lsp signature for pyright lsp with the latest neovim nightly. I have noticed it does not automatically popup the signature for the modules like when I do "import pandas as pd" for pandas etc. Also when I try to do say "pd.read_" the signatures of the method are pretty slow .It only pops up when I press tab and cycle through the list of the autocomplete options and recycle to the top. Could you please help. I am new to this.

Not changing selected param as I type

👋🏻

I am using this with ElixirLS and LSP and as I type new parameters to the function it is not moving with it. Also, the panda seems to disappear when moving to the second param. See example screenshot. Happy to help debug/fix the issue, just not sure where to start. Thanks!

image

Error while opening a file: E5108: Error executing lua vim.lua:63: .../.config/nvim/pack/minpac/start/lsp_signature.nvim/lua/lsp_signature.lua:225: '=' expected near 'continue'

I use minpac to install this plugin call minpac#add('ray-x/lsp_signature.nvim'). And I put this in my init.vim:

lua << EOF
require'lsp_signature'.on_attach()
EOF

Every time I open a file, this error appears:

E5108: Error executing lua vim.lua:63: .../.config/nvim/pack/minpac/start/lsp_signature.nvim/lua/lsp_signature.lua:225: '=' expected near 'continue'

The error line is goto continue. After I comment out that line, a similar error appears:

E5108: Error executing lua vim.lua:63: .../.config/nvim/pack/minpac/start/lsp_signature.nvim/lua/lsp_signature.lua:232: '=' expected near 'continue'

This error line is goto continue, too. After I comment out that line, another error appears:

E5108: Error executing lua vim.lua:63: .../.config/nvim/pack/minpac/start/lsp_signature.nvim/lua/lsp_signature.lua:260: unexpected symbol near ':'

This error line is ::continue::. After I comment out that line, no error appears.

I use the prebuilt neovim on github and its version is:

NVIM v0.5.0-dev+1398-gd09b8ad71
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

failed get highlight parameter nil nil

Hi,

I use this config

local signature_help_cfg = {
  bind = true,
  doc_lines = 2,
  floating_window = true,
  hint_enable = false,
  hi_parameter = 'Constant',
  max_height = 4,
  max_width = 80,
  handler_opts = {border = 'none'},
}

Constant highlight group is

:hi Constant
Constant       xxx gui=bold guifg=#C5656B

When I write function parameter, the window with the signature help shows up, but I get no current parameter highlight and an error spawn failed get highlight parameter nil nil.

Disable print hover not supported

I find the printing of hover not supported slightly annoying if I am in a buffer that does not support signature help. It would be great if there was an option for disabling this print

Setup with rust_analyzer and rust_tools

First off, awesome plugin.

Rust Setup (Not Working)

Tried a normal setup with rust it does not work.

Minimal Not Working RC (look caveat below)

lua << EOF
require'lspconfig'.rust_analyzer.setup{}
require'lsp_signature'.on_attach({})
EOF

Though as mentioned in the readme if I add this in the rust_analyzer setup everything works perfectly fine.

There is a plugin called rust-tools which I use in my setup. I ran into an issue where this plugin was not working with rust_tools.

Rust Setup (Not Working)

Minimal Not Working RC (look caveat below)

lua << EOF
require'lspconfig'.rust_analyzer.setup{
    on_attach = function() require'lsp_signature'.on_attach({bind = true}) end
}
require'rust-tools'.setup()
EOF

Rust Setup (Working)

But if I change the ordering of these then it does work. Example -
Minimal Wokring RC (look caveat below)

lua << EOF
require'rust-tools'.setup()
require'lspconfig'.rust_analyzer.setup{
    on_attach = function() require'lsp_signature'.on_attach({bind = true}) end
}
EOF

Why report this issue if this is working?

  1. I would like to understand why this is happening and if you can provide any help in that regard would appreciate it.
  2. It might be helpful for someone else who stumbles on something similar. (Probably worthwhile to add this info in the Readme)

Caveat

Note: I am using NixOS and I have installed these with the nix pckage manager, so I don't have a vim/neovim installer. Don't really know how they work. But should be standard enough to set up.

Packages used here are

  1. nvim-lspconfig
  2. lsp_signature.nvim
  3. rust-tools.nvim

compe completions popup appears on top of the signature popup

Hey, I appreciate the work put into this plugin 👍

I have begun experimenting with it and I have noticed that the compe completions popup appears on top of the signature popup, both are shown at the same time:
image

In the gif shown in https://www.reddit.com/r/neovim/comments/mzjxhq/lsp_signature_can_be_better/ the signature popup is hidden when the completions popup is shown. Is there something else I need to configure?

I have only followed the readme instructions. I am calling require'lsp_signature'.on_attach() inside the LSP's on_attach function for a given lsp config.

Solargraph: .vim/bundle/lsp_signature.nvim/lua/lsp_signature.lua:168: attempt to get length of field 'parameters' (a nil value)

Build info:

NVIM v0.5.0
Build type: Release
LuaJIT 2.0.5

I have lspconfig setup with https://github.com/hrsh7th/nvim-compe and solargraph
With a ruby script like so:

# frozen_string_literal: true

puts()

Trying to see the signature for puts returns

Error executing vim.schedule lua callback: ...ond/.vim/bundle/lsp_signature.nvim/lua/lsp_signature.lua:168: attempt to get length of field 'parameters' (a nil value)

I tried positioning the cursor after the ( and then doing lua require'lsp_signature'.signature(), and it gives me the same error.

lsp_signature_helper.lua:97: attempt to get length of field 'parameters' (a nil value)

This error message will appear when I enter a method without any parameter.

Reproduce steps:

  1. Type any.MethodWithoutParam(

Lsp Info:

❯ go version
go version go1.16.5 darwin/amd64
❯ gopls version
golang.org/x/tools/gopls v0.7.0
    golang.org/x/tools/[email protected] h1:JQBHW81Gsyim6iDjUwGoPeSpXrSqwen3isPJLfDfaYU=

Env info:

NVIM v0.6.0-dev+1555-gc818d8df3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210727-78977-ur3n3z/build/config -I/tmp/neovim-20210727-78977-ur3n3z/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210727-78977-ur3n3z/build/src/nvim/auto -I/tmp/neovim-20210727-78977-ur3n3z/build/include
编译者 [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

     系统 vimrc 文件: "$VIM/sysinit.vim"
         $VIM 预设值: "/usr/local/Cellar/neovim/HEAD-c818d8d/share/nvim"

Run :checkhealth for more info

Getting "failed get highlight parameter 0 0"

Hello!

I am trying get highlight of the parameters in the pop-up, but as soon as I type ( to provide the parameters I get the error failed get highlight parameter 0 0.
This is using pyright and the following python code can be used to reproduce it:

import os

def bla(a: int, b: int, c: int, d: int):
    print(f"a #{a}, b #{b}, c #{c}, d #{d}")

def x(a):
    print("hey! %s" % a)
    bla(

Here is a screenshot:

image

Here is the debug output:

שׁ  |1: insert enter
שׁ  |1: insert enter
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: signature triggered
שׁ  |1: sig result |2: {
  activeParameter = 4,
  activeSignature = 0,
  signatures = { {
      activeParameter = 0,
      label = "(a: int, b: int, c: int, d: int) -> None",
      parameters = { {
          label = { 1, 7 }
        }, {
          label = { 9, 15 }
        }, {
          label = { 17, 23 }
        }, {
          label = { 25, 31 }
        } }
    } }
}
 |3: {
  border = "single",
  check_client_handlers = true,
  check_pumvisible = true,
  line_to_cursor = "    bla(",
  trigger_from_lsp_sig = true,
  triggered_chars = { "(", ",", ")" }
}

שׁ  |1: no next param
שׁ  |1: md lines |2: { "```python", "(a: int, b: int, c: int, d: int) -> None", "```" }

שׁ  |1: label: |2: (a: int, b: int, c: int, d: int) -> None |3: 0 |4: 1 |5: 4 |6: {
  activeParameter = 0,
  label = "(a: int, b: int, c: int, d: int) -> None",
  parameters = { {
      label = { 1, 7 }
    }, {
      label = { 9, 15 }
    }, {
      label = { 17, 23 }
    }, {
      label = { 25, 31 }
    } }
}

שׁ  |1: win config |2: {
  border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
  check_client_handlers = true,
  check_pumvisible = true,
  close_events = { "BufHidden", "InsertLeavePre" },
  focus_id = "textDocument/signatureHelplsp_signature795",
  line_to_cursor = "    bla(",
  max_height = 12,
  max_width = 120,
  offset_x = -1,
  stylize_markdown = true,
  trigger_from_lsp_sig = true,
  triggered_chars = { "(", ",", ")" },
  zindex = 200
}

שׁ  |1: extmark |2: 0 |3: 0
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start
שׁ  |1: timer start

From a quick glance at the code, I couldn't figure out the issue. I got here:

local nextParameter = signature.parameters[activeParameter + 1]

Can't really tell why that is returning nil? Or perhaps I am following the code incorrectly. My lua skillz aren't that great.

Any ideas?

Thanks!

error on signature window open

Hi 👋🏾 ,

I'm trying this plugin whilst working with dartls and everytime the signature window opens I get a

Error executing vim.schedule lua callback: ...ck/packer/start/lsp_signature.nvim/lua/lsp_signature.lua:175: attempt to perform arithmetic on local 's' (a nil value)

vim.api.nvim_buf_set_extmark(bufnr, ns, 0, s - 1, {end_line = 0, end_col = l, hl_group = hi})

This seems to be coming from this line above, likely because the s value is returning nil when trying to match a the active parameter. Dart has labelled arguments like my_param: value so I don't know if this somehow breaks fetching the active parameter.

How to use this standalone?

If I use the built-in signature help

vim.api.nvim_set_keymap("n", "gk", "<cmd>lua vim.lsp.buf.signature_help()<CR>", {})

I see the markdown backticks, however since the built-in signature help doesn't actually render a markdown preview, this is not-so-useful (note the backticks around ("output"):
2021-04-30-120948_1873x724_scrot

If i use lspsaga to render the signature help

vim.api.nvim_set_keymap("n", "gk", "<cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>", {})

I get a nicely rendered markdown help, however I dont see any highlighting of the current parameter:
2021-04-30-121119_1106x567_scrot

How do I use this plugin?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.