windwp/nvim-ts-autotag

Elixir support still a problem

srcrip opened this issue ยท 7 comments

See title. There's been several tickets auto closed by stale bot.

Sorry for the long delay here, I'll take a look at a few of them.

In the meantime though, PRs are very much welcome.

No problem, check out some of the closed prs I think one of them may fix it

Hey @srcrip can you take a look at the related PR (#206) and let me know if that works for Elixir? I have exactly 0 Elixir experience, so I need another person to let me know ๐Ÿ™‚

Thanks @PriceHiller, I think this branch does in fact fix it for normal html tags in heex files.

If possible though, heex in elixir also has this other html-like tag that looks like this:

    <.stepper current_step={@current_step} target={@myself} class="lg:hidden -ml-1">
      <:step name={:personal}>
        <span class="me-2">1.</span>
        Personal <span class="hidden sm:inline-flex sm:ms-2">Info</span>
      </:step>

      <:step name={:work_experience}>
        <span class="me-2">2.</span>
        Work <span class="hidden sm:inline-flex sm:ms-2">Experience</span>
      </:step>

      <:step name={:education}>
        <span class="me-2">3.</span> Education
      </:step>

      <:step name={:other}>
        <span class="me-2">4.</span> Other
      </:step>

      <:step name={:review}>
        <span class="me-2">5.</span> Review
      </:step>
    </.stepper>

The <.stepper> is a phoenix component and the <:step> is a slot. It would be great if this plugin could successfully rename them too.

I've merged in #206, but I'm not sure how viable the alternative heex tags are to add here as we are using binds to set the tags.

It would require some custom logic specifically for heex files.

Does the Treesitter objects cover the entire tag identifier including the . at the beginning? If not does there need to be a treesitter change for that?

@PriceHiller it seems the config adds an alias for elixir = html but I think you still need to add heex as its a separate TreeSitter grammar

I have made a quick PR

I am not sure if this change is all that is required, but I will test it out locally and report back