We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Context menu comment option

Thread ID:

Created:

Updated:

Platform:

Replies:

149682 Dec 5,2019 10:40 AM UTC Dec 16,2019 06:39 AM UTC WinForms 8
loading
Tags: EditControl
gavin
Asked On December 5, 2019 10:40 AM UTC

Hi

I've developed a custom language lexer for the edit control which works well.

However, I'm now trying to use the context menu options.  Most of them work as expected.  However, the comment / uncomment options don't  appear to do anything.

I cannot find anywhere in the documentation how you set what should happen when the comment line / comment selection options are chosen from the editcontrol's built in context menu.

Can anyone explain how you set what should happen when these options are clicked.

Thanks

Gavin

Niranjan Kumar Gopalan [Syncfusion]
Replied On December 6, 2019 01:01 PM UTC

Hi Gavin, 
 
Thanks for contacting Syncfusion support. 
 
We are currently analyzing your query regarding “Comment and uncomment options don't  appear to do anything” and we will update you on December 10th 2019. 
 
 
Regards, 
Niranjan Kumar 
 


Niranjan Kumar Gopalan [Syncfusion]
Replied On December 10, 2019 01:35 PM UTC

Hi Gavin, 
 
Thanks for your update. 
 
We have analyzed your query regarding ”Comment and UnComment option in context menu not working” . The comment and uncomment option doesn’t work for default language. For C-Sharp codes we have provided the code snippet and simple sample required to achieve your criteria. 
 
C#: 
 this.editControl1.ApplyConfiguration(Syncfusion.Windows.Forms.Edit.Enums.KnownLanguages.CSharp); 
 
 
Regards, 
Niranjan Kumar 


gavin
Replied On December 11, 2019 09:49 AM UTC

Niranjan

I'm sorry but that doesn't work for me.  I want to apply a specific set of comment characters for my own custom language, not use the comment characters that are associated with c#.

Gavin

Niranjan Kumar Gopalan [Syncfusion]
Replied On December 12, 2019 01:19 PM UTC

Hi Gavin, 
 
Thanks for your update. 
 
We are currently analyzing you query “Want to apply a specific set of comment characters for my own custom language”. Can we know details regarding whether the language that you are using comes under known languages and whether only the comment and uncomment options in context menu does not work for your custom language and other options works properly? 
 
Regards, 
Niranjan Kumar 


gavin
Replied On December 12, 2019 03:06 PM UTC

I'm writing a python editor, so all lines when commented should have a '#' in front of them. 
The other items in the context editor work fine.

Your documentation suggests that the editor can be used for an arbitrary language, so I'd assumed that you could set the comment characters somewhere.

Thanks


Niranjan Kumar Gopalan [Syncfusion]
Replied On December 13, 2019 10:31 AM UTC

Hi Gavin, 
 
Thanks for your update. 
 
We have analyzed your query “Comment and UnComment option in context menu not working”. To enable the comment and uncomment actions please do the below changes in you config.xml file.  
 
C#: 
At the initialization of config language enable StartComment property by assigning your comment prefix string. 
<ConfigLanguage name="Python" StartComment="#" > 
Lexem with type comment should be added inside the lexems. 
<lexems> 
 
                <lexem BeginBlock="(" Type="Operator" /> 
 
                <lexem BeginBlock=")" Type="Operator" /> 
 
                <lexem BeginBlock="'" Type="Operator" /> 
 
                <lexem BeginBlock="car" Type="KeyWord" /> 
 
                <lexem BeginBlock="cdr" Type="KeyWord" /> 
 
                <lexem BeginBlock="cons" Type="KeyWord" /> 
                                                             
               <lexem BeginBlock="#" EndBlock="\n" IsEndRegex="true" Type="Comment" IsComplex="true" OnlyLocalSublexems="true" /> 
 
</lexems> 
 
Please refer the below sample and video for your query. 
 
 
 
Regards, 
Niranjan Kumar 
 


gavin
Replied On December 13, 2019 04:26 PM UTC

Many thanks

That works great

Gavin 

Sudharsan Narayanan [Syncfusion]
Replied On December 16, 2019 06:39 AM UTC

Hi Gavin, 
 
Thanks for you update.  
 
We are glad to know that the reported issue has been resolved at your end. Please let us know if you need any further assistance on this. We are happy to help you.  
 
Regards,  
Sudharsan N 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon