I know how to override the language chosen, and I believe that the chosen language is driven by the tags. I'm not asking for So if a question is tagged C#, and I want to post a SQL Server stored procedure, I use the following before my code block, and the syntax highlighting obeys the language I've specified:
<!-- language: lang-sql -->
My problem is: In some cases, the chosen language is incorrect (or perhaps it is
NULL). Here is a recent example:
You'll notice that my answer is the only one that has proper highlighting for SQL (since I've done the above), even though the question is tagged
sql-server-2008-r2 and every answer contains SQL code. The solution, I assume, is to add a more generic tag (like
sql) but do we really want to have to add such generic tags to all questions just to get the code editor to behave? I prefer to have questions tagged with the correct version of SQL Server, but don't think it needs to include
sql-server-2008-r2 for me to know that it's a question about SQL Server 2008 R2 and to expect that the code editor will understand I'm going to answer in SQL, not REXX.
For clarification, I think that if a question is tagged
sql-server* (and only that), the automatic choice for language should be SQL. Currently I believe that no language has been chosen because the algorithm looks for exact matches, and
sql-server-2008-r2 has not been added to the list. Why do I believe this? I just changed the question in question to
sql-server-2008-r2, and SQL is still the selected language. Which means it must have matched on the former. So I guess my question is in two parts:
- can we please add both
sql-server-2012to the set of tags that selects sql as the language?
- can we consider (or tell me why we shouldn't) a regex matching as well, so that we don't encounter the same issue when SQL Server 2015 is released?