Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Conditional Snippets

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
MikeGameDev Posted - Aug 26 2016 : 4:37:32 PM
I want to change the comment block generated by my Document Method snippet depending on the number of parameters the method takes, for example:

This is the code for my Document Method snippet:

// $SymbolContext$ ( $SymbolVirtual$$SymbolPrivileges$$SymbolStatic$)
// Description: 
//	
// Parameters: 
//	$MethodArg$
// Returns:
//	$SymbolType$	



And it generates the following:

	// foo ( private static )
	// Description: 
	//	
	// Parameters: 
	//	int a 
	//	int b
	//	int c
	// Returns:
	//	void	
	static void foo(int a, int b, int c);


Which is great when the function has parameters, but when the function has no parameters it generates the following:

	// foo ( private static )
	// Description: 
	//	
	// Parameters: 
	// Returns:
	//	void	
	static void foo();


Notice that the "Parameters" line is being added. I'd like to have it so the snippet does not generate that line if the function takes no parameters.

How can I do this? Is it possible?

Thanks
2   L A T E S T    R E P L I E S    (Newest First)
Dusan Posted - Aug 29 2016 : 09:38:02 AM
Another option could be, if we would insert "void" when there is no parameter. There are many possible preferences.
ChrisG Posted - Aug 28 2016 : 12:31:36 PM
I think to do this you would need a custom reserved string, and there is no way to add or modify the default ones at the moment.

I could put in a feature request for you if you like!

For what it's worth I don't find that ugly, I think it helps me see that there aren't any parameters there.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000