How to configure the new (3.5+) syntax highlighter of Stash?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2015

In pre-3.5 Stash if I wanted to add new extensions to the syntax highlighter, I had to redefine the entire list of extensions (instead of just listing the additional types), like this:

#Add syntax highlighting for misc. XML files (from wsdl onwards), REMOVE ONCE STASH VERSION IS >= 3.5.0
syntax.highlighter.xml.extensions=xml,html,htm,shtml,shtm,jsp,jspf,tag,jspx,dtd,xsd,xsl,xslt,wsdl,msbuild,props,csproj,vcxproj,config,ism,settings,vcproj,proj,shfbproj,targets,fsproj,filters

The part from xml to xslt was the default value, which I found somewhere then but cannot find now.

On this page, or any of the pages linked from here, I cannot find information about whether the new syntax highlighter engine needs to be configured the same way (redefining the whole list) or by only defining the additional extensions. Which one is it?

In case I need to redefine the whole list, where can I find the current default values?

PS.: On the page I mentioned above, the link in the sentence "Configuration for Stash 3.4 and below can be found here." is probably not the one it should be.

1 answer

1 accepted

0 votes
Answer accepted
sgoo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 12, 2015

Hey @Balazs Szakmary

In Stash 3.5 you now only need to add the extra extensions you want you no longer need to include all the defaults.

Please also be aware that we are changing how we reference highlighters, we are now using mime types rather than names like "xml" it would now be "application/xml"

In your case the full line will be:

syntax.highlighter.application/xml.extensions=shtml,shtm,jsp,jspf,tag,jspx,dtd,xslt,wsdl,msbuild,props,csproj,vcxproj,config,ism,settings,vcproj,proj,shfbproj,targets,fsproj,filters

Also thanks for the info about the broken doc links, I'll try and get that fixed up.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 12, 2015

[Link works now.] One more question: can I have multiple lines in the config for one mime type or does it have to be one long line?

Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 13, 2015

Haven't tested, but you might try http://stackoverflow.com/questions/8975908/how-to-write-multiple-line-property-value-using-propertiesconfiguration That is, backslash as the last character to "escape" the newline and keep it out of the resulting value.

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2015

That is good to know too, but I meant multiple entries in the config file starting with "syntax.highlighter.application/xml.extensions="

Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2015

I don't believe that would work (but feel free to try it and see). I don't think we have any code for joining multiple of the same property name and I don't think Java properties support that in the first place.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events