mirror of
https://github.com/windwp/nvim-ts-autotag.git
synced 2025-01-01 13:59:13 -06:00
add log utils
This commit is contained in:
parent
6c4f0ffbcf
commit
586eedce4b
@ -1,4 +1,5 @@
|
||||
local _, ts_utils = pcall(require, 'nvim-treesitter.ts_utils')
|
||||
local log = require('nvim-ts-autotag._log')
|
||||
local M={}
|
||||
|
||||
M.dump_node = function(node)
|
||||
@ -17,4 +18,13 @@ M.is_close_empty_node = function(node)
|
||||
return tag_name:match("%<%/%>$")
|
||||
end
|
||||
|
||||
|
||||
M.dump_node_text = function(target)
|
||||
for node in target:iter_children() do
|
||||
local node_type = node:type()
|
||||
local text = ts_utils.get_node_text(node)
|
||||
log.debug("type:" .. node_type .. " ")
|
||||
log.debug(text)
|
||||
end
|
||||
end
|
||||
return M
|
||||
|
@ -1,5 +1,7 @@
|
||||
local ts = require 'nvim-treesitter.configs'
|
||||
|
||||
local log=require('nvim-ts-autotag._log')
|
||||
|
||||
if not _G.test_rename then
|
||||
return
|
||||
end
|
||||
@ -218,6 +220,7 @@ local function Test(test_data)
|
||||
-- autotag.renameTag()
|
||||
helpers.feed(value.key, 'x')
|
||||
helpers.feed("<esc>",'x')
|
||||
vim.wait(10)
|
||||
local result = vim.fn.getline(pos_before.linenr)
|
||||
eq(after, result , "\n\n ERROR: " .. value.name .. "\n")
|
||||
else
|
||||
@ -228,6 +231,6 @@ local function Test(test_data)
|
||||
end
|
||||
|
||||
describe('[rename tag]', function()
|
||||
Test(run_data)
|
||||
Test(run_data)
|
||||
end)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user