Jupyter notebook support is coming along well since they fixed https://github.com/microsoft/vscode-python/issues/12760#issuecomment-654995857. I haven't had other bugs since.
But syntax highlighting is not functional. According to microsoft, this is a vscode setup issue (and not specific to jupyter). See https://github.com/microsoft/vscode-python/issues/5078#issuecomment-668126575 for example.
For example, in C:\Users\MYUSERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions I see a list of a whole bunch of languages, but not julia. Should the configuration files there (or perhaps copying them over?)
If you do the following:
C:\Users\MYUSERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\julia folderC:\Users\MYUSERNAME\.vscode\extensions\julialang.language-julia-1.0.4 the following into that folderThen syntax highlighting in jupyter seems to work great. Can those files be copied over easily in the installation process?
No, we can certainly not copy anything over in our installation (it is purely a xcopy that we don't control). I think we would have to add those files to VS Code itself.
@davidanthoff it would be great if this was added to the vscode repo (https://github.com/microsoft/vscode). The julia folder would go under the /extensions/ directory and would contain several of the files/directories from the julia-vscode extension (based on what I'm seeing on the Python extension in VS Code). This would give support to syntax highlighting on Jupyter in VS Code. Since you are the author of the extension, I thought it would be best if you did this, but if you want me to copy the files over to the vscode repo, I can do that as well.
Ah, so essentially the model would be that we split the grammar part out of this extension here, and then add a Julia extension to the base VS Code product that includes things like the grammar and language def, right?
That does sound like a plan, at least if MS would accept that. I guess we would lose a bit of control about update cycles of the grammar and anything else we put into the VS Code base product, but given that they ship every month I don't think that would be a biggy.
@pfitzseb, @ZacLN and @aviatesk what is your take on this? Should we try this?
I do think that if we do this we (the extension team here) should probably handle this, just so that things are synced up.
From the comment linked above:
Since VS code doesn't ship one, you'd have to add one manually to that location or change our code to look elsewhere for it.
The latter options seems much cleaner to me. They could just iterate over all active extensions and figure out the paths to the language configuration files from there.
Just a gentle reminder that microsoft agreed to add this in on microsoft/vscode#105229 , and was asking for some help. It might make sense to start to process to keep up the momentum. I think it is a big marketing win for julia for vscode to ship with the basic highlighting/etc. out of the box.
I think this is out of my paygrade or I would try to help out more directly.
I'll look into this once I've got the semester start under control.
Sounds good. When the time is right, if I can help with testing/etc., please let me know.
... and good luck with getting things under control.
For posterity this fix also works in Ubuntu 20.04.
Copying the same files from ~/.vscode/extensions/julialang.language-julia-X.X.X/
package.jsonjulia.configuration.jsonsyntaxes/to /usr/share/code/resources/app/extensions/julia/.
gentle nudge here, to see if this feature is coming. With the new Jupyter VS code extension, this will be beautiful!
I think this might already be in the released vscode and this issue able to he closed?
I don't think so :) https://github.com/microsoft/vscode/issues/105229 is still open.
I vividly remember the Julia config files being merged into the released version of vscode! More evidence why human memory should never be trusted, and github a thousand years from will contain all human knowledge at a sequence of commits...sorry to distract!
@pfitzseb Thanks for the update. Are you going to ping microsoft/vscode#105229 to see if it possible to move things?
Any idea what the equivalent folder is on OS X for this temporary fix?
Any idea what the equivalent folder is on OS X for this temporary fix?
Similar to https://github.com/julia-vscode/julia-vscode/issues/1620#issuecomment-714675654, but you just moving stuff to /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/extensions/.
@xukai92 thanks
For posterity this fix also works in Ubuntu 20.04.
Copying the same files from
~/.vscode/extensions/julialang.language-julia-X.X.X/* `package.json` * `julia.configuration.json` * `syntaxes/`to
/usr/share/code/resources/app/extensions/julia/.
Does somebody know the path for Linux Arch?
@Christian-Git01 I guess do the same but copy to /usr/lib/code/extensions/julia/. Try and let us know if it works.
The problem of course is that you would have to do this every time after an update of code.
@Christian-Git01 I guess do the same but copy to
/usr/lib/code/extensions/julia/. Try and let us know if it works.The problem of course is that you would have to do this every time after an update of
code.
Thanks! Unfortunately not, I also had to create the directory julia. Should it be there already?
Thanks! Unfortunately not, I also had to create the directory julia. Should it be there already?
You should create the directory, it will not be there in the first place. When you say "unfortunately not" what do you mean? It is not working?
Anyone know how this trick works for remote Linux? Specifically I don't have root access so it's impossible to edit anything like /usr/lib or /usr/share.
@Christian-Git01 I guess do the same but copy to
/usr/lib/code/extensions/julia/. Try and let us know if it works.The problem of course is that you would have to do this every time after an update of
code.
@coxackie This doesn't work for me unfortunately :(
(I am under Manjaro Gnome and using the open source version of vs code, so I've created as you've said a /usr/lib/code/extensions/julia/ folder and copied the files in there, then restarted vs code but nothing changed)
Thanks! Unfortunately not, I also had to create the directory julia. Should it be there already?
You should create the directory, it will not be there in the first place. When you say "unfortunately not" what do you mean? It is not working?
Unfortunately, it is not working. My setup is similar to @irojkov-ph. Open source version of vs code and Manjaro.
Alas, it seems like the workarounds aren't working. I think this may need to be built into vscode to be usable across platforms. @pfitzseb any ideas on the path forward here? Microsoft said that they would merge julia support directly into vscode, which I think is a big win for the community. Is there anything other people can do to help here?
Most helpful comment
Ah, so essentially the model would be that we split the grammar part out of this extension here, and then add a Julia extension to the base VS Code product that includes things like the grammar and language def, right?
That does sound like a plan, at least if MS would accept that. I guess we would lose a bit of control about update cycles of the grammar and anything else we put into the VS Code base product, but given that they ship every month I don't think that would be a biggy.
@pfitzseb, @ZacLN and @aviatesk what is your take on this? Should we try this?
I do think that if we do this we (the extension team here) should probably handle this, just so that things are synced up.