Closed savchenko closed 3 months ago
That means you still have a treesitter module setup method somewhere in your config.
Look for something like require("nvim-treesitter.configs").setup
and remove the related autotag section from it.
Feel free to reopen this if you can confirm you're not setting up via nvim-treesitter
at all and still facing this.
Thanks 🙂
I am still facing a similar issue. The below configuration leads to me getting a Deprecation warning on the first time I enter a buffer. Is there any way to turn off this warning? From what I checked, I have not set the autotag
value in treesitter config.
require("nvim-treesitter.configs").setup({
ensure_installed = {
"python",
"bash",
"lua",
"vim",
"go",
"gomod",
"gosum",
"gowork",
"gotmpl",
"rust",
},
highlight = {
enable = true,
disable = function(_, buf)
local max_filesize = 240 * 1024
local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
},
})
require("nvim-ts-autotag").setup({
-- Defaults
enable = true,
filetypes = {
"html",
"javascriptreact",
"javascript",
"typescript",
"typescriptreact",
"tsx",
"jsx",
},
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = false, -- Auto close on trailing </
-- Also override individual filetype configs, these take priority.
-- Empty by default, useful if one of the "opts" global settings
-- doesn't work well in a specific filetype
per_filetype = {
["html"] = {
enable_close = false,
},
},
})
packadd({
"nvim-treesitter/nvim-treesitter",
event = "BufRead",
build = ":TSUpdate",
config = conf.nvim_treesitter,
})
packadd({
"windwp/nvim-ts-autotag",
event = "BufReadPre",
config = conf.ts_autotag,
})
@cool-pants Hi. I was facing the same probem and to fix this problem I just set autotag to false on treesitter
config:
autotag = {
enable = false,
},
This is my treesitter
file:
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup {
ensure_installed = {
"lua",
"luadoc",
"bash",
"c",
"cmake",
"make",
"html",
"css",
"scss",
"markdown",
"markdown_inline",
"vim",
"vimdoc",
"query",
"dockerfile",
"gitignore",
"javascript",
"jsdoc",
"typescript",
"tsx",
"python",
"diff",
},
-- Autoinstall parsers that are not installed
auto_install = true,
autopairs = {
enable = true,
},
autotag = {
enable = false,
},
endwise = {
enable = true,
},
highlight = {
enable = true,
},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
}
end
}
@cool-pants Hi. I was facing the same probem and to fix this problem I just set autotag to false on
treesitter
config:autotag = { enable = false, },
This is my
treesitter
file:return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() require("nvim-treesitter.configs").setup { ensure_installed = { "lua", "luadoc", "bash", "c", "cmake", "make", "html", "css", "scss", "markdown", "markdown_inline", "vim", "vimdoc", "query", "dockerfile", "gitignore", "javascript", "jsdoc", "typescript", "tsx", "python", "diff", }, -- Autoinstall parsers that are not installed auto_install = true, autopairs = { enable = true, }, autotag = { enable = false, }, endwise = { enable = true, }, highlight = { enable = true, }, indent = { enable = true, }, incremental_selection = { enable = true, keymaps = { init_selection = "gnn", node_incremental = "grn", scope_incremental = "grc", node_decremental = "grm", }, }, } end }
This seems to solve my issue as well. Thanks 🫡
The error is returned despite using the recommended setup method. Using latest versions of the plugin, treesitter and nVim (v0.10.0).
Configuration
Error