'VSCode Jupyter Extension: Rich syntax highlighting not working?

I've just had to start from a fresh setup thanks to equipment failure, and this means configuring VSCode from scratch again. On my old set-up, Jupyter Notebooks (over SSH) would feature rich syntax highlighting identical to that used in raw .py files (photo 1):

Raw .py syntax highlighting

However, in Jupyter notebooks, Pylance and intellisense work (I can mouseover and complete variables), but the rich syntax highlighting never does (photo 2): ipynb lack of syntax highlighting

This worked perfectly fine on my old system, and I was using the Dark+ theme as I am here. Any ideas as to what could be the cause of this? Many thanks all.

Things I have tried:

  • Uninstalling and reinstalling the Python and Jupyter extensions both locally and remote;
  • Changing theme;
  • Connecting to a different SSH host (the issue persists).

VSCode 1.60.0 (but the issue was also there in 1.59.x)



Solution 1:[1]

It can happen because there is conflict with Dependency Analytics extension with jupyter. Try to disable Dependency Analytics extension

Solution 2:[2]

I had the same problem and I solved it by switching from "Dark" theme to "Dark+".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arif
Solution 2 Christopher Seander