nvim-ts-autotag icon indicating copy to clipboard operation
nvim-ts-autotag copied to clipboard

Elixir support still a problem

Open srcrip opened this issue 1 year ago • 6 comments

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

srcrip avatar Jun 29 '24 13:06 srcrip

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.

PriceHiller avatar Jul 14 '24 19:07 PriceHiller

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

srcrip avatar Jul 16 '24 00:07 srcrip

Hey @srcrip can you take a look at the related PR (https://github.com/windwp/nvim-ts-autotag/pull/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 🙂

PriceHiller avatar Jul 16 '24 03:07 PriceHiller

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.

srcrip avatar Jul 22 '24 19:07 srcrip

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.

PriceHiller avatar Jul 23 '24 21:07 PriceHiller

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?

srcrip avatar Sep 11 '24 15:09 srcrip

@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

dan-cooke avatar Oct 26 '24 21:10 dan-cooke

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.

stale[bot] avatar Dec 28 '24 04:12 stale[bot]