Forum Visual Studio

Code Templates, how do I switch the variable to edit?

JoelBarsottiJoelBarsotti USMember
edited February 2015 in Visual Studio

When using code templates I can get them to autocomplete and insert the template code. But after I enter the desired name for the first variable ($type$), I can't figure out how to advance to the second variable ($name$). Tab just inserts a tab, space does a space, enter inserts a return. Clicking with the mouse works, but it doesn't select the full text and the whole idea is not to use the mouse.

I can't seem to find the answer anywhere.

Posts

  • mhutchmhutch USMember, Xamarin Team Xamurai

    Tab works fine for me. Are these the built-in templates or custom ones?

  • I was trying to bring up a custom one, but I tried with the built in ones as well.

  • I see if you type the abbreviation, tab-tab, it works correctly.
    If you used the insert template dialog, you get the behavior I described.

  • mhutchmhutch USMember, Xamarin Team Xamurai

    Which built-in one? What XS version? What platform?

    If you're creating your own, make sure to mark the variable as editable.

  • I was testing with prop and my custom one.
    I'm on Xamarin 5.7.1 for mac.

    Both templates worked by typing their abbreviations and then hitting tab-tab. When selecting them in this way editing them works as expected.

    But when I select either template from the "insert template..." dialog the code appears, but is not indented correctly. The first variable is selected and editable (updates all instances of the variable). Tabbing at this point inserts tab characters into the document and does not advance the process.

  • mhutchmhutch USMember, Xamarin Team Xamurai

    Ah, that sounds like a bug then. Could you please file it at bugzilla.xamarin.com?

Sign In or Register to comment.