feat(treesitter): show an error if the user tries to set a custom treesitter compiler

This commit is contained in:
Folke Lemaitre
2025-09-21 11:04:23 +02:00
parent b4606f9df3
commit 89ff1fd600

View File

@@ -58,6 +58,21 @@ return {
config = function(_, opts)
local TS = require("nvim-treesitter")
setmetatable(require("nvim-treesitter.install"), {
__newindex = function(_, k)
if k == "compilers" then
vim.schedule(function()
LazyVim.error({
"Setting custom compilers for `nvim-treesitter` is no longer supported.",
"",
"For more info, see:",
"- [compilers](https://docs.rs/cc/latest/cc/#compile-time-requirements)",
})
end)
end
end,
})
-- some quick sanity checks
if not TS.get_installed then
return LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")