This project is read-only.

CSS lexer settings

Topics: Developer Forum, User Forum
Jul 3, 2012 at 2:24 PM

Hi,
it's me again. Now I have some problems with a css lexer. 

This is the code, I have:

<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
  <Language Name="css">
    <AutoComplete FillUpCharacters="(" SingleLineAccept="True" IsCaseSensitive="False">
      <List>
        azimuth background background-attachment background-color background-image background-position background-repeat border border-bottom border-bottom-color border-bottom-style border-bottom-width border-collapse border-color border-left border-left-color border-left-style border-left-width border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-style border-top-width border-width bottom caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor direction display elevation empty-cells float font font-family font-size font-size-adjust font-stretch font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marker-offset marks max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes richness right size speak speak-header speak-numeral speak-ponctuation speech-rate stress table-layout text-align text-decoration text-indent text-shadow text-transform top unicode-bidi vertical-align visibility voice-family volume white-space widows width word-spacing z-index
        active after before checked disabled empty enabled first first-child first-letter first-line first-of-type focus hover lang last-child last-of-type left link not only-child only-of-type nth-child right root target visited
      </List>
    </AutoComplete>

    <Indentation TabWidth="4" SmartIndentType="cpp" />

    <Lexer LexerName="cpp" LineCommentPrefix="" StreamCommentPrefix="&lt;!--" StreamCommentSuffix="--&lt;" >
      <!-- <Keywords List="1" Inherit="False">-->
     <!-- <Keywords List="0" Name="HTML">!doctype a abbr accept-charset accept accesskey acronym action address align alink alt applet archive area axis b background base basefont bdo bgcolor big blockquote body border br button caption cellpadding cellspacing center char charoff charset checkbox checked cite class classid clear code codebase codetype col colgroup color cols colspan compact content coords data datafld dataformatas datapagesize datasrc datetime dd declare defer del dfn dir disabled div dl dt em enctype event face fieldset file font for form frame frameborder frameset h1 h2 h3 h4 h5 h6 head headers height hidden hr href hreflang hspace html http-equiv i id iframe image img input ins isindex ismap kbd label lang language leftmargin legend li link longdesc map marginwidth marginheight maxlength media menu meta method multiple name noframes nohref noresize noscript noshade nowrap object ol onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseover onmouseout onmouseup optgroup option onreset onselect onsubmit onunload p param password profile pre prompt public q radio readonly rel reset rev rows rowspan rules s samp scheme scope script select selected shape size small span src standby start strike strong style sub submit summary sup tabindex table target tbody td text textarea tfoot th thead title topmargin tr tt type u ul usemap valign value valuetype var version vlink vspace width xml xmlns</Keywords>
      --> <Keywords List="1" Inherit="False">
        azimuth background background-attachment background-color background-image background-position background-repeat border border-bottom border-bottom-color border-bottom-style border-bottom-width border-collapse border-color border-left border-left-color border-left-style border-left-width border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-style border-top-width border-width bottom caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor direction display elevation empty-cells float font font-family font-size font-size-adjust font-stretch font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marker-offset marks max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes richness right size speak speak-header speak-numeral speak-ponctuation speech-rate stress table-layout text-align text-decoration text-indent text-shadow text-transform top unicode-bidi vertical-align visibility voice-family volume white-space widows width word-spacing z-index
        active after before checked disabled empty enabled first first-child first-letter first-line first-of-type focus hover lang last-child last-of-type left link not only-child only-of-type nth-child right root target visited
      </Keywords>
      <!--</Keywords> -->
    </Lexer>


    <styles >
      <Style Name="IDENTIFIER" ForeColor="#00FF22"/>
      <SubLanguage Name="HTML">
        <Style Name="DEFAULT" />
        <Style Name="TAG" />
        <Style Name="TAGUNKNOWN" />
        <Style Name="ATTRIBUTE" />
        <Style Name="ATTRIBUTEUNKNOWN" />
        <Style Name="NUMBER" />
        <Style Name="DOUBLESTRING"  />
        <Style Name="SINGLESTRING"  />
        <Style Name="OTHER" />
        <Style Name="COMMENT" />
        <Style Name="ENTITY" />
        <Style Name="TAGEND" />
        <Style Name="XMLSTART" />
        <Style Name="XMLEND" />
        <Style Name="SCRIPT" />
        <Style Name="ASP" />
        <Style Name="ASPAT" />
        <Style Name="CDATA" />
        <Style Name="QUESTION" />
        <Style Name="VALUE" />
        <Style Name="XCCOMMENT" />
      </SubLanguage>
    </styles>

  </Language>
</ScintillaNET>

But this is not really working, like it should. When I change the LexerName to "css", the folding for example works fine. But the highlighting does not. For example color codes, or sizes like '500px' are not highlighted.

How can I fix this, and use a real css lexer?

Thanks, for your help.

Jul 4, 2012 at 8:35 PM

solved