Problems with Syntax Colouring - Lexems not working as expected

I've created a custom config and it is only partially working,  I've tried a number of combinations but with no luck. 


Examples of issues:

Keywords

<lexem BeginBlock="Feature\:" Type="SectionKeyWord" IsBeginRegex="true"  Priority="1" />
<lexem BeginBlock="Scenario:" Type="SectionKeyWord" Priority="1" />

Expected it to highlight Feature: or Scenario: but does not work.

Variables

<lexem BeginBlock="\&lt;[0-9A-Za-z]+\&gt;" IsBeginRegex="true" Type="Variable" />

Should identify strings such as <Eat1> or <Shoe2> but does not.

Tags

 <lexem BeginBlock="(@[0-9A-Za-z]+)" IsBeginRegex="true" Type="TagName" />

Should detect tags like @cat or @text33 but does not.

I suspect I'm doing something silly. Help!

Mark


3 Replies

DR Durga Rajan Syncfusion Team May 7, 2018 06:46 AM UTC

Hi Mark Marshall, 

Thanks for contacting Syncfusion support. 

We have checked your query about highlighting the text through configuration file in SyntaxEditor. We suggest you to mention the same Regex expression in the Split tag also. So that the expression will be considered as single word. Please refer the below code example, 

     <lexems> 
      <lexem BeginBlock="Feature" EndBlock=":" Type="SectionKeyWord" /> 
      <lexem BeginBlock="Scenario" EndBlock=":" Type="SectionKeyWord" />      
       <lexem BeginBlock="@[0-9A-Za-z]+" IsBeginRegex="true" Type="TagName" />          
      <lexem BeginBlock="&lt;([0-9A-Za-z])+&gt;"  IsBeginRegex="true" Type="Variable" />         
 
     </lexems> 
     <splits> 
      <split IsRegex="true">&lt;([0-9A-Za-z])+&gt;</split>        
      <split IsRegex="true">@[0-9A-Za-z]+</split>          
     </splits> 
  
Also we have prepared sample which tries to meet your requirement. Please get the sample from below location, 



If we have misunderstood your query or if you are facing any issues with the sample, please get back to us with more details. This would help us to provide solution at earliest. 

Regards, 
Durga S. 



MM Mark Marshall May 7, 2018 10:04 AM UTC

Thank you.  Helped a lot.  Is there a definitive list of the elements and attributes?  I noticed some around indent control but I've not seen those in the online documentation.


DR Durga Rajan Syncfusion Team May 8, 2018 09:13 AM UTC

Hi Mark Marshall, 

Thanks for your update. 

We have a plan to improve our EditControl documentation. Considering your feedback, we will include the all details about the attributes and elements of custom configuration file of EditControl.  

Regards, 
Durga S.  


Loader.
Up arrow icon