Skip to content

Syntax Highlighting messes up with generic optional parameters #35

Closed
@kfish610

Description

@kfish610

Taking an example from the documentation, this snippet:

let drawCircle: (~color: color, ~radius: int=?, unit) => unit =
  (~color: color, ~radius: option<int>=?, ()) => {
    setColor(color)
    switch radius {
    | None => startAt(1, 1)
    | Some(r_) => startAt(r_, r_)
    }
  }

highlights >= as an operator, rather than as a closing bracket for the generic and an equal sign. This happens in VS Code as well:
image
This is particularly problematic for those who use ligature fonts, as ligatures depend on proper coloring to break up things that look like ligatures but really aren't.
Is the tokenizer/grammar that colors this defined here, or in another repository?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions