josean-dev / dev-environment-files

2.64k stars 740 forks source link

Fixed treesitter/highlighter error #3

Closed jeantimex closed 1 year ago

jeantimex commented 1 year ago

With the latest treesitter and nvim, we see some errors like https://github.com/nvim-treesitter/nvim-treesitter/issues/1201, to fix the issue, we just need to set run = ":TSUpdate",.

josean-dev commented 1 year ago

Hey! Thanks so much for pointing this out. It helped me realize I made a tiny mistake when adding tree-sitter to packer which was accidentally not updating the parsers after any nvim-treesitter install or update. Thanks again!

I've fixed it in this recent commit: de7061dd5373100c2c1dccb1f759ad350a5cf88a

I modified the code to this:

 use({
    "nvim-treesitter/nvim-treesitter",
    run = function()
      local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
      ts_update()
    end,
  })

Essentially this does the same thing as your modification, but won't throw an error on the initial install of nvim-treesitter. I looked at the documentation again to see what their recommendation was here: https://github.com/nvim-treesitter/nvim-treesitter/wiki/Installation#packernvim

jeantimex commented 1 year ago

Nice work! Your solution works great! :)