nvimdev / epo.nvim

A blazing fast and minimal neovim autocompletion
MIT License
132 stars 4 forks source link

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

Open deathbeam opened 9 months ago

deathbeam commented 9 months ago

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'
glepnir commented 9 months ago

it's a neovim bug . i will fix it on core later.