The bundled SVN web client isn't doing code highlighting, and all leading whitespace is lost, both in file display and diff viewing modes. I tried changing the character encoding, but that wasn't the issue; I suspect perhaps something to do with the code highlighter (GeSHi?) perhaps not recognizing my .R source code?
The bundled Polarion web client uses a Java project named jhighlight in order to parse and decorate (CSS) the source files at the server side.
I've looked at the highlighter process and I've found it supports very few languges becasue the jhighliht project provides very few parser implementations:
Basically, there are four parsers: XML, Java, Cpp and Groovy. The latest is never used. And the other three are applied according the file extension:
extensions -> parser
.java -> Java
.html, .xml, .jsp -> XML
.c, .cpp, .h, hpp -> Cpp
The rest of the files will be displayed without any source code highlighting.
The jhighlight project seems to be discontinued since long time ago, hence, it should be replaced by another source code highlighter like Google's Code Prettify or any other similar project actively maintained and supporting lots of more languages.
It has already improved in the 4.1 version. I've replaced the original highlighter by the Google's Code Prettify which supports a lot of languages (including R, I think).
Please, add yourself as watcher of the plugin in order to be automatically notified when the 4.1 version is released.
I've published it as 4.0.2 version rather 4.1.0 as the current replacement of the syntax highlighter has not yet the expected quality. It means that it works in many cases, but unfortunatelly not for all the languages (I've tested against the R and it did not work :(.
all leading whitespace is lost
I've fixed a bug which miht resolve it (or maybe not). Please, let me know whether it is fixed in the 4.0.2 version.
All the configuration and indexed data will remain even if you un-install the plug-in.
I would say that the easiest way would by by clicking on the add-on Update button from the UPM.
Un-install it and install the latest version should also work without loosing any data, though un-install would not necessary whether you uses the UPM update option.
leading whitespace (indentation) is still lost.
Likely, the R editor uses some non expected character for the identation. Might you send me an R file? Or try to identify what would be the special charater used for identation? (Should not be '\t')
I can now see a smidge of R syntax highlighting,
The prettify library automatically tries to identify the language (taken the C language the highest preference). If the identification fails, then it applies a sort of generic highlighting, which might result in a mess of key words colorizing. To avoid this, it supports an option to set the language for highlight the file conent, but I coded it in a very basic way based on the file extension:
What is the extension of your R files?. I forced to the Google's code prettify library to use the R syntax when the file extension is ".r" and not ".R". Hence, if your extensions is uppercase (.R) then the prettify library would apply a sillier parser algorithm.
I think the problem is that I replaced '\t' tabs by ' ' (four times) but I left unchanged the ' ' space characters. Hence, I've also replaced all those spaces used to indent ' ' by ' '
Regarding the R files, I've directly set the file extension as lang option for the prettify library to force it to use the right extensions rather than let it to figure out this. Thus the .R and .r extensions should work in the same way.
Maybe this might solve some of your issues in the 4.0.3 version. Please, try it and let me know how it works for you. (I'm very sceptic regarding the R syntax highlighting)
R highlighting is OK now but not great
For sure, I dislike the result of the prettify library for any languages. Even the old jhighlight tool was much better, though for fewer languages.
On the other hand, the integration of the prettify library is quite straighforward, specially for the way how the Polarion Web Client for Subversion handles the file content which is never send back to the client browser as raw content. This made very complex integrating other alternatives like the syntaxhighlighter from Mr. Alex Gorbatchev, which never worked well during the tests.
However, I think the major problem might be partially resolved by changing the css style to something clearer/nicer, using bold and colorizing similar to Eclipse, for instance. The default highlighting is almost impossible to distinguish in my laptop in addition to ugly. But the main work is done.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG