Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Strange signatureHelp markdown rendering #1020

Open
4 tasks done
ColinKennedy opened this issue Dec 21, 2024 · 1 comment
Open
4 tasks done

bug: Strange signatureHelp markdown rendering #1020

ColinKennedy opened this issue Dec 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ColinKennedy
Copy link

ColinKennedy commented Dec 21, 2024

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-903+gab98c5b5a

Operating system/version

Windows, WSL

Describe the bug

The rendering of google-style Python docstrings is different compared to Neovim's built-in signature help.

Built-in

image

Noice

image

As you can see, the indentation of parameters is getting "flattened", the parameter names are listed twice, and value has its description written twice where the other two parameters are listed twice but the description only once

Steps To Reproduce

Using this example file:

reproduction.lua
def foo(bar: int, value: str, another: dict[str, int]) -> None:
    """Some information here.

    ```
    some
        indented text

    ```

    out of fence
        indented text

    Args:
        bar: I am `fenced markdown`.
        value: This is *bold probably*. Okay maybe **this is bold?**
        another: Is this _italics, maybe?_

    """
    print(bar)

foo(8, 'sadfasfd')
  1. Open nvim -u reproduction.lua test.py
  2. Begin typing within the foo() parentheses

Expected Behavior

The docstring should be largely the same formatting as the original. Parameters are listed exactly once, with description information.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    {
      "neovim/nvim-lspconfig",
      config = function()
        local lspconfig = require("lspconfig")
        local capabilities = vim.lsp.protocol.make_client_capabilities()

        lspconfig.basedpyright.setup {
            capabilities = capabilities,
            on_attach = on_attach,
            settings = {
                basedpyright = {
                    analysis = { diagnosticMode = "openFilesOnly", typeCheckingMode = "off" },
                }
            }
        }
      end,
    },
    {
        "folke/noice.nvim",
        event = "VeryLazy",
        config = function()
          require("noice").setup({
          lsp = {
            -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
            override = {
              ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
              ["vim.lsp.util.stylize_markdown"] = true,
              ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
            },
          },
          -- you can enable a preset for easier configuration
          presets = {
            bottom_search = true, -- use a classic bottom cmdline for search
            command_palette = true, -- position the cmdline and popupmenu together
            long_message_to_split = true, -- long messages will be sent to a split
            inc_rename = false, -- enables an input dialog for inc-rename.nvim
            lsp_doc_border = false, -- add a border to hover docs and signature help
          },
        })
        end,
        dependencies = {
            -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
            "MunifTanjim/nui.nvim",
        }
    },
  }
})
@ColinKennedy ColinKennedy added the bug Something isn't working label Dec 21, 2024
@liamaharon
Copy link

I also have this issue with rust-analyzer.

The issue also causes any LSP links in the signatureHelp to break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants