mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-24 13:03:54 -06:00
Compare commits
5 Commits
eda9c78923
...
bdbf0b1fc3
Author | SHA1 | Date | |
---|---|---|---|
bdbf0b1fc3 | |||
e9e94e7fc5 | |||
|
462b04fd96 | ||
6e69cc2751 | |||
4aee573e50 |
@ -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({
|
||||
|
@ -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,
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user