interactive icon indicating copy to clipboard operation
interactive copied to clipboard

No syntax highlighting for fresh install in Jupyter Notebook

Open awa5114 opened this issue 2 years ago • 11 comments

Describe the bug

I installed the .NET interactive kernel as described by this page.. The installation was successful and I can run .NET code no problem, but it looks like the syntax highlighting is missing:

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ): image

  • OS
    • [ ] Windows 11
    • [x] Windows 10
    • [ ] macOS
    • [ ] Linux (Please specify distro)
    • [ ] iOS
    • [ ] Android
  • Browser
    • [x] Chrome
    • [ ] Edge
    • [ ] Firefox
    • [ ] Safari
  • Frontend
    • [x] Jupyter Notebook
    • [ ] Jupyter Lab
    • [ ] nteract
    • [ ] Visual Studio Code
    • [ ] Visual Studio Code Insiders
    • [ ] Visual Studio
    • [ ] Other (please specify)

Screenshots

image

awa5114 avatar Mar 13 '23 15:03 awa5114

Syntax highlighting in Jupyter is not provided or affected by the .NET Interactive kernel, so I'm marking this as external. This must be related to the Jupyter install itself.

jonsequitur avatar Mar 13 '23 16:03 jonsequitur

@jonsequitur But it should work right? Provided I fix the Jupyter installation?

awa5114 avatar Mar 13 '23 16:03 awa5114

Yes, there's usually basic syntax highlighting for C# in Jupyter Notebook and Jupyter Lab.

jonsequitur avatar Mar 13 '23 16:03 jonsequitur

Could it be an issue that I'm working with dotnet --version 7.0.102?

awa5114 avatar Mar 13 '23 16:03 awa5114

No, Jupyter doesn't use .NET.

jonsequitur avatar Mar 13 '23 20:03 jonsequitur

Ok. I just posted in https://discourse.jupyter.org/t/net-interactive-syntax-highlighting-issues/18431. Maybe someone will be able to help there.

awa5114 avatar Mar 14 '23 05:03 awa5114

Are you seeing this with brand new notebooks created in Jupyter?

jonsequitur avatar Mar 14 '23 15:03 jonsequitur

Yes, brand new notebooks in a fresh conda environment, with a fresh install of .NET interactive. But the behavior is a bit more subtle than I had initially thought. I might get syntax highlighting on some cells, but not on others. If I refresh my browser using Ctrl + R the highlighting reappears on those other cells.

I can't yet pinpoint/predict all the situations in which the highlighting disappears. But I have noticed that it disappears quite reliably from the topmost cell when I split cells using Ctrl+Shift+-. There may be other situations as well.

As far as I can tell the highlighting for Python kernels is just fine and does not exhibit this behavior. Only the .NET kernels are problematic. So I don't think that this is a Jupyter issue. Perhaps someone could try reproducing this?

awa5114 avatar Mar 15 '23 08:03 awa5114

@jonsequitur Any updates on this? It really makes the jupyter .NET scripting experience less than ideal:

image

Only after I refresh the browser does some syntax highlighting appear:

image

And even then objects from the System namespace still have no highlighting

awa5114 avatar Sep 14 '23 14:09 awa5114

Now is 2024-03-06, I have exactly the same problem as described above. Still not solved.

ibobak avatar Mar 06 '24 20:03 ibobak

Interestingly, I can have R syntax highlighted correctly but couldn't do that for Python (pylance).

XiaomoWu avatar Mar 07 '24 10:03 XiaomoWu