Skip to content

Commit 13cc25c

Browse files
committed
Fix CI test issue whereby nvim-treesitter changed their whole deal
https://github.com/nvim-treesitter/nvim-treesitter indicates they did a full rewrite which is incompatible. Currently, their latest is giving all kinds of verification issues downloading tarballs. Maybe some day in the future we should switch back from master to main (they say master will hang around for compat)
1 parent f83d36e commit 13cc25c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ test-watch: ## uses [nodemon](https://nodemon.io/) - watches for changes to lua
1717
test-ubuntu: ## Run tests in Ubuntu Docker container (matches CI environment)
1818
@docker run --rm -v $$(PWD):/workspace -w /workspace ubuntu:latest bash -c "\
1919
apt-get update && \
20-
apt-get install -y software-properties-common git curl make apt-utils gcc && \
20+
apt-get install -y software-properties-common git curl make apt-utils gcc g++ && \
2121
add-apt-repository -y ppa:neovim-ppa/unstable && \
2222
apt-get update && \
2323
apt-get install -y neovim lua-check && \
2424
mkdir -p /root/.local/share/nvim/lazy/ && \
2525
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim.git /root/.local/share/nvim/lazy/plenary.nvim && \
26-
git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter.git /root/.local/share/nvim/lazy/nvim-treesitter && \
26+
git clone --depth 1 --branch master https://github.com/nvim-treesitter/nvim-treesitter.git /root/.local/share/nvim/lazy/nvim-treesitter && \
2727
make test"
2828

2929
check: ## uses [luacheck](https://github.com/mpeterv/luacheck) - checks for any type errors or style issues

tests/minimal_init.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ vim.opt.swapfile = false
99
vim.cmd("runtime! plugin/treewalker.nvim")
1010
vim.cmd("runtime! plugin/plenary.vim")
1111
vim.cmd("runtime! plugin/nvim-treesitter")
12-
require('nvim-treesitter.configs').setup {
12+
13+
-- nvim-treesitter renamed `nvim-treesitter.configs` -> `nvim-treesitter.config`.
14+
-- Keep tests working across versions.
15+
local ok, ts_config = pcall(require, "nvim-treesitter.configs")
16+
if not ok then
17+
ts_config = require("nvim-treesitter.config")
18+
end
19+
20+
ts_config.setup {
1321
ensure_installed = {
1422
"lua",
1523
"c",
@@ -42,5 +50,6 @@ vim.treesitter.language.register('javascript', { 'js' })
4250
vim.treesitter.language.register('scheme', { 'scm' })
4351
vim.treesitter.language.register('yaml', { 'yml' })
4452
vim.treesitter.language.register('go', { 'go' })
53+
vim.treesitter.language.register('python', { 'py' })
4554

4655
dofile("plugin/init.lua") -- get the Treewalker command present

0 commit comments

Comments
 (0)