Sort order for snippets in Syntax Editor

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Poshoholic
Version: 4.0.0288
Avatar
What is the recommended method to configure the snippet intellisense dialog such that folders are shown at the top in alphabetical order, then snippets below the folders, also in alphabetical order (much like Windows Explorer)? With the default sort, folders and snippets are mixed together and it makes it much more difficult to see when there are subfolders that may contain snippets you are looking for, especially when you have a lot of snippets.

Thanks,

Kirk out.

Comments (3)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi,

I'm sorry but due to how the member list matches items in it, the items must be sorted alphabetically at this time. If they aren't, then the matching algorithms won't function correctly when the user types.


Actipro Software Support

Posted 13 years ago by Poshoholic
Avatar
Thanks for the response. Based on that, here are a few improvements that I would like to request then that I think would go a long way to making snippets much, much better than they are currently.

1. Either sort by name with folders on top by default or make it an option (simple boolean flag) to enable this sorting. Sorting snippets like Explorer does would make it much easier for end users to find snippets in snippet trees. Note that in Explorer you can still type in a name even when it is sorted this way and it will find the item, so the typing requirement is not an excuse.

2. For typing in names, right now you can only type in the name of a snippet at the current level. Snippets can be laid out in hierarchies though, and they should be because this improves discoverability for newcomers. Once you have found a snippet that you like though, you don't want to have to click through the snippet tree every time to get to it. That's just inefficient. I want the snippet matching algorithms to function differently. When a user types something in the snippet name field, I want it to show me a filtered list of all snippets from that point onwards (recursive search) that match the characters I have typed by name or by shortcut. This probably can't be made the default, so simply give me an option to set it up this way.

3. Support discovering (and showing) snippets in the snippet hierarchy if a shortcut to a snippet is found. It can be useful to place snippets in multiple locations in a snippet hierarchy. For example, you may have a Best Practices folder in your snippet hierarchy with any snippets that are considered best practices worth knowing about, and those snippets could be in other locations where they are relevant in the hierarchy as well. You don't want to have duplicate snippets because that requires more maintenance and is more error prone, and in a solution like this where you are showing flattened search results you really only want to see one copy of each snippet. Instead, I'd like to simply create a shortcut to a snippet and with that shortcut in place, have the appropriate snippet show up in the appropriate location. This gives me a single copy of each snippet (easy maintenance, less error going forward, without sacrificing discoverability by end users).

The end result of enabling these three options would be pretty great. Users would be able to browse a snippets hierarchy and know when there are categorized snippets because folders would always be at the top. They would see snippets in all appropriate locations in the hierarchy without duplication, allowing them to modify the snippets once and have those modifications applicable everywhere that the snippet appears. And if they know the snippet they want from the start, they could simply activate the snippet control, type in the name or shortcut, and press enter once they either select the match in the filtered (recursive, but flattened) list of results or once the snippet they want is the only match remaining in the list, without duplication of snippets since the search would not find shortcuts, only .snippet files.

Here's an example. In my syntax editor, I press Ctrl+I to get the snippet browser window open, then I type in fx because I know there is a function snippet with a shortcut of fx. At this point I should see the fx snippet at the top (selected), followed by any other snippets whose name or shortcut starts with fx. I simply press enter and the snippet is inserted into my editor. Without this support, I would have to press Ctrl+I, then type the name of the folder containing the snippet (assuming I knew the folder name), press Enter, go into a subfolder if necessary, then type the name of the snippet itself, etc. That is a lot more work and really defeats the purpose of having snippets in the first place. I have snippets defined that are quite short, but useful time savers if I could actually invoke them quickly and easily like this.

I hope this is useful. Your snippets support in the Syntax Editor is great, but I get repeated requests from end users for having folders on top and for snippet shortcut support, and I think these three changes would go a long way to taking your snippet support to the next level.

If you have any more questions about this, I would be happy to continue the discussion. If you decide this is worth implementing, I would be happy to test it out for you.

Thanks,

Kirk out.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thank you for your detailed comments and input. We're adding these items to our TODO list as feature requests, and can let you know if we require more input on them in the future.


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.