diff --git a/lua/lazyvim/health.lua b/lua/lazyvim/health.lua index 7af6ad94..2542c150 100644 --- a/lua/lazyvim/health.lua +++ b/lua/lazyvim/health.lua @@ -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 diff --git a/lua/lazyvim/util/treesitter.lua b/lua/lazyvim/util/treesitter.lua index d5c845fd..23795005 100644 --- a/lua/lazyvim/util/treesitter.lua +++ b/lua/lazyvim/util/treesitter.lua @@ -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