# Default code-prettify highlighting for C# is incorrect

Recently I had quite a few edits to include the correct syntax-highlighting for C# questions:

<!-- language: lang-csharp -->


That's needless editing for a thing that could also be done via machine.

I suggest defaulting to lang-csharp for questions asked with .

Update:

Example question:

The above question highlights differently with lang-cs vs. lang-csharp (with lang-csharp being superior).

Issues:

1. lang-csharp is not documented to exist
2. it is not available in the tag-wiki syntax editor

I looked into what does the SE version of prettify.js actually do. Turns out, its list of C# keywords starts like this (only with minified names):

var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
"as,base,by,checked,decimal,delegate,descending,dynamic,event," + …


This list is from an old version of prettify, the current version starts like this (the relevant change was made in June 2013):

var CSHARP_KEYWORDS = [COMMON_KEYWORDS,
"abstract,as,base,bool,by,byte,checked,decimal,delegate,descending," + …


The reason why lang-csharp looks like it works, is because that's considered an unknown language and so it uses ALL_KEYWORDS, which includes bool through CPP_KEYWORDS. This also means that something like lang-nonsense would have worked the same way.

The fix should be to make SE update prettify to its current version.

lang-csharp is not available as a syntax for tags:

The current language for is lang-cs which is.... from here: C# ...

Are you sure you have the syntax right?

UPDATE:

Example question:

The above question highlights differently with lang-cs vs. lang-csharp (with lang-csharp being superior).

Issues:

1. lang-csharp is not documented to exist
2. it is not available in the tag-wiki syntax editor
• relatively sure. For one I know that the current default syntax highlight doesn't go for bool, but lang-csharp does. Aug 14 '14 at 14:51
• For the record I edited this question Aug 14 '14 at 15:01
• The code highlighter is set to the "default" on all posts - if there is an override, it will use that (if it can't recognize a valid override). Which is a heuristic best effort highlight.
– Oded
Aug 14 '14 at 15:38
• @Oded - FYI: meta.codereview.stackexchange.com/a/2279/31503 - lang-cs is out of date Aug 15 '14 at 11:05
• @rolfl - thanks for that. Will look getting it updated.
– Oded
Aug 15 '14 at 11:08
• @rolfl - latest release is from March 2013 and is the one we are using. The changes highlighted are from June 2013 and have seen no release... yet.
– Oded
Aug 15 '14 at 15:35