Skip to content

Rework hl interpolator #3655

Closed
Closed
@allanrenucci

Description

@allanrenucci

We are currently having issues with the hl interpolator.

After adding syntax highlighting to Showable, we now sometime leaks colors in error messages (e.g. #3614). The reason is because we sometime try to syntax highlight twice (first by calling show and then splicing the result within the hl interpolator).

I propose we change the API of the hl interpolator as follow:

def hl(args: Showable*)(implicit ctx: Context): String

A user of the interpolator will now need to be explicit when splicing Strings with the hl interpolator. It is a bit cumbersome, but will prevent re-coloring. We can provide helper function (or interpolator) to go from String to Showable.

@felixmulder WDYT?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions