vscodeJupyter icon indicating copy to clipboard operation
vscodeJupyter copied to clipboard

Hope this can support Julia

Open carlparte opened this issue 8 years ago • 9 comments

Now I am using Julia and find that Jupyter is really a good tool. So hope you can add Julia kernel so that I can use this in vscode.

carlparte avatar Oct 05 '17 05:10 carlparte

I haven't tested this myself, but it should work (theoretically). I know it work for JavaScript fairly easily.

Please install the julia kernel and use the commands to send the selected text to a kernel. Will look into this from my end too.

DonJayamanne avatar Oct 11 '17 18:10 DonJayamanne

I have tried Julia, most work fine.

A little problem is that Run Cell doesn't show up. Maybe support from https://github.com/JuliaEditorSupport/julia-vscode is needed

findmyway avatar Nov 04 '17 08:11 findmyway

@findmyway That's what I want to say! The Run Cell option is really needed so that I can work within VS Code.

carlparte avatar Nov 04 '17 09:11 carlparte

Do you guys know about https://github.com/JuliaEditorSupport/julia-vscode? It's a pretty mature package that lets you evaluate Julia codeblocks like Jupyter, while also offering a lot of Julia intellisense features.

malmaud avatar Feb 06 '18 19:02 malmaud

It is not clear to me what support we (the julia-vscode devs) would provide for the scenario here, I think the two projects just work independently?

davidanthoff avatar Feb 07 '18 03:02 davidanthoff

@malmaud Yes, I use julia-vscode for my daily work. It's pretty awesome!

However, julia-vscode doesn't support remote REPL(like REPL in Clojure). With vscodeJupyter, I can start Jupyter notebook on a remote server and then execute commands on a local machine.

@davidanthoff Currently, the vscodeJupyter works fine to send commands and receive result. The only inconvenience we discussed here is that, Jupyter provides the concept of Cell(a code block), so that we can execute them once at all. I think this feature is also needed in julia-vscode, I usually have to select multiple lines(a code block logically) and then send them to REPL back and forth.

The Run Cell button is shown as follows:

If a comment line start with #%%, then the following code block will be considered as a Cell. Click Run Cell will send the following code to notebook server

image

Since I'm new to Julia, I'm not very sure if this feature is useful to others. Personally I would like to have this feature, so I can bind the Run Cell command to a short-cut. It would be really convenient.

Thanks again for your guys' efforts!

findmyway avatar Feb 07 '18 04:02 findmyway

Ah, I see, that is cool! Could you open an issue over on the julia extension repo with this idea?

davidanthoff avatar Feb 07 '18 04:02 davidanthoff

Hi everyone, you should be able to define the cell identifier as follows:

  • Go into your user settings file (Preferences -> Settings)
  • Add the setting for "Jupyter.languages"
  • As the following Jon
"Jupyter.languages": [
            {
              "languageId": "python",
              "startupCode": [
                "%matplotlib inline"
              ],
              "cellIdentificationPattern": "^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])(.*)"
            },
            {
              "languageId": "javascript",
              "cellIdentificationPattern": "^(\\/\\/ %%|\\/\\/%%|\\/\\/ \\<codecell\\>|\\/\\/ In\\[\\d*?\\]|\\/\\/ In\\[ \\])(.*)"
            }
          ]

Add another item into the above array for Julia with regular expression appropriately set to identify cells.

Of course other extensions can contribute to thid extension by using the API exposed by the Jupyter extension to provide the code lenses as well.

DonJayamanne avatar Feb 07 '18 05:02 DonJayamanne

No, I cannot successfully add the cell identifier (copied from python) for julia. Even for javascript

// %%
var a=1

doesn't show the "run cell" button.

Is there anything I'm missing? vscode: 1.28.2 extension jupyter: 1.1.4

clouds56 avatar Oct 18 '18 05:10 clouds56