ci(keymaps): pin Neovim 0.11 from upstream release tarball
CI / cargo fmt --check (push) Successful in 20s
CI / cargo clippy (push) Successful in 1m18s
CI / cargo test (push) Successful in 1m13s
CI / editor keymaps (push) Successful in 1m44s

CI log for the keymaps job showed Lua crashing with
`attempt to call field 'get_clients' (a nil value)` plus a flood of
`W18: Invalid character in group name` on the `@vimwiki*` highlight
links. Both signal that apt's `neovim` package is too old (Ubuntu
LTS ships 0.6/0.7) — `vim.lsp.get_clients` only landed in 0.10, and
Tree-sitter-style `@group.modifier` highlight names only became
valid sometime in the 0.8-ish era.

Switched the installer to pull the official static tarball
(`neovim/neovim/releases/v0.11.3/nvim-linux-x86_64.tar.gz`) and
symlink it into `/usr/local/bin/nvim`. Vim from apt is kept — it
only runs the pure-VimL harness so its age doesn't matter.

Also added a defensive fallback in the harness:
`get_lsp_clients = vim.lsp.get_clients or vim.lsp.get_active_clients`,
plus a `server_capabilities` nil guard. Won't matter on the pinned
0.11 runner, but means a future regression that drops the deps will
fail with a clear `lsp.attached` FAIL message instead of a Lua
stack trace.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 13:29:37 +00:00
parent a489bea480
commit a229977b77
2 changed files with 22 additions and 5 deletions
+13 -3
View File
@@ -76,11 +76,21 @@ jobs:
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-test-
- name: install neovim + vim
- name: install Neovim 0.11 + Vim
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends neovim vim
set -euo pipefail
# Apt's neovim is too old (Ubuntu LTS ships 0.6/0.7), missing
# `vim.lsp.get_clients` and rejecting `@group.modifier`
# highlight names. Pull the official static tarball instead.
NVIM_VER=v0.11.3
curl -fsSL -o /tmp/nvim.tar.gz \
"https://github.com/neovim/neovim/releases/download/${NVIM_VER}/nvim-linux-x86_64.tar.gz"
sudo tar -xzf /tmp/nvim.tar.gz -C /opt
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim
nvim --version | head -1
# Vim from apt is fine — only the pure-VimL keymaps run there.
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends vim
vim --version | head -1
- name: run Neovim keymap harness
run: ./scripts/test-keymaps.sh
+9 -2
View File
@@ -82,11 +82,18 @@ local function run(name, opts)
record(ok, name, ok and '' or tostring(err))
end
local function get_lsp_clients(opts)
local fn = vim.lsp.get_clients or vim.lsp.get_active_clients
if not fn then return {} end
return fn(opts)
end
local function wait_for_lsp(timeout_ms)
local deadline = vim.loop.now() + (timeout_ms or 5000)
while vim.loop.now() < deadline do
local clients = vim.lsp.get_clients({ name = 'nuwiki', bufnr = 0 })
if #clients > 0 and clients[1].server_capabilities.executeCommandProvider then
local clients = get_lsp_clients({ name = 'nuwiki', bufnr = 0 })
if #clients > 0 and clients[1].server_capabilities
and clients[1].server_capabilities.executeCommandProvider then
return clients[1]
end
sleep(100)