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.
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.