feat(treesitter): on windows, use gcc if available and cl.exe is not available for building parsers

This commit is contained in:
Folke Lemaitre
2025-10-15 08:36:32 +02:00
parent f8e8ea4b5e
commit 2a1f3c3701

View File

@@ -59,6 +59,16 @@ return {
config = function(_, opts)
local TS = require("nvim-treesitter")
-- On Windows, use `gcc` if `cl` is not available, and `gcc` is.
if
not vim.env.CC
and vim.fn.has("win32") == 1
and vim.fn.executable("cl") == 0
and vim.fn.executable("gcc") == 1
then
vim.env.CC = "gcc"
end
setmetatable(require("nvim-treesitter.install"), {
__newindex = function(_, k)
if k == "compilers" then