JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.78k stars 409 forks source link

Inconsistent syntax highlighting of `in` followed by `(` #1057

Open GrigorySarnitsky opened 1 year ago

GrigorySarnitsky commented 1 year ago

The keyword in is not always highlighted. For example it is highlighted in

for i in 1:10

but not in

for i in (1):10

Meanwhile is highlighted in both cases.

I am using JupyterLab with Julia version:

Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 12 virtual cores
twavv commented 1 year ago

This is probably an issue with CodeMirror which is what JupyterLab uses to do syntax highlighting. https://github.com/codemirror/codemirror5

IJulia itself has no control over syntax highlighting in the web frontend.

GrigorySarnitsky commented 1 year ago

It seems that "in" is not a keyword in mode/julia/julia.js and "in" is not highlighted in CodeMirror Julia demo https://codemirror.net/5/mode/julia/.

I will be looking further for the source of this behavior.