Cool snippet enhancement request

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by shark92651
Avatar
I would be really cool if there was a way to provide a pick-list for a parameter when a snippet is expanded. I would imagine it being implemented as a drop-down button that appears in the parameter when it is focused. Either clicking it with the mouse of pressing a shortcut-key would drop it down. The list of values for the pick list could either be coded into the .snippet xml file or they could be fetched dynamically through an event. The event would include the snippet that is being activated and the focused parameter. My users would love this. What do you think?

Comments (3)

Posted 18 years ago by Ashton - Developer, Schema Solutions LLC
Avatar
I already do this using the snippet events available. When a snippet parameter is entered I look at the name and if it of a certain type I di9splay a drop down list of items based on the snippet name.

Look in the doc for OnCodeSnippetFieldActivated
Posted 18 years ago by shark92651
Avatar
I guess it helps to read the docs :) Well that would get me part of the way there. I would still like to have the ability to set some static values for a parameter as well. This way the user can supply the list of values for their parameter in the snippet editor I built. I have no way of knowing what the user may want in the list, but the event would be a great way to populate with a list of values for a system-defined list - such as $tables$, for instance to fetch a list of database tables. Thanks for the tip.
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hmm... the problem here is that we're trying to stick to the Visual Studio schema for code snippets and not modify it since we can save/load from the format that is compatible with VS.

How about this though... once a code snippet is activated, look at the actual snippet XML file again and do a query for your custom tags. The filename is stored in the CodeSnippet.SourceFile if it was loaded from a file.

That would allow us to not modify the schema and would still let you get your info.


Actipro Software Support

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.