Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Autocomplete Too Aggressive With Unity

I use visual studio with Unity. The autocomplete function that visual studio has built in, in conjunction with Tools for Unity, makes the autocomplete, especially with method headers, way too aggressive.

For instance, when I type void OnCollisionEnter( I am given

void OnCollisionEnter(Collision collision) { }() 

This is a problem because I now have to remove the parenthesis and rename the parameter, when before I would not have to do either. It's a small thing, but it is extremely aggravating. Is there any way to fix this?

like image 440
Andrew Claxton Avatar asked Jan 26 '17 05:01

Andrew Claxton


People also ask

How do I get Visual Studio 2022 to work with Unity?

Install Visual Studio and UnitySelect Install, or Modify if Visual Studio is already installed. Select the Workloads tab, then select the Game development with Unity workload. If Unity isn't already installed, select Unity Hub under Optional. Select Modify or Install to complete the installation.

Why is Visual Studio not working with Unity?

Check that Visual Studio is set as your external script editor in Unity using Edit / Preferences / External Tools . Depending on your Unity version: Check that the Visual Studio plugin is installed in Unity. Help / About should display a message like Microsoft Visual Studio Tools for Unity is enabled at the bottom.


1 Answers

The VS Tools for Unity (VSTU) provide completion for Unity Messages (special methods that are called from the Unity engine, such as OnCollisionEnter).

Good news, the issue you describe is an issue that we have identified and that we're working on fixing. If it's extremely aggravating, in the meantime, you can either:

  1. Keep the Tools for Unity installed, and disable that particular feature in Tools -> Options -> Tools for Unity, and set Unity Message code completion to False. You might have to re-open the project for it to take effect.
  2. Commit the method snippet by using enter or tab when the IntelliSense shows the Unity Message you want to add, even if it goes against your muscle memory for a while :)

Disclaimer: I'm the Dev Lead for the Tools for Unity at Microsoft.

like image 89
Jb Evain Avatar answered Sep 30 '22 06:09

Jb Evain