fix(nvim): clean Windows startup for copilot and Mason ARM - #12
Conversation
Give copilot.lua an explicit config() so lazy.nvim can load it on Windows. Skip Mason lua-language-server, stylua, and tree-sitter-cli on Windows on ARM until native win_arm64 packages exist, and do not auto-install the Treesitter CLI there.
There was a problem hiding this comment.
🟡 Changes recommended
The new Windows ARM detection and vim.uv usage can still break startup on some setups (e.g., aarch64 machine strings and Neovim without vim.uv).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR targets a smoother Neovim startup on Windows by fixing lazy.nvim module auto-detection for zbirenbaum/copilot.lua and avoiding Mason auto-installs that fail on Windows on ARM due to missing win_arm64 packages.
Changes:
- Add an explicit
main+config()for the Copilot plugin spec so lazy.nvim doesn’t mis-detect the module on Windows. - Gate Mason
ensure_installedsolua-language-server,stylua, andtree-sitter-cliare not auto-installed on Windows ARM. - Extend Treesitter configuration (new parsers) and attempt to disable CLI auto-install on Windows ARM.
File summaries
| File | Description |
|---|---|
| .config/nvim/lua/plugins/treesitter.lua | Adds Treesitter parsers and disables CLI auto-install on Windows ARM (needs a small robustness fix). |
| .config/nvim/lua/plugins/mason.lua | Skips Mason auto-installs on Windows ARM via platform detection (needs vim.uv compatibility fallback). |
| .config/nvim/lua/plugins/copilot.lua | Adds explicit main/config to avoid lazy.nvim module detection issues for copilot.lua plugin name. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| local function is_windows_arm() | ||
| if vim.fn.has "win32" ~= 1 then return false end | ||
| local machine = (vim.uv.os_uname().machine or ""):lower() |
There was a problem hiding this comment.
init.lua uses (vim.uv or vim.loop), and vim.uv is Neovim 0.10+. In this repo it does not matter. AstroNvim 6 needs 0.11+, so vim.uv is always there.
| -- TODO(woa): Mason has no win_arm64 tree-sitter-cli; skip auto-install on ARM. | ||
| auto_install_cli = not (vim.fn.has "win32" == 1 and (vim.uv.os_uname().machine or ""):lower():find "arm"), |
There was a problem hiding this comment.
The substring point is correct in isolation: "aarch64":find("arm") is false. On Windows ARM it is not a real miss. os_uname().machine is ARM64 → arm64, which does contain
"arm". You also require has "win32", so Linux aarch64 never hits this line.
There was a problem hiding this comment.
🔵 Needs a closer look
The Windows ARM detection is inconsistent between Mason and Treesitter, which can re-trigger the CLI auto-install error on platforms that report aarch64.
Review details
Suppressed comments (1)
.config/nvim/lua/plugins/treesitter.lua:16
auto_install_clidisables the Tree-sitter CLI only whenos_uname().machinecontains "arm", but the Windows ARM detection inmason.luaalso treatsaarch64as ARM. If Neovim ever reportsaarch64on Windows ARM, Mason will skip installingtree-sitter-cliwhile Treesitter still tries to auto-install the CLI, reintroducing the startup error this PR is trying to avoid.
auto_install_cli = not (vim.fn.has "win32" == 1 and (vim.uv.os_uname().machine or ""):lower():find "arm"),
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Summary
Lua module not found for config of copilot.luastartup popup by givingzbirenbaum/copilot.luaan explicitmain/config()(lazy.nvim cannot auto-detect modules for plugins named*.luaon Windows).lua-language-server,stylua, andtree-sitter-clion Windows on ARM. Those packages have nowin_arm64builds, so Mason fails withThe current platform is unsupported.auto_install_clion Windows ARM (same Mason gap). LeftTODO(woa)comments to revisit when native packages exist; no x64 emulation.Test plan
:checkhealthno longer tries to Mason-install lua-ls/stylua/tree-sitter-cli:Copilot auth