onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.78k stars 274 forks source link

syntax highlighting on ocaml breaks with %s in string #1692

Open tcoopman opened 4 years ago

tcoopman commented 4 years ago
let () = "test %s" x
  foo

everything after the %s is seen is highlighted as a string as you can see here: 2020-04-30-151127_233x62

glennsl commented 4 years ago

Weird. I can't reproduce this with reason-vscode directly in vscode, and updating the ocaml syntax to the latest from the rls repository didn't fix it. So looks like this might be an issue with the syntax highlighter itself.

bryphe commented 4 years ago

Indeed, looks like a bug in reason-textmate - we should add an OCaml test case and see what's going on.

I tried out an alternate syntax here: https://github.com/hackwaly/vscode-ocaml/tree/master/syntaxes (They are tmLanguage/xml which we previously could not load - but @glennsl recently added this in https://github.com/onivim/oni2/pull/1616)

and it seems to work better for me, at least in this case: image

larger files seem to look OK too: image

So perhaps in the short-term - we can port over the ocaml syntaxes from that repo to use, until we get a chance to fix the reason-textmate bug.