How to get Julia executable path in vscode on Mac - visual-studio-code

The message:
Could not start the julia language server. Make sure the configuration setting julia.executablePath points to the julia binary.
Pops up when trying to install run Julia in vscode on my Mac. I tried
Macintosh HD/Applications/Julia-1.7.app
But this didn't work and gives the same error

So after messing around some more it seems that you have to go all the way to the inner executable to get it to work.
I wanted to post the answer in case anyone else has this problem in the future.
Solution:
Right click on the julia application in finder and click 'Show package contents' from there this is the overall path i used as the vscode julia path:
/Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia

Related

Why do no programs run in visual studio code?

I recently got a new computer and reinstalled visual studio code but I haven't been able to run any of my files. The error has occurred with both python and C++, so I feel as though it is the IDE that is the problem. I have looked online and there are no straight answers as I have tried following some solutions which have resulted in different errors.
The error above comes up when I run (F5) a simple line of code in c++. Does anyone have a solution?
Thanks, Jacob
[EDIT]
For my python files to work I have to manually select 'Python: current file' but for c++ files they still have the same error.
First step, uninstall python from this machine.
Second, reinstall and make sure that you check the box "add to path".
It's pretty easy to miss as it's a small box, and I missed it my first time installing python earlier in the year. Here's the box you may have missed while installing.
It could be your extensions.
I had a similar error message and simply updated all of my extensions and then my SDK. I was then able to run my code within the IDE. I was using VSCode for c++ and also updated my GCC compiler along with the extensions.
Also look into your computer's environment variables, if you have changed the %PATH variables it may be affecting your ability to run/compile programs.

VS code, julia linter doesn't work (on mac)

having assured myself that julia is enabled and that the linter is too (in vs code settings: Julia › Lint: Run), i get syntax highlighting on my xxx.jl script but no linting at all.
im on the latest vs code + latest julia 1.07 extension + latest macosx.
i did a clean installation of vs code, wiping all old related folders prior to installation (https://stackoverflow.com/a/53839847/11608725)
so julia is the only extension/package installed, no conflicts should be present.
what am i missing?
thanks!
edit/update:
i also found that i can NOT run an open script (via the leftmost button)
a pop-up says
and clicking on open launch.json gives
from which point on im pretty much stuck. googling around, a couple of very similar issues appeared (eg. https://stackoverflow.com/a/61284896/11608725, https://github.com/microsoft/vscode/issues/94725#issuecomment-612062020), but which should presumably have been fixed with vs code 1.44 and i am on 1.49.
perhaps the no-linting is related to this?
Have you tried Julia Formatter 0.3.0 for vs code? This has always worked for me.
similar message "Please first open a folder in order to .." pretty annoyingly appeared, my end, on a different platform [Win] [Visual Studio Code version: 1.56.2], too
meaning : it's likely the workflow/settings logic specific to VS Code, not an os/platform issue as such
all problems solved, my end, simply by
after launching VS Code
via "File" > "Open Folder..." : just do first -- before doing anything else in VS Code and/or with code-files -- open the current/working project folder [ie. the very folder with a ".code-workspace"-file in it for the given project (source file dir) ]

Pylance does not allow me to navigate to the source code, bringing me to the .pyi stub instead

I am using pylance for vs code and it works really nice, except that since I use it, when I try to check code from an installed library, I can get only to the stub, I think generated by pylance.
For example, the information shown about the function:
Or, crtl + click on the function brings me to the .pyi stub, which at
~/.vscode-server/extensions/ms-python.vscode-pylance-2020.11.0/dist/bundled/stubs/pandas/io/parsers.pyi
I can't find a way to navigate to the actual code (of pandas in this case).
If I deactivate Pylance and use Microsoft as language server by setting "python.languageServer": "Microsoft", in setting.json, the navigation to the library works fine.
Is it possible to navigate to the actual code with pylance active?
OS: Ubuntu 18.04
Visual Studio Code: Version: 1.50.1
Pylance: v2020.11.0
I had the same issue and realized I was using Docker. So I set up virtualenv and installed Django using pip.
Then I switched Python interpreter in the bottom-left corner of VS Code and it started working.
I know this is a specific case but I hope this answer helps someone in the same problem.
Let's remove ~/.vscode-server/extensions/ms-python.vscode-pylance-2020.11.0/dist/bundled/stubs/pandas
Then reload vscode
You can navigate to the references by right-clicking on the symbol and selecting "Go to References".
Also, ensure that you have a Python interpreter configured for the script where pandas is installed.
You can select an interpreter by opening Command Palette from the View menu and typing in "Python: Select Interpreter" and following through the dialog.
When you have that set, you should see two references when you Ctrl + click on a symbol: one for the stub and the other from the library.

VSCode on Linux Mint, integrated terminal not able to type anything

Hi I'm running Linux Mint 19 and I have just installed vscode using the snapd package manager. I've not used vscode on linux before as my usual editor is emacs. However, on a fresh new install of vscode, the integrated terminal does not work, there is just a non blinking cursor in the top left of the screen, but no prompt and no keyboard strokes are registering. This appears to be a common problem as there are a lot of posts about it if googled, but they are all for Windows versions and none of the solutions that I'm able to try do anything. I've tried to open a new terminal window, but the same thing happens I just get two terminal windows that I now cannot use. I've also tried checking the box that says Code-runner: Run In Terminal, but that does nothing either. What can I do to get this to work please, I looks to me like it is just not connected to either a bash or Zsh(which I normally use). Any help on this would be appreciated.
Instead of starting vscode with its default shell script (usually located on /usr/share/code/bin/code), the integrated terminal only works for me when starting it directly from the compiled binary (typically found on /usr/share/code/code, which is the same as the launcher created by the installer:
/usr/share/code/code --no-sandbox --unity-launch %F
While I searched for a solution in the past I've also noticed that lots of folks solved similar problems just by adding --disable-gpu flag, so might be worth checking out as well.

Can somebody help me make Visual Studio Code with Julia ?

I am studying economics so I have not much experience in programming. I really would like to make Julia work on Visual Studio Code but I've been unsuccessful.
So I downloaded the Julia extension but I don't know how to define the settings. Do I need to create a launch.json file or any other file to make it work?
I think that somebody asked a similar question previously at "How to setup Julia in VS code?"
but the answer didn't really help me.
Thank you all for your help.
First you need to install Julia on your Mac by downloading the julia dmg file from here. This puts an application in the Applications folder.
There are several ways to set things up so julia will run from command line. I used the following:
ln -fs "/Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia" /usr/local/bin/julia
This should work if the name of your application, that you just installed, is julia-0.6.app
After running the above command, you should be able to type Julia on the command line and have it to start.
You can now create a Julia script and place it in the directory you're running from. I created a file named julia_test001.jl It contained the following:
for i in 1:5
print(i, ", ")
end
This is a very short Julia script I wrote for testing.
Now start VScode and install the Julia language support extension. After that has loaded, open the file Julia_test001.jl. Once this file is opened, click the triangle in the upper right corner or open the command palette and select the option: run code. The julia_test001.jl should run and print the result 1,2,3,4,5.