LunarVim / Neovim-from-scratch

📚 A Neovim config designed from scratch to be understandable
https://www.chrisatmachine.com/
GNU General Public License v3.0
5.3k stars 1.18k forks source link

TREESITTER ERROR!!! #333

Open RobertMiguel opened 2 weeks ago

RobertMiguel commented 2 weeks ago

My neovim is giving an error in the treeitter plugin and I don't know how to solve anything that can help me.

Errors:

Error in decoration provider treeitter/highlighter.win:
Error running lua: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 2:4. Invalid "bounding" node type:
  (delimiter) @markup.heading.1
   ^

stack trace:
        [C]: in function '_ts_parse_query'
        /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in 'get' function
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:28: in role 'new'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:240: in 'get_query' function
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:188: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:491: in function 'for_each_tree'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:175: in function 'prepare_highlight_states'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:398: in functions
Press ENTER or type a command to continue
Error in decoration provider treeitter/highlighter.win:
Error running lua: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 2:4. Invalid "bounding" node type:
  (delimiter) @markup.heading.1
   ^

stack trace:
        [C]: in function '_ts_parse_query'
        /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in 'get' function
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:28: in role 'new'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:240: in 'get_query' function
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:188: in function 'fn'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:491: in function 'for_each_tree'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:175: in function 'prepare_highlight_states'
        /usr/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:398: in functions

My settings:

treeitter.lua

local M = {
}
function M.config()
  local treesitter = require "nvim-treesitter"
  local configs = require "nvim-treesitter.configs"

  configs.setup {
    ensure_installed = { "lua", "java", "javascript", "typescript" }, -- put the language you want in this array
    -- ensure_installed = "all", -- one of "all" or a list of languages
    ignore_install = { "" },                                                       -- List of parsers to ignore installing
    sync_install = false,                                                          -- install languages synchronously (only applied to `ensure_installed`)

    highlight = {
      enable = true,       -- false will disable the whole extension
      disable = { "css" }, -- list of language that will be disabled
    },
    autopairs = {
      enable = true,
    },
    indent = { enable = true, disable = { "python", "css" } },

    context_commentstring = {
      enable = true,
      enable_autocmd = false,
    },
  }
end

return M
gnmearacaun commented 2 weeks ago

did you run :TSUpdate ?

gnmearacaun commented 2 weeks ago

you could try this: https://github.com/LunarVim/Neovim-from-scratch/issues/135#issuecomment-1133236547