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

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

Open
deathbeam opened this issue Feb 12, 2024 · 1 comment

Comments

@deathbeam
Copy link

deathbeam commented Feb 12, 2024

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
Copy link
Member

glepnir commented Feb 12, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants