Custom code snippets are not inserted automatically (with Name+Tab)

Hello,
I want to add a custom code snippet to my SyntaxEditor (which uses the roslyn parser). I used the method-1 that andrew mentioned here (I put it in my Form1_Load event). That method works and my custom code snippet is displayed in the list (by calling Ctrl + K + X manually) but is not automatically displayed with typing its name and pressing Tab key. how can I make it insert automatically with name+tab (like other default c# code snippets) ?

Thanks

Hi Peyman,

If I understand correctly you’d like code snippet code to be inserted when you type its shortcut and then press tab
(like if you type for - it will insert snippet code for “for” snippet).

You would need to set snippet.Header.Shortcut when adding custom snippet.

Let me know if this is what you’re looking for.

Regards,
Dmitry

1 Like

Hi Dmitry,
Yes! that’s exactly what I was looking for.
Thanks a lot & happy new year

Hi Peyman,

Great, thank you for confirming. Happy New Year!

Regards,
Dmitry

1 Like