diff --git a/README.md b/README.md index 4e8b76a..3f8395a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Use treesitter to **autoclose** and **autorename** html tag -It work with html,tsx,vue,svelte. +It work with html,tsx,vue,svelte,php. ## Usage diff --git a/lua/nvim-ts-autotag/_log.lua b/lua/nvim-ts-autotag/_log.lua index b502de2..7873731 100644 --- a/lua/nvim-ts-autotag/_log.lua +++ b/lua/nvim-ts-autotag/_log.lua @@ -5,9 +5,9 @@ if _G.__is_log then } else return{ - debug = function() end, - info = function() end, - error = function() end, + debug = function(_) end, + info = function(_) end, + error = function(_) end, } end diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua index eae3148..886bb0d 100644 --- a/lua/nvim-ts-autotag/internal.lua +++ b/lua/nvim-ts-autotag/internal.lua @@ -8,6 +8,7 @@ local M = {} M.tbl_filetypes = { 'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx', + 'php', 'glimmer','handlebars','hbs' } @@ -19,7 +20,7 @@ M.tbl_skipTag = { local ERROR_TAG = "ERROR" local HTML_TAG = { - filetypes = {'html'}, + filetypes = {'html','php'}, start_tag_pattern = 'start_tag', start_name_tag_pattern = 'tag_name', end_tag_pattern = "end_tag", diff --git a/sample/index.php b/sample/index.php index 9207d98..bddf5dc 100644 --- a/sample/index.php +++ b/sample/index.php @@ -21,7 +21,9 @@

- + + + diff --git a/tests/closetag_spec.lua b/tests/closetag_spec.lua index d378113..34deee7 100644 --- a/tests/closetag_spec.lua +++ b/tests/closetag_spec.lua @@ -177,6 +177,15 @@ local data = { before = [[| ]] }, + { + name = "18 php div " , + filepath = './sample/index.php', + filetype = "php", + linenr = 25, + key = [[>]], + before = [[| ]] + }, } local run_data = {} for _, value in pairs(data) do