31

Questions tagged c++-winrt (or any synonyms) should use C++ syntax highlighting automatically. Currently, no syntax highlighting is applied, and the workaround to manually add <!-- language: lang-cpp --> language hints or explicit language tags to code fences does get tedious.

C++/WinRT is implemented using standard C++, so all questions using that tag will use C++.

5
  • 13
    Wouldn't it be better to also add the C++ tag to the question? Commented Aug 24, 2018 at 19:40
  • 4
    @SombreroChicken: Adding a tag removes one of your available tag slots. Questions using C++/WinRT will be using C++. There really isn't much need for the redundant tag. Besides, that would also have the question show up for people filtering on the C++ tag, that aren't necessarily familiar with that library, or care about seeing those questions. Commented Aug 24, 2018 at 20:15
  • 5
    On the other hand, some people looking at the C++ tag may in fact care to see those questions. Commented Aug 25, 2018 at 0:47
  • 7
    @m69: Those that do can use boolean search operators (e.g. [c++] or [c++-winrt]). It's not the common case for users that don't know C++/WinRT to want to see questions about C++/WinRT. Regardless, if we get automatic C++ syntax highlighting for C++/CX (which isn't even C++), there is no reason to not get automatic C++ syntax highlighting for C++/WinRT (which indeed is C++). Commented Aug 25, 2018 at 6:34
  • 18
    Those who are interested in all things C++ can also favorite [c++*], @m69
    – Mat
    Commented Aug 25, 2018 at 6:35

1 Answer 1

5

Regardless of whether you (the reader, not specifically IInspectable) think questions should include or omit (a discussion that was had once again recently, a few years after this was originally posted), I think in general it's worth removing the dependency on the language tag in order for code samples to highlight correctly. I just experimented with it and looked at questions that may have other tags such as and , and many of them seem to continue to highlight their respective languages just fine. So this is done.

I did come across one particularly code-heavy question which, even after the change, highlight.js seems to think contains a mix of C++, C#, XAML, Rust, Dart, and uh... PHP (?), hence necessitating explicit hints anyway. But I'm sure that's just one of the many edge cases and spectacular failures of highlight.js's language detection heuristics which seem to be overall worse than Prettify's heuristics, and it has nothing to do with the change.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .