Customizing the CSharpTextFormatter

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 1 month ago by William Cutler - CNC Software Inc.
Version: 19.1.0686
Avatar

Hello Actipro,

I am looking at slightly customizing the default CSharpTextFormatter that comes default with the Syntax editor to apply different formatting to return statements. Currently, it puts a space after "return" keyword in a void method like this:

namespace SyntaxEditorDemo {
	public class Program {
		public static void Main(string[] args) {
			return ;
                }
        }
}

But we want to just have "return;" without the space. I saw in the sample project Getting Started 13 that you can register a custom text formatter, and I also saw that the CSharpTextFormatter has an override method, but I am not seeing a way to cleanly implement this small customization with either of these methods. Would I need to clone the CSharpTextFormatter source code? (And if so, where would it be?)

Thanks!

-William

Comments (1)

Answer - Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi William,

Unfortunately you would need to have the .NET Languages Add-on's Blueprint source code to make that change yourself.  You can purchase it from us if you'd like. 

That being said, we found the issue for this particular scenario and fixed it for the next maintenance release.


Actipro Software Support

The latest build of this product (v21.1.3) was released 16 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.