[ANN] Julia for VS Code 1.5 released

Can I remove a keybinding in vscode, so that I could replace the execute selection or block command by this command when I press ctrl+enter?

2 Likes

I prefer to only get completions based on the contents of my source files, not the rather arbitrary state of my REPL. Is there a way to disable this feature?

how does one invoke the Table viewer in vscode? I poked around online and in the docs for the julia extension for vscode but didn’t see an example.

1 Like

Yes, sure. Just add

    {
        "key": "Ctrl+Enter",
        "command": "-language-julia.executeCodeBlockOrSelection"
    },
    {
        "key": "Ctrl+Enter",
        "command": "language-julia.executeJuliaCodeInREPL"
    }

to your keybindings.

Doesn’t look like it (although I was fairly sure I added a setting for that). Runtime completions should always look very distinct though and only pop up for getproperty/getindex calls in global scope, in which case you won’t usually get any static completions anyways. Do open an issue though and I’ll add a setting for this :slight_smile:

You can use vscodedisplay(yourtable), @vscodedisplay yourtable, or click the “Open in VS Code” button in the Julia workspace.

5 Likes

Is there anything that FloatingTableView.jl can do to keep pace with the improved data viewer in VS Code? Perhaps instead of a Blink window we can open up some similar electron process that works with the features you have added?

1 Like

It probably wouldn’t be too much work to get TableView to feature parity, I just haven’t had the time for that yet.

3 Likes

Hello, the runtime autocompletions are a very welcome addition! I have a few questions:

In Atom, there were completions even with nested dictionaries or objects. I have checked and this does nto seem to be the case. E.g.:

dict = Dict(:a => "a", :b => Dict(:c => "c")) # no suggestions after dict[:b]

Is this deliberate or a technical/performance constraint?

Should the JuliaFormatter be added to each project manually?

And lastly, how can I get JET.jl to display those inline messages? I have checked the option Julia: Show runtime diagnostics in Settings and ran one example, but doesn’t seem to do the trick. Am I missing something?

Thanks in advance!

No, I don’t think so. Sounds like a bug.

You don’t need to add that package to your environments at all.

No, that should work. Do note that you’ll need to be on Julia 1.7 to get a JET version that can display diagnostics in VS Code though.

My bad, I had some performance issues previously and I had deactivated it on the global VS Code settings. Anecdotically, seems much faster now :slight_smile:

So the GUI setting in VS Code seem not to actually add the option. I added it manually and still does not seem to work.

  "julia.showRuntimeDiagnostics": true,

Would it help if I open proper bug reports?

Julia Version 1.7.0-rc2
Commit f23fc0d27a (2021-10-20 12:45 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 

VS Code 1.62.2, updated 3 days ago.

Make sure you installed JET version 0.5 or higher. In a case the problem persists even after you confirm that, please raise an issue at julia-vscode repository with the description of your environment.

2 Likes

I have and will do at some point today, thank you.

Many of the issues mentioned here should be fixed with v1.5.5:

  • Runtime completions can now be properly disabled (#2551)
  • Code execution keybindings are now consistent for Weave files (#2551)
  • Introduced a helpful warning when @profview failed to collect any traces (#2551)
  • The REPL is now terminated when VS Code is closed, which should work around issues introduced by the terminal.integrated.enablePersistentSessions setting (#2551)
  • Fixed various issues with the integrated table viewer (#2551)
  • It’s now once again possible to use the Run/Debug in New Process commands concurrently (#2551)
15 Likes

Brilliant thanks - can confirm that the table viewer now works as expected on the example I posted above!

2 Likes

Hi, thanks for the hard work.

I am a bit confused. Up to now, I used ctrl+enter to execute “active” line, and it worked even in the for loop body. Now, I can use shift + enter or ctrl + enter, but both commands execute a whole for loop. The same for function.

Is there a way how to get the previous behaviour?

So this means it makes no sense to install the Julia Formatter Extension?
(https://marketplace.visualstudio.com/items?itemName=singularitti.vscode-julia-formatter)

Probably. That extension allows you to customize formatting via settings though, which is not something the Julia extension does (or will do).

1 Like

Another question (or maybe a feature request). It would be nice to get some highlighting on Julia code blocks inside markdown documents. In particular I am referring to Documenter.jl pages. So if I write a @example block, it just looks like this:

image

No highlight, neither on the .md source, nor on the preview pane.

If there is no Github issue about this I could open one. Just not sure if I should open on the VS code extension repo, or on Documenter.jl, or somewhere else.

3 Likes

https://github.com/julia-vscode/julia-vscode/issues/1426

3 Likes

Ok, nice. Looking forward to that one.
Great work.

1 Like

Can you edit with a link? That would be helpful.