I want to use symbol \phi in my code (\phi in LaTeX). However, if I type \phi and hit Tab in VSCode (both Jupyter Notebook and *.jl file), the result on the screen is symbol \varphi (\varphi).
Similarly, if I type \varphi, I get symbol \phi (\phi in LaTeX).
Next, if I copy the symbol \phi, which incorrectly appears as \varphi, into the “find” box of VSCode, the symbol suddenly changes and appears (correctly) as \phi.
There is clearly a bug here. I don’t know whether the bug lies in VSCode itself (i.e., is a Microsoft responsibility), or whether it lies in the Julia modification.
If you get these codepoints with the wrong symbols, then it is probably a font issue. Try switching to e.g. JuliaMono.
Apparently there is some confusion here because the standard glyphs for these two Unicode codepoints were swapped in Unicode 3.0 (in 1999) and some online sources still display them incorrectly, but the standard now clearly states that U+03C6 should now be the “loopy” form if the font is intended to support technical usage:
Fonts used primarily for Greek text may use either glyph form for U+03C6, but fonts that also intend to support technical use of the Greek letters should use the loopy form to ensure appropriate contrast with the straight form used for U+03D5.
(It’s possible that Consolas doesn’t even have these codepoints, and what you are seeing is a fallback to another font? I’m not sure if there is an easy way to check this? Update: According to this web page, Consolas indeed has the characters and they are swapped.)
More bugs??? [Your solution with JuliaMono works… but…]
VSCode suggested I should sync the settings, so I logged in to GitHub. I was then told there were some conflicts. When I merged the conflicting settings, the following happened:
Color Theme changed to black (I dislike black background)
The font changed back from JuliaMono to Consolas
Possibly other things, but I didn’t notice other changes
Why does this happen, and how can I avoid it? (I try to keep 3 PCs synced…)
Sounds like you just messed up the merge; you probably should have selected the “merge manually” option. Probably if you change the settings on one machine and merge again it should work now.
In any case, this is straying pretty far off-topic for a Julia forum; if you continue to have problems you should go to a vscode forum.