Comments don't get highlighted - why?

Topics: Developer Forum
May 22, 2013 at 4:40 PM
Edited May 22, 2013 at 4:42 PM
Hi there,

although I already specified
scintilla1.Lexing.LineCommentPrefix = "//";
scintilla1.Lexing.StreamCommentPrefix = "/*";
scintilla1.Lexing.StreamCommentSufix = "*/";
With this custom XML:
<?xml version="1.0" encoding="utf-8"?>
  <!--This is what you set the Language property to-->
  <Language Name="myLanguage">

    <!--These are characters after which autocomplete will open-->
    <AutoComplete FillUpCharacters=".([" SingleLineAccept="True" IsCaseSensitive="False">
          <!--Insert autocomplete keywords here-->

     <!--Indentation width and indentation type-->
    <Indentation TabWidth="4" SmartIndentType="cpp" />

     <!--Comment characters and the lexer to use-->
    <Lexer LexerName="lua" LineCommentPrefix="//" StreamCommentPrefix="/* " StreamCommentSuffix=" */" >
      <Keywords List="0" Inherit="False">
        <Style Name="WORD" ForeColor="Black" BackColor="White"/>
It doesn't recognize these comment prefixes, it still uses "--" for comment highlighting... What am I doing wrong?

May 22, 2013 at 6:01 PM
Please read previous discussions about this before posting. You can try this one and this one to see why. Basically, that XML tag and Lexing property don't affect the lexer at all - they only change how ScintillaNET works with comments, not how the underlying lexer (which is independent of ScintillaNET, for the most part) actually highlights. If you need a special type of comment prefix/suffix, consider writing your own lexer. There are a couple discussions on the Discussions page that may get you started.