windwp / nvim-ts-autotag

Use treesitter to auto close and auto rename html tag
MIT License
1.69k stars 90 forks source link

Support php and blade files #26

Closed rodrigore closed 2 years ago

rodrigore commented 3 years ago

Hi! I was wondering if is possible to add support for laravel template engine (blade filetype) or how can I help to make it real? Thanks for the plugin!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

codepuncher commented 2 years ago

Hi @windwp, any chance we could revisit this? Thanks

ZayRTun commented 10 months ago

Hello, any updates on this? Thanks

PriceHiller commented 5 months ago

Hello, this should be resolved now with the merging of #173. If it doesn't work, please ping me and I'll reopen this issue.

(As a part of @ydalton contributing to my fork, thanks)

Dieal commented 5 months ago

Hello, this should be resolved now with the merging of #173. If it doesn't work, please ping me and I'll reopen this issue.

(As a part of @ydalton contributing to my fork, thanks)

Still doesn't work for me

PriceHiller commented 5 months ago

Hello, this should be resolved now with the merging of #173. If it doesn't work, please ping me and I'll reopen this issue. (As a part of @ydalton contributing to my fork, thanks)

Still doesn't work for me

Can you supply an example? I can't really debug this issue otherwise.

ydalton commented 5 months ago

Still doesn't work for me

Do you have the Blade treesitter grammar installed? You also need to have your injections and highlights configured correctly, otherwise HTML tags in Blade won't work.

Dieal commented 5 months ago

Still doesn't work for me

Do you have the Blade treesitter grammar installed? You also need to have your injections and highlights configured correctly, otherwise HTML tags in Blade won't work.

I tried installing it before, but I was unsuccessful. I added this to my config:

    config = function(_, opts)

      local parser_config = require("nvim-treesitter.parsers").get_parser_configs()

      parser_config.blade = {
        install_info = {
          url = "https://github.com/EmranMR/tree-sitter-blade",
          files = { "src/parser.c" },
          branch = "main",
        },
        filetype = "blade",
      }

      vim.filetype.add({
        pattern = {
          ['.*%.blade%.php'] = 'blade',
        },
      })

      -- [[ Configure Treesitter ]]
      -- See `:help nvim-treesitter`
      require('nvim-treesitter.configs').setup(opts)

    end
  },

and installed through TSInstall blade. The things I missed were the injections and the highlights, which I now configured by following this thread. Now it works, sorry for the ignorance!