How does the SurroundsWith CodeSnippetType work?

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by shark92651
Avatar
I'm not quite sure how this is supposed to work in the editor. Are you supposed to select text and then invoke the list of templates or what?

Comments (3)

Posted 14 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
Certain CodeSnippets (not all) will handle selected text in a certain way when a CodeSnippet is activated. For instance, if you highlight a block of text and then activate the "for" snippet, the selected text will become the body of the for statement.

Any CodeSnippet that can handle selected text should be of the SurroundsWith type. This flag is primarily used to determine which Code Snippets are listed when you emulate the "Insert Snippet" or "Surround With" commands from Visual Studio 2005.
Posted 14 years ago by shark92651
Avatar
So I just need to provide another way to invoke a template? From a context-menu, for example, and then Activate it myself?
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Exactly... either that or show the Insert Snippet popup, which lets the user choose which code snippet to activate.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.