elixir-editors / emacs-elixir

Emacs major mode for Elixir
446 stars 94 forks source link

add ~H to recognized sigils #501

Closed mus0u closed 1 year ago

mus0u commented 1 year ago

This is provided by Phoenix.Component rather than by the standard library, but they're used several times in freshly generated Phoenix projects beginning in version 1.7, and without adding this the font locking quickly goes off the rails in files where ~H""" is used. although it would be great to have true HTML font locking for dealing with embedded EEx inside heredocs, this was a one-character fix sufficient for my immediate needs, so i figured i would start with this hoping others would find it useful, and then maybe take a deeper look at font locking improvements that would require heavier changes later on.

victorolinasc commented 1 year ago

This is similar to #474 and is ALSO affected gravely by #473

A common theme is that Elixir is a macroful language and for a regex-driven mode it might be a bit though to add customizable extra macros.

In theory, if we add ~H we are saying we are open for other sigils/macros. The thing is that any library or user code might have sigils/macros and so on. Phoenix is not special in this regard and although I think we should add it for now, we must decide upon some way of customizing it so that it accepts other possible sigils and macros and we don't clutter the mode here.

A PR adding direct support is appreciated (though Elixir is starting to allow multi letter sigils) but we should, nonetheless, think of how to support customizable macros.