Subject: Re: bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python

From: Wilhelm Kirschbaum <[email-masked]>
Date: Tue, 04 Apr 2023 21:46:47 +0200

>> On Tue, Apr 4, 2023 at 7:12 PM Wilhelm Kirschbaum
>> <[email-masked]> wrote:
>>
>>> The custom psif is not for the newline, but for pairing up the
>>> triple
>>> quotes `"""` with another set of tripe quotes when
>>> electric-pair-mode is
>>> enabled.  The newline is for keeping the syntax valid in 
>>> elixir,
>>> otherwise the font and navigation breaks because `""""""` is 
>>> not
>>> valid
>>> Elixir syntax and the tree-sitter grammar really does not like 
>>> it.
>>
>> I see.  My apologies for not having noticed this in the 
>> preceding
>> emails.  If you want some kind of electricity so that typing 
>> the
>> third `"` results in two `"` and a newline getting added, then
>> that is completely new and probably does require a custom psif.
>>

Just to clarify on the desired behaviour:

With `|` is (point):

When typing the first quote `"|` it pairs to be `"|"` as single 
quote
strings are valid in Elixir.  Then when typing the second `"` it 
skips
the second quote `""|`, now when typing the third quote `""|"` it 
pairs
the heredoc: `"""|"""` and with electric-layout it will now insert 
the
newlines: `"""\n|\n"""`.

This means, as the original report, the user can type

`@doc """|` and will correctly jump into the heredoc and 
tree-sitter
grammar will stay valid.

@doc """
|
"""

There is no scenario in Elixir I can thin of where this is not the
desired behaviour.