Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions test/contexts_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ setup(function()
--- @type string
local treesitter_lang = exec_lua(
[[
local ok, parser = pcall(vim.treesitter.get_parser, ...)
if not ok then
return nil
end
return parser:lang()
return require('nvim-treesitter.parsers').get_buf_lang(...)
Copy link
Member

Choose a reason for hiding this comment

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

nvim-treesitter is going to be replaced with the main branch soon enough, so I'd like to minimise relying on any it's API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so looks like in main we register the filetype to lang mappings immediately instead of lazily in which case we can use vim.treesitter.language.get_lang directly. we could change it to that anticipatorily, just that this PR won't work until main is swapped in

Copy link
Member

Choose a reason for hiding this comment

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

I think we can safely switch to main in this repo even though it isn't default yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like the main branch is using an incompatible vim.validate signature than the one the runner is using. the runner expects a table, but we're giving a string

Copy link
Member

Choose a reason for hiding this comment

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

We can update the runner to 0.11.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean explicitly only 0.11? because the vim.validate usage is not compatible with 0.10.2

Copy link
Member

Choose a reason for hiding this comment

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

We only have 1 runner version and several test versions. The runner version should ideally be the latest release.

]],
bufnr
)
Expand Down Expand Up @@ -111,7 +107,7 @@ for _, lang in ipairs(langs_with_queries) do
return
end

setup(function()
lazy_setup(function()
cmd([[let $XDG_CACHE_HOME='scratch/cache']])
install_langs(lang)
end)
Expand Down
Loading