Skip to content
This repository was archived by the owner on Jul 21, 2024. It is now read-only.
This repository was archived by the owner on Jul 21, 2024. It is now read-only.

Treesitter markdown highlight failure on pyright completion auto-import documentation #12

@deathbeam

Description

@deathbeam

Stacktrace:

Error in decoration provider treesitter/highlighter.line:
Error executing lua: /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:291: Invalid 'end_row': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:291: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:209: in function 'for_each_highlight_state'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:251: in function 'on_line_impl'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:320: in function </usr/share/nvim/runtime/lua/vim/tr
eesitter/highlighter.lua:314>

Coming from this (commenting it out resolves the issue):

        vim.treesitter.start(wininfo.bufnr, 'markdown')

Cause:

image

To reproduce:

Setup pyright lsp, start typing requests,navigate to any of the Auto-Import fields.

Works fine with mini.completion and nvim-cmp, this is what mini.completion uses (I think)

https://github.com/echasnovski/mini.completion/blob/main/lua/mini/completion.lua#L909

This is how it looks with the treesitter markdown highlight call disabled:

image

This is how it looks with mini.completion:
image

My settings (on nvim nighlty):

require('epo').setup({
    -- fuzzy match
    fuzzy = false,
    -- increase this value can aviod trigger complete when delete character.
    debounce = 50,
    -- when completion confrim auto show a signature help floating window.
    signature = true,
    -- vscode style json snippet path
    snippet_path = nil,
    -- border for lsp signature popup, :h nvim_open_win
    signature_border = 'single',
    -- lsp kind formatting, k is kind string "Field", "Struct", "Keyword" etc.
    kind_format = function(k)
      return k
    end
})

vim.o.completeopt = 'menu,menuone,noinsert,popup'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions