Skip to main content
9 events
when toggle format what by license comment
Feb 15, 2021 at 5:57 comment added tripleee Would it perhaps make sense to load the Groovy highlighter e.g. for users who are subscribed to the groovy tag? I'm guessing those are probably more or less the only ones who are going to care passionately about highlighting for this language.
Feb 15, 2021 at 5:49 comment added tripleee Follow-up suggestion: Stop guessing/auto-detecting a language when you KNOW it will be incorrect
Oct 21, 2020 at 5:30 comment added kriegaex Sorry, no. Java and Groovy syntaxes are not the same. Java is just a crutch, workaround. The alias would be better than nothing temporarily, but there is quite some Groovy stuff that is not highlighted correctly in Java mode. If someone invests effort and time here, I guess it should be done right. Also, whenever Groovy highlighting gets fixes, updates or improvements, SO users would automatically profit from it.
Oct 21, 2020 at 5:24 comment added Josh Goebel @kriegaex what SO needs to do if Java is a decent fit is just map groovy to Java. Highlight.js makes this trivial to do with aliases. This is also future proof in that if stack overflow adds groovy highlighting in the future then they can just change the mapping and the new highlighting will happen. Letting auto detect randomly pick a language every time when it’s known the language is missing is going to result in terrible and very inconsistent highlighting. This is very bad behavior.
Oct 20, 2020 at 2:04 comment added kriegaex After watching this for a while, I noticed that highlight.js seems to guess wrong about which language to highlight more often than Prettify, especially for short code snippets. So for now I manually select Java as the target language, which is kind of suboptimal, like I said. It also means that snippets using java instead of lang-groovy will not automatically be highlighted correctly after maybe in the future Groovy will be supported officially. These facts make it even more plausible to add Groovy support for SO syntax highlighting. Spock, Geb and Grails are quite popular tools.
Oct 17, 2020 at 21:23 comment added Josh Goebel Just FYI: our Groovy grammar currently weighs in at 3387 bytes uncompressed if SO chose to add it. Pretty small.
Sep 26, 2020 at 3:04 comment added kriegaex Another thought: Auto-detection might work for Groovy because the highlighter detects Java. But there are some syntactic differences, so dedicated Groovy support would be helpful for the big Groovy community on SO.
Sep 26, 2020 at 2:51 comment added kriegaex Thank you so much. I can see that ```lang-groovy is now working, but not ```groovy. Actually in the past few years I was amazed at how good this worked and even for short and ambiguous snippets did not mess up highlighting due to auto-detection. Ben, ist there any chance to get Groovy supported officially? This was my very first question on Meta, I would not know how to go about making a feature request but also would not be surprised if someone already created one long before me. Would it be a big effort to support it, given the fact that highlight.js already does (as did Prettify)?
Sep 25, 2020 at 19:38 history answered Ben KellyStaffMod CC BY-SA 4.0