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

Invalid treesitter nodes with Haskell #348

Open
crumbtoo opened this issue May 20, 2024 · 1 comment
Open

Invalid treesitter nodes with Haskell #348

crumbtoo opened this issue May 20, 2024 · 1 comment
Labels

Comments

@crumbtoo
Copy link

Explain the issue

When editing Haskell, Treesitter throws invalid node errors whenever the cursor moves over a delimiter.

Error detected while processing CursorMoved Autocommands for "*"..function 3[3]..4[71]..matchup#delim#get_current[1]..<SNR>75_get_delim_multi[3]..<SNR>75_get_delim[166]..matchup#delim#skip[13
]..matchup#ts_syntax#skip_expr[1]..matchup#ts_syntax#lang_skip[1]..<SNR>76_forward:
line    1:
E5108: Error executing lua ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 180 for language haskell
stack traceback:
        [C]: in function '_ts_parse_query'
        ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get_query'
        ...vim-matchup/lua/treesitter-matchup/third-party/query.lua:55: in function 'get_query'
        ...vim-matchup/lua/treesitter-matchup/third-party/query.lua:142: in function 'prepare_query'
        ...vim-matchup/lua/treesitter-matchup/third-party/query.lua:339: in function 'iter_group_results'
        ...vim-matchup/lua/treesitter-matchup/third-party/query.lua:351: in function 'collect_group_results'
        ...vim-matchup/lua/treesitter-matchup/third-party/query.lua:23: in function 'update_cached_matches'
        ...vim-matchup/lua/treesitter-matchup/third-party/query.lua:31: in function 'get_matches'
        .../nvim/lazy/vim-matchup/lua/treesitter-matchup/syntax.lua:26: in function 'get_skips'
        .../nvim/lazy/vim-matchup/lua/treesitter-matchup/syntax.lua:60: in function 'lang_skip'
        [string "luaeval()"]:1: in main chunk
Press ENTER or type command to continue

Most issues are related to bugs or problems. In these cases, you should
include a minimal working example and a minimal vimrc file (see below), as
well as:

  1. What vim version are you using? If using neovim, Are you using
    tree-sitter or classic matching?
$ nvim --version
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1713517273
  1. Steps to reproduce
    Edit a Haskell file and, while in normal or insert mode, move the cursor over a parenthesis.

  2. Expected behavior
    No errors :p.

  3. Observed behavior
    Errors thrown.

If your issue is instead a feature request or anything else, please
consider if minimal examples and vimrc files might still be relevant.

Minimal working example

Please provide a minimal working example, e.g.,

module Something where

doge :: Soge (Parenthesis Here)
doge = "move ^ your cursor    ^ over these"

Minimal vimrc file

(No configuration done)

set nocompatible

" load match-up
let &rtp  = '~/.vim/bundle/vim-matchup,' . &rtp
let &rtp .= ',~/.vim/bundle/vim-matchup/after'

" load other plugins, if necessary
" let &rtp = '~/path/to/other/plugin,' . &rtp

filetype plugin indent on
syntax enable

" match-up options go here
@gregorias
Copy link

For reference, I reported this issue in #347 as well.

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

No branches or pull requests

2 participants