admin管理员组

文章数量:1198624

I recently switched from VSCode to neovim and managed to create a nice setup for java editing. However, I an not happy with the way how treesitter renders documentation (see images). Basically, markdown items a rendered correctly, but you are left with the huge gaps where markup code once was. It affect readability badly. This is how it looks in neovim:

When I click on rendered markdow items, gaps fill be filled with the original markdown cose. The gaps are exactly where the markdup code was:

My treeseeter setup is nothing special:

{
    "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate",
    opts = {
      highlight = {
        enable = true,
        additional_vim_regex_highlighting = false,
      },
      indent = {
        enable = true,
      },
      ensure_installed = {
        "java",
        "python",
        "html",
        "css",
        "bash",
        "javascript",
        "vue",
        "json",
        "lua",
        "markdown",
        "markdown_inline",
        "regex",
      },
      incremental_selection = {
        enable = true,
      },
      auto_install = true,
    },
    config = function(_, opts)
      require("nvim-treesitter.configs").setup(opts)
    end,
  },

I used mason, nvim-jdtls as LSP for Java, lspconfig for basic configuration and blink for autocompletion, that's it, nothing exotic. Is there any wat to get rid of the gaps in the rendered documentation provided by LSP?

Looks like a simple problem, but i could not manage to solve it. Is there any hook in treesitter highlighter where you can plug some better markdown rendering?

本文标签: Documentation rendering with nvimjdtls and treesitter in NeovimStack Overflow