What happened to parsing Unicode characters?

I don’t know what happened between the last time I opened this particular code project (I tabled it for a time to work on something else): but now the Unicode characters look funny. Since I haven’t updated my Julia version in a long while, my best guess is that it is a VS Code extension or some other Julia package that has monkeyed with something in the backend. Unfortunately, I cannot find a specific commit or issue that references updating the parsing of Unicode characters whether in this repository or others. But it used to be that the Unicode for \dot appeared directly above the character preceding it: e. g. \epsilon\dot would put the dot over epsilon rather than after. And the same goes for the underbars appearing underneath the character before. And the \scrf Unicode looks very different.

I do have an older commit in the JuliaSyntax.jl repo for another parsing issue, but I’m not sure if this is related.

EDIT: I already tried rolling the VS Code extension all the way back to v1.127.1, but this did not change the formatting of the Unicode characters, as seen in the screenshot.

Sounds like a font issue! Make sure you have JuliaMono installed and set up

3 Likes

Ah! Thank you! That was the thing that had changed. My machine got LCM’d by IT and I had forgotten to switch the font: I did have JuliaMono set before.

Any idea why I still get this pop-up for the \Vert Unicode character in VS Code?

From poking around the Discourse a little, it seems as though some Unicode characters are supported and some are not: e. g. Rationale behind excluding some unicode characters from identifiers - #11 by t-bltg

But that doesn’t seem to explain the issue I found with \Vert which does TAB-complete: c. f. Unknown Unicode Characters · Issue #546 · JuliaLang/JuliaSyntax.jl · GitHub

1 Like

Just because it tab-completes doesn’t mean that it is a valid character in Julia identifiers.

is a punctuation character (category Po, “punctuation, other”), and typically punctuation characters are not allowed in identifiers. It’s possible that some future version of Julia might allow it for some other syntactic purpose. And of course, you can use it inside strings.

That does make sense that not all possible characters can be used for all purposes. Some are reserved or ambiguous. I was initially confused because it did TAB-complete. Thank y’all for helping and clarifying!