We recently released CodeSmith Generator 6.0.2, which featured many usability and performance improvements to the Property Window and Editor Intellisense. We focused on bug reports as well as usability issues that we came across in the Template Editor since the Generator 6.0 release. As stated in a previous blog post it was pretty difficult for us to improve the Template Editor Intellisense in previous versions of Generator. As such, we took great steps to ensure that updates in the current version wouldn’t be such a burden.
Since releasing Generator 6, we’ve added the following new features: Intellisense support for Anonymous Types and improved parameter information. Also we have taken huge strides in reducing the memory usage that our Intellisense Engine uses while reducing assembly locking issues.
Please note that you can always see an up-to-date version of the text below here.
In previous versions of CodeSmith Generator there was no support for anonymous types or extension methods. The sample below will show off an example of Anonymous Type support.
In this screenshot, we have implicitly declared a variable anonymousType as an anonymous type. The anonymous type’s properties are initialized using a variable (numbers) as well as a string constant ("Blake"). Hovering over the anonymousType variable will display quick info, which reveals anonymousType as an anonymous type.
We can bring up the statement completion list by typing period after our variable. This will display a list that contains all of the members of the variable anonymousType. The two properties we declared (Numbers and Name) in the anonymous types creation expression appear in the list. You can see it has correctly assigned property names and their types.
Automated parameter info tips show whenever typing an invocation (E.G., a method call). The tips show detailed information about the invoked member along with details about the current argument being typed. In the case where the invoked member has multiple overloads, arrows show on the popup and allow toggling between all the available overloads.
As with quick info, parameter info can handle rich-formatted content display using HTML-like markup tags. Colors and font weights or styles can be used to bring attention to portions of the info tip. The screenshot above shows the font weights bringing attention out to the current parameter seed.
Multiple signature options can be displayed in a single parameter info tip. In those scenarios, arrows automatically appear that can be clicked. Alternatively the end user can use the up/down arrow keys to switch between options.