Stash Custom syntax highlighting

I would like to enable syntax highlighting for CFML (ColdFusion Markup language) in Stash. This is XML based and therefore fits into the XML Syntax highlighting scheme. Similar thing is already done in Fisheye/Crucible (per default by Atlassian).

The ColdFusion file extensions that we are using are .cfm and .cfc

I tried to set this up by following the advices from

https://confluence.atlassian.com/display/STASHKB/Configuring+syntax+highlighting+for+file+extensions

and https://jira.atlassian.com/browse/STASH-2694

(basically the same)

But none of the changes completely worked for us.

I wanted to change the following line in the source-view.js like this:

Before:

xml : { exts : ['xml', 'html', 'htm', 'xhtml', 'shtml', 'shtm', 'jsp', 'jspf', 'tag', 'jspx', 'dtd', 'xsd', 'xsl', 'xslt'], exes : []}

After:

xml : { exts : ['xml', 'html', 'htm', 'xhtml', 'shtml', 'shtm', 'jsp', 'jspf', 'tag', 'jspx', 'dtd', 'xsd', 'xsl', 'xslt', 'cfm', 'cfc'], exes : []}

It looks a little strange that the information on the pages referenced above do not fit the actual environment. Maybe these are outdated?

The source-view.js file is not as described located in

<STASH_INSTALL_DIR>/webapps/ROOT/static/feature/file-content/source-view/source-view.js

In our installation (I first tried Stash 1.3.0 and then 1.3.1) it is here:

<STASH_INSTALL_DIR>/atlassian-stash/static/feature/file-content/source-view/source-view.js

There is also a minified version (source-view-min.js) of the file in the same folder, which I edited as well.

In the KB article there is a cache referenced that needs to be deleted:

<STASH_HOME>/caches/webresources

This cache does not exist in our installation. Instead the websources folder is located in

<STASH_HOME>/tmp/webresources

Deleting the contents of it, restarting Stash and clearing the browser cache worked.

However what does not work is to get the diff view to show the code with syntax highlighting. Neither in the diff to previous nor within a pull request.

So it would be good to get info on how to customize the syntax highlighting file extensions for those as well.

It would also be appreciated if the KB article gets updated.

1 answer

1 accepted

This widget could not be displayed.

Hi Jan,

However what does not work is to get the diff view to show the code with syntax highlighting. Neither in the diff to previous nor within a pull request.

Please refer to the feature request https://jira.atlassian.com/browse/STASH-2823

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

151 views 16 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you