interactive: Missing syntax highlighting in Polyglot Notebook extension when launched from dev container

Describe the bug

Please provide as much information as you can.

Please complete the following:

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

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

Polyglot Notebooks Version: v1.0.4102020

Version: 1.75.0 (user setup)
Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164
Date: 2023-02-01T15:23:45.584Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No

Screenshots

image

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 19
  • Comments: 34 (9 by maintainers)

Most upvoted comments

I have the same problem with polyglot notebooks running locally. I can get syntax highlighting to work by clicking the “Select Cell language mode” button which defaults to “Code”. I can then click auto detect, and syntax highlighting works again, however the cell will no longer run.

What do you mean by autodetect?

@colombod In vscode, when you click Select Cell Language mode on a code cell, it brings up the command pallet, where if you click Auto Detect, it changes to whatever language you are using. image

image

image

Same here on WSL. In recent versions(since the very beginning of Jan 23, when I had this issue), syntax highlighting seem to be fine before .NET Interactive extension activation (tested by creating a new polyglot notebook with .ipynb, put some code in and reload window to see the colors disappear after this extension loaded). If I downgrade the extension to 1.0.3553070(labeled as 3 months ago), basic language features like syntax highlighting works but suggestions still doesn’t have any styling. About the extensions that I currently enabled, almost all of them are remote development support published by Microsoft.

image

@shiftybit it fixes the color only, and I if I open and close it, it dissapers. When I try to execute with anything but code there it doesn’t execute it.

Same here. But onlye when working on a dev container. When working local on Windows 10, it works fine.

image

Windows 10, vs code here as well with “about” information:

.NET Interactive
© 2020 Microsoft Corporation
Version: 1.0.440301+8915ad98609cad23d5d81765041c2a895afb4782
Library version: 1.0.0-beta.23403.1+8915ad98609cad23d5d81765041c2a895afb4782
Build date: 2023-08-30T11:26:39.5926919Z
https://github.com/dotnet/interactive

In my case it looks like the vs code theme is the culprit for the missing colors. If i change to one of the built in ones then the colors are displayed, but if i choose a custom theme like Atom one Dark Theme, then all the colors disappear.

Theme: Dark (visual studio) image

Theme: Atom One Dark image

It was removed from the milestone because the fix is fairly complex and didn’t fit with our current focus, which is on improving the Jupyter subkernel (and general connected kernels) experience. It’s not attached to a future milestone but that’s only because we don’t typically plan to that level of detail for future milestones. That should not imply that we don’t plan to fix it.

Just wanted to mention here, I noticed that I had "editor.semanticHighlighting.enabled": false, in my settings file, and when I enabled it my syntax highlighting started working (not in a dev container, I mean everywhere in polyglot c#)