I would like to create a snippet for comments. This is easy for static data but I want to add the sub or function name dynamically so wherever I insert the snippet it should add the name of the function or sub that I'm currently in. Guess it would look something like:
' <Procedure name>
'
' Objective :
'
' Parameters :
'
' Author :
'
' History :
And obviously I want the Author and Procedure name tags to be filled automatically.
Is there any way to do this with a snippet Or are there any other tools that would do this for me
Regards,
neiden

Create a comment snippet
Eli Robillard
Hi neiden,
Thank you for submitting this question. Unfortunately, we do not currently have support in VB code snippets for the kind of function you would need to produce this behavior. We have considered the idea, but unfortunately that functionality has not been prioritized enough to make it into a release.
If you have an opportunity, can you please file a suggestion in MSDN Feedback: http://lab.msdn.microsoft.com/productfeedback/ That is the best way for us to track customer suggestions to consider for future releases.
In the meantime, it is possible to write a macro to achieve your goal. That is what DMan1's earlier response was trying to convey. However, at that point you would not be using snippets. You would essentially be creating a macro to call whenever you wanted to insert one of these comments. (Not quite as easy as having a snippet do the work for you... :( )
Thanks,
Lisa Feigenbaum
Visual Basic Program Manager
Poida
Imports
EnvDTEImports
EnvDTE80Imports
System.DiagnosticsImports
System.WindowsImports
System.Windows.FormsImports
SystemPublic
Module CreateProperty Private Sub CreateProperty(ByVal PropertyName As String, ByVal PropertyScope As String, ByVal PropertyType As String)DTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text =
"Private m_" & PropertyName & " as " & PropertyTypeDTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text = PropertyScope &
" Property " & PropertyName & "() as " & PropertyTypeDTE.ActiveDocument.Selection.NewLine()
DTE.ActiveDocument.Selection.Text =
"Return m_" & PropertyNameDTE.ActiveDocument.Selection.LineDown(
False, 3)DTE.ActiveDocument.Selection.Text =
"m_" & PropertyName & " = value"DTE.ActiveDocument.Selection.LineDown(
False, 3)DTE.ActiveDocument.Selection.NewLine()
End Sub
Sub CreateInteger() Dim PropertyName As String = InputBox("Enter Name Of Property") Dim PropertyScope As String = "Public" Dim PropertyType As String = "Integer"CreateProperty(PropertyName, PropertyScope, PropertyType)
End SubSteve Powell
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=61654&SiteID=1#_Toc109549594