-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Highlighting for Julia in VS Code not working at all and broken in VS Code Insider #5237
Comments
Thanks for the issue @no-trick-pony. We haven't specifically supported other kernels in the stable version of notebooks (although its possible to use it). That support is for the new native notebook you're using in insiders. Unfortunately, I couldn't repro your issue with the same version of VS code insiders and the Jupyter extension: As far as I know, that highlighting is expected. I do have a few questions for you:
Please let me know what happens. |
Thanks a lot for your help - I found out what the issue was: For some reason, the syntax highlighting in Insiders defaulted to Python even though the Julia kernel was used and run for the whole notebook. I honestly didn't even know this is configurable. Is there a setting to change this permanently? Thanks a lot for your help! :) Regarding the current VS Code version, I was able to find this: julia-vscode/julia-vscode#1620 (comment) which suggests the issue is known and has to be manually fixed. Since this answers all my questions/is dealing with issues already reported I close this ticket. Thanks again for your help and your efforts! :) |
@rchiodo FYI |
Adendum: I closed and saved the notebook after I set the syntax to Julia for every cell and after reopening it, every cell was set to Python again. This can be reproduced on my machine for this notebook and happens every time and I have to set "Julia" as the language on every single cell on its own.
Opening this file in VS-Code Insiders with the Jupyter extension seems to interpret this. Saving it there does not seem to overwrite it, so regardless of what kernel or per-cell language setting you use, it will still display everything as Python the next time you open the notebook. (Sidenote: Selecting a kernel seems to have vanished into the menu and is not an overlay anymore, or I am just blind). The per-cell language highlighting does not seem to be persisted at all. |
This is actually a known issue. This bug here: #5148 |
I'm going to enter a new issue for this part: A notebook created with current stable VS Code will integrate the following metadata, regardless of what kernel was used:
I want to make sure our insiders version is not doing the same thing. |
I reported this issue first on Julia discourse here: https://discourse.julialang.org/t/running-julia-jupyter-notebooks-inside-vscode/47421/13?u=manuel_bergmann
I am copying this over here:
I am currently on the stable version 1.53.2 of VSCode with Julia 1.5.3 and I have the exact same issues with it as described previously in the thread: Code runs, but no syntax highlighting and also only old UI.
Installed versions:
Again, with the current VS Code Insider version this works. Kinda. The syntax highlighting in many cases seems broken, especially string interpolations.
Note the
2pi
marked red as well as the syntax highlighting for the string interpolation being broken.All those things work in regular .jl files in VS Code however:
Out of interest I tried the string interpolation in nteract as well and here it was completely broken too (but in a different way):
Am I missing something?
The text was updated successfully, but these errors were encountered: