T O P I C R E V I E W |
StoshFerhobin |
Posted - Feb 18 2020 : 5:36:40 PM So in C# and Unity,
Typing "GetComp" brings up some auto complete choices, going down to "GetComponent<>" and hitting enter now results in : GetComponent()
Which is wrong, I need <> not ()
I tried adding a snippet of my own but this is the only thing that shows up.
How to fix please? I type this command constantly in Unity. |
3 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 20 2020 : 05:38:30 AM We are aware of this limitation with VA. In some situations functions / classes are overloaded, so one version requires <> and another version does not require this, so it's not always obvious how best to handle this.
Hopefully for now the snippet is working well for you and helping you to work around this. |
StoshFerhobin |
Posted - Feb 19 2020 : 4:54:16 PM Okay thanks, changing the shortcut to something else such as "GC<" works instead of pulling up the long list of default GetComponent menu options.
It would be really nice if VA could do this, as default c# somehow does |
feline |
Posted - Feb 19 2020 : 06:22:26 AM VA does not currently automatically insert the <> brackets for a template or generic function, but this is a change we are considering making:
case=460
but a VA Snippet should work just fine here. How have you set up your snippet?
As a simple test case, I have created a C# snippet with the shortcut "GC" and set it to insert the code:
GetComponent<$end$>()
so the caret ends up between the angle brackets, and this works as expected for me, using VS2017 and VA 2358. This does require having turned On
VA Options -> Suggestions -> Suggestion and Completion lists Enable in C#
|