From 37032dabd657ae567011e7ab4f881ecbf476eb76 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 15 Oct 2025 08:41:55 +0200 Subject: [PATCH] feat(treesitter): add installation instructions to get a C compiler on windows --- lua/lazyvim/health.lua | 3 +++ lua/lazyvim/util/treesitter.lua | 3 +++ 2 files changed, 6 insertions(+) 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