Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
925
xamSyntaxEditor not finding commented text matches
posted

Hi,

After providing the custom language with multi line comments I am having a problem searching for matches within comments. Is this feature or it is a bug? Strangely searching on same line keeps finding the matches but not on different lines.

My Syntax editor language comments code (based on this code with sample):

 <TerminalSymbol Name="COMMENT_START" Value="/*" LanguageElementName="Comment"> 
  <LexerState Name="Comment"> 
   <TerminalSymbol Name="COMMENT_TEXT" Value="([^\*]|\*[^|/])+" Comparison="RegularExpression" LanguageElementName="Comment" LookaheadPattern="\*/"/>
	<TerminalSymbolReference Name="NewLineToken"/> 
	<TerminalSymbolReference Name="WhitespaceToken"/> 
   <TerminalSymbol Name="COMMENT_END" Value="*/" LanguageElementName="Comment" IsExitSymbol="true"/> 
  </LexerState>
 </TerminalSymbol>
 <TerminalSymbol Name="SINGLE_LINE_COMMENT" Value="//.*" Comparison="RegularExpression"  LanguageElementName="Comment"/>

Sample of code:

/*
Find me
*/

Looking in the Syntax Editor for 'find' finds no matches. The search code:

				var data = value.ToString();
				var tsc = new TextSearchCriteria(data);
				var searchResults = ActiveDocumentView.Document.CurrentSnapshot.FindAll(tsc);

				if (searchResults == null)
					return;

				// Clear the current results.
				if (mSearchResults.Count > 0)
					mSearchResults.Clear();

				if (searchResults.Results.Count == 0)
				{
					DialogManager.ShowMessageBox("There are no items matching your search criteria.", "Search results");
					return;
				}

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Tomas,

    I have been investigating into this behavior with the sample project at the forum thread you have linked, and I have reproduced the behavior you are seeing. To ensure it was not something that was wrong with the custom XamSyntaxEditor that you are using, I isolated this behavior out to a new sample project that uses a base XamSyntaxEditor with our built-in C# language. This behavior is still reproducible there as well.

    This behavior is unexpected, and as such, I have asked our engineering staff to examine it further. To ensure it receives attention, I have logged it in our internal tracking systems with a development ID of 260048. I have also created you a private support case that I will be linking to this behavior. It has an ID of CAS-199556-X3V5C3 and you can access it on the support activity page after signing into your account.

    Please let me know if you have any other questions or concerns on this matter.

Children