Bug in Code Snippets...

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Thomas Goff
Avatar
Currently, the code snippets do not correctly support multiple levels of folders. This can be seen by modifying the C# snippets folder structure in your sample application. The shipped structure is as follows:

Snippets\C#\for.snippet
Snippets\C#\switch.snippet
Snippets\C#\Sample Child Folder\while.snippet

If you update it to the following structure, then the code snippets will not property load:

Snippets\C#\Sample Child Folder 1\Sample Child Folder 2\for.snippet
Snippets\C#\Sample Child Folder 1\Sample Child Folder 2\switch.snippet
Snippets\C#\Sample Child Folder 1\Sample Child Folder 2\while.snippet

Using Reflector, I was able to determine that the issue is in the CodeSnippetFolder.Refresh method. Specifically, the if-statement, in the for-loop that iterates over the sub-folders, will only add “Sample Child Folder 1” to it’s list of valid folders if it has actual snippet files. This if-statement should also add the “Sample Child Folder 1” if it has sub-folders that have actual snippet files.

Therefore, this:
if (folder1.CodeSnippets.Count > 0)
Should be:
if (folder1.CodeSnippets.Count > 0 || this.ChildFolders.Count > 0)

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks, this is fixed for the next maintenance release.


Actipro Software Support

Posted 14 years ago by Thomas Goff
Avatar
Excellent and thank you. Great control by the way. Hands down, the best editor out there.
The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.