VSCode Using Julia 1.47.2

When I run Julia from the Mac command line, I use ver 1.9. VSCode’s most recent version (2 weeks old) is 1.47.2 and I can’t run the code I’ve developed in 1.9 (using the command line and MacVim) in VSCode. The most recent believable version number that the VSCode marketplace has 1.7.13.

How can I get VSCode to use 1.9?

What problem are you having? VSCode version (1.47…) and Julia version (1.9) are unrelated.

1 Like

Julia is on version 1.9, VS Code is on version 1.78, and the Julia plug-in for vs code is on version 1.47. The version numbers are independent, and do not have to agree for them to be compatible.

1 Like

Just to clarify, the version numbers are in the drop down where you can pick another version of Julia to install.

I was trying to write a short program that would take the contents of the clipboard using clipboard(), parse it, and write the results to a database. It works in the Julia REPL, but VSCode. When running in VSCode, the clipboard() function isn’t recognized.

This is probably because clipboard() is part of InteractiveUtils and is not loaded within the VSCode environment you are using. Add a line:

using InteractiveUtils
1 Like

InteractiveUtils is loaded automatically when Julia is launched in interactive mode (regardless of the tool that you are using), so my guess is that you might not be using Julia in VSCode’s REPL or a notebook - which are interactive, but perhaps running a script. Is that the case?

That sounds like the reason for my problems. Thanks.

I searched for clipboard and never found this simple explanation.

Good to know that we have been able to help.

The page of the Julia docs where the clipboard function is described is the section of the stdlib InteractiveUtils, which does actually tell at the very beginning:

That being said, it’s true that I myself discovered that when I failed to use some of its functions in a weaved document, and had to search for it. If you have a suggestion about how to document it better, please feel free to propose it.

I’ve been thinking about it. I’ve read a lot of documentation and searched the Internet to get solutions like this one.

What julialang could do is add a discussion of InteractiveUtils to introductions and the REPL. I think people writing guides and tutorials should also mention it.

My use case is probably a little strange. I’ve written a PHP flash card program that I used to improve my vocabulary in foreign languages. Back in my Perl days, I started using the clipboard to scrape various web sites with tables of words in, say French and English. The Perl program would parse the clipboard and write the words to a SQLite database . A PHO+P program then creates a quiz and keeps track of answers. Maybe something like Beautiful Soup would be a better approach, but the clipboard is my legacy approach.