Compare commits

..

5 Commits

Author SHA1 Message Date
bdbf0b1fc3
test: use sync install for ts parsers 2024-05-13 13:19:53 -05:00
e9e94e7fc5
fix: reparse source if the node has changes 2024-05-13 12:58:15 -05:00
Yussef Dalton
462b04fd96
Add Blade filetype
The only thing that's missing is it doesn't indent properly when you
close a tag, but otherwise it closes properly.
2024-05-13 12:58:15 -05:00
6e69cc2751
ci: use neovim nightly 2024-05-13 12:58:15 -05:00
4aee573e50
test: overhaul test setup and make commands 2024-05-13 12:58:14 -05:00
3 changed files with 9 additions and 4 deletions

View File

@ -256,6 +256,13 @@ local function find_tag_node(opt)
local name_tag_pattern = opt.name_tag_pattern
local skip_tag_pattern = opt.skip_tag_pattern
local find_child = opt.find_child or false
--- PERF: Some parsers don't seemingly pick up their trees correctly, so we have to reparse the
--- entire source. This is slow, see if we can avoid this.
if target and target:has_changes() then
local parser = vim.treesitter.get_parser()
_ = (parser and parser:parse(true) or nil)
target = ts_utils.get_node_at_cursor()
end
local node
if find_child then
node = find_child_match({

View File

@ -1,4 +1,5 @@
require("tests.minimal_init")
---@type string
local test_file = vim.v.argv[#vim.v.argv]
if test_file == "" or not test_file:find("tests/specs/", nil, true) then
@ -6,10 +7,6 @@ if test_file == "" or not test_file:find("tests/specs/", nil, true) then
end
print("[STARTUP] Running all tests in " .. test_file)
vim.cmd([[
]])
require("plenary.test_harness").test_directory(test_file, {
minimal_init = "tests/minimal_init.lua",
sequential = true,

View File

@ -37,6 +37,7 @@ end
M.setup_nvim_treesitter = function(opts)
opts = vim.tbl_deep_extend("keep", opts or {}, {
sync = true,
ensure_installed = {
"html",
"javascript",