feat(treesitter): add installation instructions to get a C compiler on windows

This commit is contained in:
Folke Lemaitre
2025-10-15 08:41:55 +02:00
parent 413b9d5fa9
commit 37032dabd6
2 changed files with 6 additions and 0 deletions

View File

@@ -47,6 +47,9 @@ function M.check()
"See the requirements at [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#requirements)"
)
info("Run `:checkhealth nvim-treesitter` for more information.")
if vim.fn.has("win32") == 1 and not health["C compiler"] then
info("Install a C compiler with `winget install --id=BrechtSanders.WinLibs.POSIX.UCRT -e`")
end
end
end

View File

@@ -93,6 +93,9 @@ function M.build(cb)
"See the requirements at [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#requirements)",
"Run `:checkhealth nvim-treesitter` for more information.",
})
if vim.fn.has("win32") == 1 and not health["C compiler"] then
lines[#lines + 1] = "Install a C compiler with `winget install --id=BrechtSanders.WinLibs.POSIX.UCRT -e`"
end
vim.list_extend(lines, err and { "", err } or {})
LazyVim.error(lines, { title = "LazyVim Treesitter" })
end