How do i get code completion for C# scripts in VSCode for Unity on Linux/Ubuntu?

Viewed 352

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?

2 Answers

Have you tried this guide

  1. Install Unity Editor
  2. 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.

  1. Install dotnet
  2. Install mono-complete

Most people forget step 3

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.

enter image description here

Related