ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.01k stars 56 forks source link

Raise error for some kind of python doc #270

Open fecet opened 1 year ago

fecet commented 1 year ago

Thanks for creating this amazing plugin. I found for some kind of doc string, lsp_signature will raise an error:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lu
a:1402: attempt to index a nil value
stack traceback:
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1402: in function 'stylize_markdo
wn'
        /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1665: in function 'open_floating_
preview'
        .../site/lazy/lsp_signature.nvim/lua/lsp_signature/init.lua:522: in function '
handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

I encounter this for function torch.utils.data.DistributedSampler

And its doc look like:

    r"""Sampler that restricts data loading to a subset of the dataset.

    It is especially useful in conjunction with
    :class:`torch.nn.parallel.DistributedDataParallel`. In such a case, each
    process can pass a :class:`~torch.utils.data.DistributedSampler` instance as a
    :class:`~torch.utils.data.DataLoader` sampler, and load a subset of the
    original dataset that is exclusive to it.

    .. note::
        Dataset is assumed to be of constant size and that any instance of it always
        returns the same elements in the same order.

    Args:

If I delete the line

    .. note::

everything works fine again.