We should add a default syntax highlighting language for excel-formula. Although highlight.js supports the Excel formula language, Stack Exchange does not (and I doubt this will change soon as this is a pretty niche request compared to some of the other gaps). However, based on the question Syntax highlighting for Excel Formulae - language suggestions, it looks like there are a couple of existing languages we can use instead that do a good job, and so I propose we use one of those in the meantime.
A default tag is necessary because right now the auto-detector does a bad job of highlighting these.
Additional Context
At the time of writing
lang-swift
is the highest voted alternative, so that's what I would propose. However, if you think of anything better, go post an answer/vote on that question and we can iterate until we find something good. This question is not about any specific tag though, rather whether or not any default tag would be a good idea.There are roughly 10x more questions in excel than excel-formula. However, the latter is still the second most used Excel tag, so I think it's common enough to warrant its own syntax highlighting.
5,665 of the 27,056 (20.9%) excel-formula questions are also tagged with [vba]. Now if I remember correctly, when two or more tags on a question have default syntax highlighting, then Stack Overflow just uses auto-language detection.
- Some fraction of these questions will contain code - hopefully currently rendered correctly as VBA. Some fraction of that code will be mis-categorised as something else by the default automatic categoriser (hopefully the VBA/VB.NET categoriser is good and this will be small).
- Nevertheless this is a breaking change in terms of formatting for at least some of those 20% of questions which go from unambiguous
vba
highlighting to a mixture of tags (NB: this is only 2.8% of VBA questions that will be affected, but 20% of Excel-formula questions) - I think the benefit to the ~80% of the questions with no default syntax highlighting would outweigh the risk to the 20% going from VBA -> automatic detection. Some of those 20% may not even contain VBA code and are being mis-highlighted.
Incidentally I think worksheet-function should be synonymised with excel-formula and then both could benefit from the syntax highlighting. But that's a topic for another post