Comments don't get highlighted - why?

Topics: Developer Forum
May 22, 2013 at 5:40 PM
Edited May 22, 2013 at 5: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"?>
<ScintillaNET>
  <!--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">
      <List>
          <!--Insert autocomplete keywords here-->
      </List>
    </AutoComplete>

     <!--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">
      </Keywords>
    </Lexer>
    <Styles>
        <Style Name="WORD" ForeColor="Black" BackColor="White"/>
    </Styles>
  </Language>
</ScintillaNET>
It doesn't recognize these comment prefixes, it still uses "--" for comment highlighting... What am I doing wrong?

Regards,
2mq
May 22, 2013 at 7: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.