Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 GetComponent

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

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#

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000