Syntax highlighting for Java Properties

Matthias Böhm <[email protected]>
Newsgroups gmane.comp.kde.devel.kwrite
Message-ID <[email protected]>
Hello everybody, 
 
I’m using Kate already a long time. Recently, I opened a Java Properties
file, and saw, that the syntax highlighting for this type of file doesn’t
exist yet. So I decided to write an own syntax highlighting file for Java
Properties. I’ve attached this to the mail, together with an example file.
Could you please include the syntax highlighting file in the next release of
Kate?
 
Thanks, and best wishes, 
Matthias Böhm
Example.properties (application/octet-stream, 1.1 KB) - not displayed
JavaProperties.xml (text/xml, 1.9 KB)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Java Properties" version="1" kateversion="5.0" section="Other" extensions="*.properties" author="Matthias Böhm (MatthiasBoehm87 _at_ gmail.com)" license="LGPL">
  <highlighting>
    <contexts>
      <context name="key" lineEndContext="key">
          <RegExpr String="^(=|:)$" attribute="Separator" context="key"/>
          <RegExpr String="^(=|:)" attribute="Separator" context="value"/>
          <RegExpr String="^\s*(#|!)" attribute="Comment" context="comment"/> 
          <RegExpr String="\s*([^=:\s\\]|\\.)*\s*(?==|:)" attribute="Key" context="separator"/>
          <RegExpr String="\s*([^=:\s\\]|\\.)+\s+(?=\S)" attribute="Key" context="value"/>
      </context>
      <context name="separator" lineEndContext="key" >
          <RegExpr String="(=|:)$" attribute="Separator" context="key" />
          <AnyChar String="=:" attribute="Separator" context="value"/>
      </context>
      <context name="value" attribute="Value">
          <RegExpr String="([^\\]|\\.)*$" attribute="Value" context="continueWithKey"/>
          <RegExpr String="([^\\]|\\.)*\\$" attribute="Value" context="continueWithValue"/>
      </context>
      <context name="continueWithKey" lineEndContext="key" />
      <context name="continueWithValue" lineEndContext="value" />
      <context name="comment" lineEndContext="key" attribute="Comment" />
    </contexts>
    <itemDatas>
      <itemData name="Key" spellChecking="false" defStyleNum="dsOthers"/>
      <itemData name="Value" spellChecking="false" defStyleNum="dsString"/>
      <itemData name="Comment" spellChecking="true" defStyleNum="dsComment"/>
      <itemData name="Separator" spellChecking="false" defStyleNum="dsVariable"/>
    </itemDatas>
  </highlighting>
  <general>
    <comments>
      <comment name="singleLine" start="#"/>
      <comment name="singleLine" start="!"/>
    </comments>
  </general>
</language>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.