Skip to content

Formatter doesn't handle sigils like ~H in .ex files #36

@superhawk610

Description

@superhawk610

Describe the bug

I have a component file with the following contents

defmodule Component do
  use Phoenix.LiveComponent

  def render(assigns) do
    ~H"""
    <div>
    <span>text</span>

    

        <span>more text
          </span>
    </div>
    """
  end
end

When format-on-save runs, I expect it to be formatted to this:

defmodule Component do
  use Phoenix.LiveComponent

  def render(assigns) do
    ~H"""
    <div>
      <span>text</span>

      <span>more text</span>
    </div>
    """
  end
end

To reproduce

Run Dexter's formatter on an .ex file that contains a sigil that a plugin should format, e.g. Phoenix.LiveView.HTMLFormatter for ~H.

Expected behavior

I expect sigil contents to be formatted using the applicable plugin(s).

Debug logs

Formatter: plugins loaded: Phoenix.LiveView.HTMLFormatter
2026/04/15 13:07:51 Formatting: /component.ex (39.099875ms, persistent)

Environment

  • Dexter version (dexter --version): 0.5.3
  • Elixir version (elixir --version): 1.19.5
  • Editor and version: Windsurf 1.110.1
  • OS: macOS Tahoe 26.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions