Codesmith Code Behind Files
Hi
I use CodeSmith extensively and I often use a code behind file for common functions.
The files has a "double extension" LinqHelpers.cst.cs
Is there any way I can adjust a setting so as to be able to see the structure in File Structure. I have been using Visual Assist X (sorry !) recently and thier VA Outliner does show the structure .
It makes navigation a lot easier
VS 2010 Ultimate + Sp1 , Resharper 7.0.1
Thanks
Mike
Please sign in to leave a comment.
Hello Mike
Do I understand correctly that you'd like to see the structure of the current file combined with the structure of the code behind file in the File Structure window? This is not possible at the moment, however you can see all members from both files (and navigate to a member) through ReSharper | Navigate | Go To File Member... by checking the 'Include members from related files' check-box. Thank you!
Andrey Serebryansky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hi Andrey
Yes , the Codesmith code behind file is a bit like a ASP code behind file , it looks just like any partial C# class
The Codesmth template itself is more complex , and looks much like a std ASP page . I am not really worried about seeing an outline of the template. Similar to a ASP page you can add std C# code to Runat <Template> rather than Server
The Code behind file is used to abstract common stuff from the templates so it can be shared with multiple templates , and as such has quite a lot of methods for manipulating database tables etc through CodeSmith's Schema Explorer.
The only abnormal thing is its dual suffix , Helpers.cst.cs
This is the class definition, each template inherits this much as a ASP
partial class LinqHelpers : CodeTemplate
{
}
I have attached a typical one
What I would like is to see the structure of this file in File Structure
Cheers Mike
Attachment(s):
LinqHelpers.cst.cs.zip
Hello Mike
Do I understand correctly that 'Build Action' property for the file LinqHelpers.cst.cs file is set to something other than 'Compile' (you can check this by opening the Properties (F4) window for that file)? In that case there's no way to make ReSharper analyze that file or display a file structure for it. Thank you!
Andrey Serebryansky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hi
The Code Behind file is not actually part of a Std VS project , its called from within the CodeSmith template .
I have imported it into a VS project and it shows build action Compile as you suggest . BUT its till isn't analysed I have renamed it to xx.cs not xx.cst.cs and resharper analyses it normally
I assume R# doesn't recognize .cst.cs as a valid cs file, is there a way of configuring this extension to be valid
If not not to worry
Mike