This project is read-only.

Custom Syntax problems

Topics: Developer Forum
Apr 18, 2013 at 11:25 PM
This seems to be a very common problem and I've looked through many discussion posts and haven't found anything that's helped me.

I have the following Xml language file:

<Language Name="mylanguage">
<Lexer LexerName="sql" LineCommentPrefix="--" StreamCommentPrefix="--" StreamCommentSuffix="--">
<Property Name="fold.comment" Value="1" />
<!--Keyword list 0 mylanguage SQL Keywords (Style WORD) --> <Keywords List="0">
:= :> :< :!= : :! [as] [and] [or] on [parameter]$ use #extendedfields outerjoin innerjoin select from union where
<!--Keyword list 0 mylanguage Keywords --> <Style Name="WORD" ForeColor="blue" bold="true" />
<!--Keyword list 1 mylanguage Types --> <Style Name="COMMENTLINE" ForeColor="green" bold="true" italic="true" />
<Style Name="COMMENTDOC" ForeColor="green" bold="true" italic="true" />
<Style Name="COMMENT" ForeColor="green" bold="true" italic="true" />

With the following code
this.XPathText.Lexing.LexerLanguageMap["mylanguage"] = "sql";
            this.XPathText.ConfigurationManager.CustomLocation = System.IO.Path.GetFullPath("Configuration/mylanguage.xml");
            this.XPathText.ConfigurationManager.Language = "myLanguage";
The problem is that /* is keying a comment area where I don't what this behavior. The only comment key should be --

How can I prevent the default "/*" stream prefix and suffix and just use the --

Thanks in advance,

Apr 30, 2013 at 2:41 PM
This is caused by the fact that the /* stream comment is handled at the lexer level, the CommentPrefix attributes in the xml are there to enable support for commenting out lines or blocks via hotkeys. The only way to not have / */ as a stream comment would be to either use a different lexer, or else create your own.