ci(keymaps): pin Neovim 0.11 from upstream release tarball
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:
@@ -76,11 +76,21 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
|
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-test-
|
${{ runner.os }}-cargo-test-
|
||||||
- name: install neovim + vim
|
- name: install Neovim 0.11 + Vim
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update -qq
|
set -euo pipefail
|
||||||
sudo apt-get install -y --no-install-recommends neovim vim
|
# 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
|
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
|
vim --version | head -1
|
||||||
- name: run Neovim keymap harness
|
- name: run Neovim keymap harness
|
||||||
run: ./scripts/test-keymaps.sh
|
run: ./scripts/test-keymaps.sh
|
||||||
|
|||||||
@@ -82,11 +82,18 @@ local function run(name, opts)
|
|||||||
record(ok, name, ok and '' or tostring(err))
|
record(ok, name, ok and '' or tostring(err))
|
||||||
end
|
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 function wait_for_lsp(timeout_ms)
|
||||||
local deadline = vim.loop.now() + (timeout_ms or 5000)
|
local deadline = vim.loop.now() + (timeout_ms or 5000)
|
||||||
while vim.loop.now() < deadline do
|
while vim.loop.now() < deadline do
|
||||||
local clients = vim.lsp.get_clients({ name = 'nuwiki', bufnr = 0 })
|
local clients = get_lsp_clients({ name = 'nuwiki', bufnr = 0 })
|
||||||
if #clients > 0 and clients[1].server_capabilities.executeCommandProvider then
|
if #clients > 0 and clients[1].server_capabilities
|
||||||
|
and clients[1].server_capabilities.executeCommandProvider then
|
||||||
return clients[1]
|
return clients[1]
|
||||||
end
|
end
|
||||||
sleep(100)
|
sleep(100)
|
||||||
|
|||||||
Reference in New Issue
Block a user