Skip to content

fix(nvim): clean Windows startup for copilot and Mason ARM - #12

Merged
vcfvct merged 1 commit into
masterfrom
fix/nvim-windows-startup
Sep 5, 2026
Merged

vcfvct merged 1 commit into
masterfrom
fix/nvim-windows-startup

Conversation

@vcfvct

@vcfvct vcfvct commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix the Lua module not found for config of copilot.lua startup popup by giving zbirenbaum/copilot.lua an explicit main/config() (lazy.nvim cannot auto-detect modules for plugins named *.lua on Windows).
  • Skip Mason auto-install of lua-language-server, stylua, and tree-sitter-cli on Windows on ARM. Those packages have no win_arm64 builds, so Mason fails with The current platform is unsupported.
  • Disable AstroCore auto_install_cli on Windows ARM (same Mason gap). Left TODO(woa) comments to revisit when native packages exist; no x64 emulation.

Test plan

  • Start Neovim on Windows ARM: no Copilot/Mason error popups
  • :checkhealth no longer tries to Mason-install lua-ls/stylua/tree-sitter-cli
  • On non-ARM (macOS/Linux/Windows x64), Mason still installs lua-ls, stylua, and tree-sitter-cli
  • Copilot community pack still loads after :Copilot auth

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_installed so lua-language-server, stylua, and tree-sitter-cli are 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()

@vcfvct vcfvct Sep 5, 2026 •

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@copilot

Comment on lines +15 to +16
-- 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"),

@vcfvct vcfvct Sep 5, 2026 •

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@copilot

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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_cli disables the Tree-sitter CLI only when os_uname().machine contains "arm", but the Windows ARM detection in mason.lua also treats aarch64 as ARM. If Neovim ever reports aarch64 on Windows ARM, Mason will skip installing tree-sitter-cli while 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

@vcfvct
vcfvct merged commit 135dd5f into master Sep 5, 2026
2 checks passed
@vcfvct
vcfvct deleted the fix/nvim-windows-startup branch September 5, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants