mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
feat(treesitter): show an error if the user tries to set a custom treesitter compiler
This commit is contained in:
@@ -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`")
|
||||
|
||||
Reference in New Issue
Block a user