Julia VS Code extension version v0.16 released

Julia VS Code extension v0.16 release

Welcome to the v0.16 release of the Julia VS Code extension.

Inline evaluation

Code evaluation has been overhauled for this release.

The Julia: Execute * (e.g. Julia: Execute Code And Move, by default accessible with Alt-Enter) commands now asynchronously evaluate the selection, current code block, or file. These commands also evaluate the code in the context of their containing module, which is indicated in the status bar:

module_eval

You can change the module for a file by clicking on the module indicator or by calling the Julia: Select Current Module command (e.g. with the Ctrl-J Ctrl-M keybinding).

Evaluating code directly into a module is especially helpful for a Revise-less workflow – it allows you to easily update methods or globals.

Another new feature in this release are inline results for code evaluated from the editor. To enable them, select the inline result type in the extension’s Julia > Execution: Result Type setting.

Inline results display the first line of the result’s plain-text representation (via Base.show). Details are available by hovering over the result, like in the screenshot below (make sure you have the Editor > Hover: Enabled setting ticked):

The inline result on the current line can be cleared with Julia: Clear Current Inline Result (Ctrl-I Ctrl-D); all inline results in the active text editor are cleared with Julia: Clear All Inline Results (Ctrl-I Ctrl-C).

We’re still working on inline evaluation, inline results, and related features, so expect more changes in the following releases.

The Julia: Send Current Line or Selection to REPL command simply copies the current line or selection and pastes it into the REPL, so it does not take the code’s module into account.

Workspace view

It’s now possible to inspect the current REPL’s runtime state in the Workspace pane, which you can open with the View: Show Julia Explorer command or by clicking on the Julia symbol in the activity bar.

You can drill down into modules and find out what they define, inspect complex structs or dictionaries, and even inspect arbitrarily large arrays:

All of this lazy-loaded, so don’t worry about recursive types or big arrays – we’re taking great care not to influence the editor’s performance or mess with Julia’s GC.

Supported types like arrays (or other table-like objects) and plots can be shown in the integrated table viewer or plot pane with the click of a button.

Faster REPL startup

All code the extension loads into the REPL process is now in a (precompiled) module, which should speed up startup.

Bugfixes

We’ve also fixed a plethora of issues in the Language Server and the interactive code.

113 Likes

Thank you for your great work. It is nice to see that you joined forces and how things are progressing :slight_smile:

6 Likes

This looks great!

This is so great! It makes me happy every time I see a new version for the extension in my mailbox :smile: .

2 Likes

Incredible how fast you went from that one thread of all of us asking for inline evaluation to this, while working around the limitations of VSCode in this regard that were mentioned. Well done and thank you!

24 Likes

Wow! This version is an absolute pleasure to work in. Thanks to everyone involved in delivering this. I love the little touches, like the quick highlight of the executed code block. It just looks great.

2 Likes

I don’t think there’s a way around this, unfortunately.

Interesting. Are you timing this from starting VSCode? It takes a couple of seconds to start the Language Server and the REPL, but after that everything should be fast.

Yes, that’s by design. The VSCode extension’s workspace only knows about a few “primitives” (arrays, dictionaries, numbers, strings etc) and shows the object’s fields otherwise.

Yeah, that’s unfortunate: getCurrentBlockRange issues · Issue #771 · julia-vscode/LanguageServer.jl · GitHub

True, that really is annoying. Will fix.

3 Likes

What text color theme do you recommend to use with Julia in VS Code?

The default themes (Light+ and Dark+) are very good, imho; a popular alternative is One Dark (if you miss some Atom flavour).
I personally quite like srcery, too.

1 Like

Looks like VSCode plugin now covers the most of functionality, except profiler, docs panel and some parts of debugger?

For me, it seems like we had daily threads about just indexing the packages to table viewer, debugger, inline results, and so much more.

This is great. I can not begin to express my appreciation for the hard work the maintainers have put in this. So thanks Zac and David and other contributors.

Now to test this out on WSL 2 and see what breaks :wink:

2 Likes

Awesome work! Thanks for all the time you’ve put into this.

One small issue I’ve found is when you open the table view of an array with a lot of columns, it squishes the column size down to where there are no numbers, just ellipses. Also, it would be nice if the table views were previews so they don’t always open a new tab when you click one after another (similar to when you click once on a file and then click once on another file, it doesn’t keep the tab for the first one.)

1 Like

@sairus7 You could try the Julia Color Themes extension, which has themes that are customized to work well with Julia code:

Disclaimer: I created those themes.

6 Likes

Thank you for the nice work.

I probably should start a new thread. Starting from 0.15.40 (maybe even earlier, I didn’t notice), my julia-vscode extension cannot index packages. Typically, when it index to FFTW, it exits. But if I remove FFTW, it exits at my private package.

How can I figure out what is happening here?

I know you have put in a lot of work into this and I thank you for making it available. However I have to say that I find the Julia extension for VS Code too intrusive. The only thing I want from my IDE is syntax highlighting, I want to be able to easily switch everything else off.

  • I want the option to not have data usage collection.
  • I don’t want instances of Julia running in the back ground - I want to be able to turn them off.

I used to use Sublime and I moved to VS Code because all I used Sublime for was syntax highlighting and VS Code does the same and some simple features and some languages I was interested in at the time were in VS code and not Sublime. More features are great, but some of us just want a pretty text editor.

Thank you.

Since updating to this version I am experiencing crashes of the language server.

crash

Does anyone know a fix?

Did you send crash reports? Those help immensly when tracking down bugs.

3 Likes

Happy to try it out soon :slight_smile:

Yes I did

1 Like

My language server has crashed a few times… sent the crash report.