'How do i get code completion for C# scripts in VSCode for Unity on Linux/Ubuntu?
I recently came back to unity, as i found out that it does now support installation linux. It works, but when editing the scripts with vscode i do not get code completion.
I have installed the C# extension, the Debugger for unity extension and the Unity Code Snippets extension.
I know that there is the Visual Studio IntelliCode extension, but this does only support Java, Python js and ts. I also know that there are IDEs that i can use, like Rider, but i would like to setup this in a lightweight environment without an IDE.
So, how do i setup code completion in vscode for unity-scripts on linux?
Solution 1:[1]
Have you tried this guide
- Install Unity Editor
- Install Visual Studio Code 3.Tell Unity to use VSCode
n project preferences -> external tools you can tell Unity what program to use for editing c# scripts. If you have the Visual Studio Editor packages in your project, you should see a special “Visual Studio Code” option in your preferences. The packages are part of the standard Unity download now.
- Install dotnet
- Install mono-complete
Most people forget step 3
Solution 2:[2]
I tried everything in the installation guide, but code completion would still not work.
Somewhere I read that setting Use Global Mono to always
in the C# extension for VS Code might fix the problem. So I did that, restarted Unity, Unity Hub and VS Code, and then it started working correctly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Athanasios Kataras |
Solution 2 | Mig82 |