syntax highlighting - enhanceCSharpSyntax(Visual Studio 2017, TextMate) -


visual studio 2017 supports textmate grammar via visual studio extension textmate grammar. process, documented here, consist of creating folder structure under %userprofile%\.vs\extensions , creating .json file grammar (.plist seems working).

i want enhance syntax highlighting in vs2017 csharp. example, if write sql query in verbatim string, use syntax highlighting sql. textmate allows define rules embeded language, should possible.

thanks this article, came textmate grammar json

{     "name": "embeded sql",     "scopename": "source.cs.embeded-sql",     "filetypes": [         "cs"     ],     "patterns": [         {                "begin": "\\bsql\\b.*\"", // match double quoted string preceding sql, 'var sql = "select...' or 'dbexecute(/*sql*/"select...'             "end": "^\";", // ends double quote , apostrophe             "contentname": "source.sql", // scope content between <begin> , <end> 'source.sql'             "patterns": [                 { "include": "source.sql" } // include sql patterns             ]         }     ] } 

but not work. problems assume:

  1. csharp grammar in vs2017 not written in textmate (?), extending way impossible,
  2. you cannot append grammar this, because opened file using 1 grammar (csharp) , cannot use both grammars (?), must either edit current csharp.tmlanguage or use grammar injection -- tried, did not work,

is there way extend csharp syntax in vs2017 way want?

appendix 1: visual studio code seems using textmate csharp language, source

appendix 2: json should valid, wrote according textmate grammar schema


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -