Is there a way to turn off the squiggle for just a few syntax errors?

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 10 years ago by sdever
Version: 14.1.0601
Avatar

Is there a way to turn off the squiggle for just a few syntax errors? Specifically, we would like to suppress the squiggle for the “End of statement expected” error.

Here is our scenario:

We are using the Syntax Editor control with the .NET Languages Add-on to provide syntax highlighting and intellisense with the Windows Workflow Re-hosted Designer. Actipro provided us with sample code and we have made a few modifications to get it to work in our scenario. Overall, we have been very impressed with the control and add-on.


The default Windows Workflow editor is basically a textbox, but by using the Re-hosted Windows Workflow Designer ExpressionEditorService and IExpressionEditorInstance features we replaced the default textbox with the Actipro Syntax Editor control.  When constructing the Syntax Editor control, we enumerate the variables and namespaces to build the Header and Footer text for the Syntax Editor. When the editor control appears it allows the user to type in conditional expressions. They receive full intellisense and syntax highlighting.


For some Windows Workflow Activities, such as the IF activity, the user needs to provide a Boolean expression such as User.Name = “Bob”. The problem is, in this scenario, the Syntax Editor display a squiggle at the end of the expression which states “End of Statement expected”. It would be nice to turn this off squiggle because end users think they have an error.

Comments (2)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Would you be able to take our workflow integration sample and modify it to show this scenario, and then email it to our support address so we can have a look in case there is a simple workaround?  Please reference this thread and make sure you rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Answer - Posted 10 years ago by sdever
Avatar

I was able to solve this problem.  The issue was related to properly configuring the headerText and footerText when creating the instance of the Editor. 

Here is the line of code from your sample.

headerText.Append("\r\nReturn ");
var footerText = "\r\nEnd Sub\r\nEnd Class";

Here is the change that will cause the squiggle line to appear.  Notice I removed the \r\n before the End Sub.
The missing Carriage Return and New Line before the "End Sub" was causing the problem.

headerText.Append("\r\nReturn ");
var footerText = "End Sub\r\nEnd Class";

I had rewrote this section in my code.  When I did, I put the Return statement in footText and did not have a \r\n before it.

Thanks.

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.