If you have installed Visual studio community along with Unity editor using Unity Hub then you can see that your Visual studio editor has autocomplete/IntelliSence enabled by default. That is, you will be able to see all Unity functions as you type. But if you have installed Visual studio code then you will not see the autocomplete in the editor.
VScode is both language and framework independent. You will need to install the required dependencies to solve this problem.
Step by step procedure to enable IntelliSence in VScode
- Close both Unity and VScode.
- Download and install .NET framework 4.7.1 Developer Pack.
- Open Unity.
- Go to Edit>Preferences>External tools.
- Select Visual studio code as your external script editor.
- In the external script editor Args box enter “$(ProjectPath)” -g “$(File)”:$(Line):$(Column)
- Click on regenerate project files.
- Open Visual studio code.
- Install C# for Visual Studio Code (powered by OmniSharp) extension.
- Close VScode.
- Open VScode from Unity. Now IntelliSence should work and syntax should autocomplete.