Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Highlighting messes up with generic optional parameters #35

Closed
kfish610 opened this issue Dec 1, 2020 · 2 comments · Fixed by #367
Closed

Syntax Highlighting messes up with generic optional parameters #35

kfish610 opened this issue Dec 1, 2020 · 2 comments · Fixed by #367
Labels
enhancement New feature or request

Comments

@kfish610
Copy link

kfish610 commented Dec 1, 2020

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?

@chenglou
Copy link
Member

chenglou commented Dec 5, 2020

Thanks. This is half our bug and half VSCode's bug I believe. I've just fixed our side of the problem (and confirmed it through Sublime Text properly un-ligaturizing the >= part).
The other part is submitted to VSCode as microsoft/vscode#111945

@jmagaram
Copy link

I'm running into this problem too. Optional parameters look like either >= or another weird symbol - see image.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants