Why does VS Code auto-complete not work for Unityengine library elements even with the built-in extension?

Asked

Viewed 5,333 times

0

The problem is just this, I’m developing a new game by Unity and use Visual Studio Code as editor, and need to auto-complete to help, but even with the extensions "Debugger for Unity", "Unity Tools" and "Unity Code Snippets" the problem is the same, I’ve tried Ctrl + space and nothing. Here is an example where in line 12 I cannot write the contents of line 11 by auto-complete.

  using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;

  public class PlayerController : MonoBehaviour
  {

  void Start(){

    //  ACESSAR UM COMPONENTE DO OBJ
    GetComponent<CapsuleCollider2D>(); 
    GetCo // ... O ERRO ESTÁ AQUI ;-;
  }

  void Update(){

  }

 }
  • You installed the .Net Core and the C# Extension?

  • Yes, both of them installed.

  • With me also happened this, I tried several things, so I installed the visual studio community 2019, after having done that Vscode started working perfectly.

1 answer

1


Man, I can see exactly what’s going on. I need to make a video explaining this, it’s very important, I had to create a project from scratch here and for one of the projects my extension didn’t work, so I had to find out in depth how it worked. AND I UNDERSTOOD EURECA!

Next, for Intellisense to work it needs a guy named Omnisharp, to activate this guy you need to hit Ctrl+Shift+P and type Omnisharp, like this:

inserir a descrição da imagem aqui

But before you go first, close your project by going to File > Close Folder and then with VS Code without any open projects you will close it. Dai will open again and then yes open your project, and only then do the procedure of Ctrl+Shift+P and type Omnisharp and will choose the option Restart Omnisharp.

POOOXA LIFE, IT HASN’T WORKED YET!

Yes, it happened to me too, there’s the other option, Select Project...

This option is actually for you to choose the solution of the Project as a whole, which brings you to the first problem, if you have not linked the dotnet projects to the solution, Intellisense will not really work well for that project (VISUAL STUDIO .NET DID SO TOO) Dai you need to link the projects as I showed in previous lessons.

I guarantee, if it doesn’t work, burn the PC and buy a MAC. hehehe

Just kidding, it’ll work!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.