I’ve trying to use VSCode as editor on my Unity (Ubuntu 18.04 LTS), but when I try to open files directly from Unity, the VSCode can’t find references (so my own classes and UnityEngine’s built-in variables and functions - such as gameObject, GetComponent etc. - are not available).
First, I thought it was a bug on integration betwen Unity for Linux and VSCode for Linux, but if I try to open (manually) my project’s folder into VSCode (root of project folder, not “Assets” or any sub-folders), all references are working normally!
So, I think Unity is not calling VSCode to open the full project path (like in Windows - I not test this on Mac because I don’t have a Mac), and, if I rename (or copy) the VSCode binary with another name (“/usr/bin/vscode” for example) and set Unity to use this “new” binary with “$(ProjectPath)” argument and try to open a script directly from Unity, all references works fine, but the specified file not opens automatically on VSCode (and all .meta files are visible if I not opened VSCode normally - the original “/usr/bin/code” binary - from Unity, for creating custom .vscode/settings.json file).
Is someone having this problem too? Can anyone help me with this ?
Partially fixed. I’m using the “trick” (renaming the VSCode binary file to make custom arguments/parameters field available) and set the argument like this:
"$(ProjectPath)" "$(File)"
And all works fine. But, the only final problem is Unity not creating the custom “.vscode/settings.json” file, to suppress all .meta files and other unecessary files from VSCode’s workspace.
I am experience the same problem. It used to work and after some time it is not working anymore.
I just updated to latest Linux version: Unity-2017.4.0f1 and it didn’t solve.
I cannot change my “External Script Editor Args” as RBFraphael because on my machine it display VScode as “code” and does not allow me to change any parameters…
Now I use a new method (more simple, I think) to let Unity use Visual Studio Code correctly on Linux
Here is my step-by-step:
Create a symlink for /usr/bin/code with another name
1.1. Open terminal and type sudo ln -s /usr/bin/code /usr/bin/vscode
Set up Unity to use the Visual Studio Code with created symlink and correct args
2.1. Go to Edit > Preferences and select External Tools tab
2.2. Select the /usr/bin/vscode binary file on External Script Editor field
2.3. Type "$(ProjectPath)" -g "$(File)":$(Line) on External Script Editor Args field
Hide Unity’s .meta files in Visual Studio Code
3.1. Open Visual Studio Code (with a new script, or shortcut, or whatever you want… just open it)
3.2. Go to File > Preferences > Settings
3.3. In the right panel, add the following code between the two keys ( { } )
Unfortunately it doesn’t seem to be working for me. I’ve followed steps 1 and 2, but I still can’t get autocompletion to work with the projects.
Now I’ve realized that I don’t get that thing with the flame in the bottom bar, which seems to be relevant since it’s related to the C# plugin. Maybe it’s not recognizing the folder as a C# project for some reason? I can’t find any file called “New Unity Project.sln”.
Yea I had the same issue. The omnisharp server wasn’t connecting for some reason. I couldn’t figure it out sorry But I think its due to the C# extension more than anything. I just ended using monodevelop
I have similar problem, but nothing works for me. My Unity Hub doesn’t look like it try to run any program at all, because my script does not log anything and it is set to log.
Also, if you’re not using Ubuntu 18.04 I know it doesn’t work 100%. I use Pop_os 18.04 and only issues are Unity doesn’t run as near as well as compared to Windows
I was using ubuntu 16.04 or 18.04 I’m not sure; but I had .net and mono installed. For now I just installed Windows on some spare HDD to use Unity. If I find solution it will be on linked forum thread.