Can not get custom language to work at all

Aug 20, 2009 at 10:42 PM

I just found this project and am quite interested.

I have a very simple syntax color scheme but not sure where to start.

My text file basically is defined like this

; = a whole row comment
Hex Hex hex Hex Hex name.text     ; Another comment
Hex Hex hex Hex Hex name.text     ; Another comment
; = a whole row comment

So as far as color all I want really is one of the folowing to be true:

1) a semicolon defines a comment


2) a semicolon defines a comment and the HEX digits to be a colour and the name.text to be a color.

I have it working using the built in such as mssql but can I change this?

I created an XML file (copied from the source code) and set it to copy to my BIN folder

Under ConfigrationManager I set

customLocation = color.xml
Language = mycolor

<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
  <Language Name="mycolor">
    <Lexer LineCommentPrefix=";" StreamCommentPrefix="--[[" StreamCommentSuffix="--]]" >
    </Lexer>
    <Styles>  
      <Style Name="BLOCK_COMMENT" ForeColor="Green" />
      <Style Name="COMMENT" ForeColor="Green" />
      <Style Name="COMMENTBLOCK" ForeColor="Green" />
      <Style Name="COMMENTDOC" ForeColor="Green" />
      <Style Name="COMMENTDOCKEYWORD" ForeColor="Green" />
      <Style Name="COMMENTDOCKEYWORDERROR" ForeColor="Green" />
      <Style Name="COMMENTLINE" ForeColor="Green" />
      <Style Name="COMMENTLINEBANG" ForeColor="Green" />
      <Style Name="COMMENTLINEDOC" ForeColor="Green" />
     
      <Style Name="HEXNUMBER" ForeColor="Orange"/>
      <Style Name="NUMBER" ForeColor="Orange" />
      <Style Name="STRING" ForeColor="Green"/>
      <Style Name="STRINGEOL" ForeColor="Green" BackColor="#ffaaa" EolFilled="True" />
    </Styles>
  </Language>
</ScintillaNET>

 I really don't know what to do next - it does nothing...  any ideas appreicated

Chris

Developer
Sep 1, 2009 at 7:40 AM

I guess your <Lexer [...] > is missing the attribute LexerName="cpp" where cpp is the name of your lexer. Look at the text Files in the Configuration/BuiltIn Folder of the project, there you can find pre defined Lexers, e.g.  cpp = C++/C#.

So if you don't define that name, Scintilla don't know which Lexer you want to use.

Hope it helps a bit

Best Regards