github-linguist 5.3.3 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (460) hide show
  1. checksums.yaml +4 -4
  2. data/bin/git-linguist +5 -2
  3. data/ext/linguist/linguist.c +18 -7
  4. data/grammars/annotation.liquidhaskell.haskell.json +969 -862
  5. data/grammars/config.xcompose.json +22 -25
  6. data/grammars/file.lasso.json +296 -309
  7. data/grammars/hint.haskell.json +867 -766
  8. data/grammars/hint.message.haskell.json +867 -766
  9. data/grammars/hint.type.haskell.json +867 -766
  10. data/grammars/objdump.x86asm.json +20 -24
  11. data/grammars/source.Kotlin.json +220 -225
  12. data/grammars/source.LS.json +36 -55
  13. data/grammars/source.MCPOST.json +24 -38
  14. data/grammars/source.MOD.json +26 -41
  15. data/grammars/source.SASLog.json +9 -16
  16. data/grammars/source.abap.json +48 -56
  17. data/grammars/source.abl.json +8 -14
  18. data/grammars/source.abnf.json +88 -98
  19. data/grammars/source.actionscript.3.json +398 -429
  20. data/grammars/source.acucobol.json +5 -8
  21. data/grammars/source.ada.json +46 -53
  22. data/grammars/source.afm.json +548 -554
  23. data/grammars/source.agc.json +34 -37
  24. data/grammars/source.agda.json +79 -91
  25. data/grammars/source.ahk.json +62 -66
  26. data/grammars/source.alloy.json +16 -20
  27. data/grammars/source.ampl.json +41 -47
  28. data/grammars/source.angelscript.json +71 -80
  29. data/grammars/source.antlr.json +131 -136
  30. data/grammars/source.apache-config.json +93 -99
  31. data/grammars/source.apache-config.mod_perl.json +19 -24
  32. data/grammars/source.apl.json +1038 -1029
  33. data/grammars/source.applescript.json +501 -523
  34. data/grammars/source.apt.json +9 -16
  35. data/grammars/source.asn.json +27 -31
  36. data/grammars/source.asp.json +61 -67
  37. data/grammars/source.aspectj.json +385 -391
  38. data/grammars/source.assembly.json +49 -55
  39. data/grammars/source.ats.json +45 -121
  40. data/grammars/source.autoit.json +64 -69
  41. data/grammars/source.awk.json +172 -176
  42. data/grammars/source.ballerina.json +48 -395
  43. data/grammars/source.batchfile.json +269 -269
  44. data/grammars/source.befunge.json +17 -21
  45. data/grammars/source.bf.json +5 -11
  46. data/grammars/source.bison.json +10 -14
  47. data/grammars/source.blitzmax.json +300 -305
  48. data/grammars/source.boo.json +189 -193
  49. data/grammars/source.brightauthorproject.json +8 -13
  50. data/grammars/source.brightscript.json +37 -47
  51. data/grammars/source.bro.json +134 -140
  52. data/grammars/source.bsl.json +152 -193
  53. data/grammars/source.bsv.json +96 -102
  54. data/grammars/source.c++.json +176 -193
  55. data/grammars/source.c++.qt.json +13 -21
  56. data/grammars/source.c.ec.json +15 -21
  57. data/grammars/source.c.json +237 -251
  58. data/grammars/source.c.platform.json +153 -159
  59. data/grammars/source.c2hs.json +3 -6
  60. data/grammars/source.cabal.json +17 -20
  61. data/grammars/source.cache.cmake.json +18 -23
  62. data/grammars/source.cake.json +4 -7
  63. data/grammars/source.camlp4.ocaml.json +24 -27
  64. data/grammars/source.capnp.json +33 -38
  65. data/grammars/source.ceylon.json +44 -50
  66. data/grammars/source.cfscript.cfc.json +78 -86
  67. data/grammars/source.cfscript.json +513 -520
  68. data/grammars/source.changelogs.rpm-spec.json +8 -16
  69. data/grammars/source.chapel.json +109 -87
  70. data/grammars/source.cirru.json +25 -30
  71. data/grammars/source.clarion.json +41 -54
  72. data/grammars/source.clean.json +90 -95
  73. data/grammars/source.click.json +25 -28
  74. data/grammars/source.clips.json +10 -23
  75. data/grammars/source.clojure.json +151 -168
  76. data/grammars/source.cm.json +14 -19
  77. data/grammars/source.cmake.json +53 -61
  78. data/grammars/source.cobol.json +165 -180
  79. data/grammars/source.coffee.json +454 -462
  80. data/grammars/source.cool.json +36 -43
  81. data/grammars/source.coq.json +17 -21
  82. data/grammars/source.crystal.json +889 -983
  83. data/grammars/source.cs.json +739 -740
  84. data/grammars/source.csound-document.json +69 -73
  85. data/grammars/source.csound-score.json +52 -55
  86. data/grammars/source.csound.json +167 -171
  87. data/grammars/source.css.json +683 -688
  88. data/grammars/source.css.less.json +211 -511
  89. data/grammars/source.css.mss.json +94 -101
  90. data/grammars/source.css.postcss.sugarss.json +260 -0
  91. data/grammars/source.csx.json +4 -7
  92. data/grammars/source.cuda-c++.json +47 -81
  93. data/grammars/source.cwl.json +103 -0
  94. data/grammars/source.cython.json +536 -582
  95. data/grammars/source.d.json +243 -252
  96. data/grammars/source.dart.json +161 -166
  97. data/grammars/source.data-weave.json +901 -905
  98. data/grammars/source.desktop.json +29 -33
  99. data/grammars/source.diff.json +43 -52
  100. data/grammars/source.disasm.json +15 -16
  101. data/grammars/source.ditroff.desc.json +73 -84
  102. data/grammars/source.ditroff.json +60 -61
  103. data/grammars/source.dm.json +202 -213
  104. data/grammars/source.dmf.json +44 -47
  105. data/grammars/source.dockerfile.json +29 -34
  106. data/grammars/source.dot.json +46 -55
  107. data/grammars/source.dylan.json +63 -68
  108. data/grammars/source.ebnf.json +55 -62
  109. data/grammars/source.eiffel.json +57 -62
  110. data/grammars/source.elixir.json +321 -366
  111. data/grammars/source.emacs.lisp.json +458 -249
  112. data/grammars/source.erazor.json +49 -57
  113. data/grammars/source.erlang.json +508 -515
  114. data/grammars/source.essl.json +17 -30
  115. data/grammars/source.factor.json +85 -91
  116. data/grammars/source.fan.json +92 -96
  117. data/grammars/source.fancy.json +93 -118
  118. data/grammars/source.fish.json +74 -98
  119. data/grammars/source.fontforge.json +142 -146
  120. data/grammars/source.forth.json +42 -57
  121. data/grammars/source.fortran.json +193 -231
  122. data/grammars/source.fortran.modern.json +77 -103
  123. data/grammars/source.fsharp.fsi.json +1 -6
  124. data/grammars/source.fsharp.fsl.json +1 -6
  125. data/grammars/source.fsharp.fsx.json +1 -6
  126. data/grammars/source.fsharp.json +148 -153
  127. data/grammars/source.gap.json +60 -70
  128. data/grammars/source.gcode.json +9 -16
  129. data/grammars/source.gdb.json +63 -79
  130. data/grammars/source.gdb.session.json +27 -28
  131. data/grammars/source.gdbregs.json +7 -8
  132. data/grammars/source.gdscript.json +92 -96
  133. data/grammars/source.gerber.json +38 -56
  134. data/grammars/source.gfm.json +447 -462
  135. data/grammars/source.glsl.json +58 -83
  136. data/grammars/source.gn.json +188 -193
  137. data/grammars/source.gnuplot.json +104 -120
  138. data/grammars/source.go.json +169 -181
  139. data/grammars/source.golo.json +82 -87
  140. data/grammars/source.gosu.2.json +58 -68
  141. data/grammars/source.grace.json +266 -270
  142. data/grammars/source.graphql.json +586 -596
  143. data/grammars/source.groovy.gradle.json +18 -22
  144. data/grammars/source.groovy.json +422 -433
  145. data/grammars/source.harbour.json +129 -173
  146. data/grammars/source.haskell.json +871 -772
  147. data/grammars/source.haxe.2.json +402 -413
  148. data/grammars/source.hlsl.json +6 -16
  149. data/grammars/source.hsc2hs.json +1 -4
  150. data/grammars/source.hsig.json +871 -770
  151. data/grammars/source.hss.1.json +122 -144
  152. data/grammars/source.httpspec.json +119 -123
  153. data/grammars/source.hxml.json +8 -15
  154. data/grammars/source.ideal.json +125 -125
  155. data/grammars/source.idl-dlm.json +25 -32
  156. data/grammars/source.idl.json +59 -80
  157. data/grammars/source.idris.json +171 -185
  158. data/grammars/source.inform7.json +117 -121
  159. data/grammars/source.ini.json +37 -43
  160. data/grammars/source.io.json +65 -73
  161. data/grammars/source.ioke.json +72 -78
  162. data/grammars/source.isabelle.root.json +26 -30
  163. data/grammars/source.isabelle.theory.json +46 -50
  164. data/grammars/source.j.json +18 -21
  165. data/grammars/source.jasmin.json +45 -50
  166. data/grammars/source.java-properties.json +31 -41
  167. data/grammars/source.java.json +333 -342
  168. data/grammars/source.jcl.json +15 -18
  169. data/grammars/source.jflex.json +166 -172
  170. data/grammars/source.jison.json +331 -334
  171. data/grammars/source.jisonlex-injection.json +1 -2
  172. data/grammars/source.jisonlex.json +148 -151
  173. data/grammars/source.jolie.json +37 -43
  174. data/grammars/source.jq.json +80 -87
  175. data/grammars/source.js.json +798 -818
  176. data/grammars/source.js.jsx.json +2115 -2225
  177. data/grammars/source.js.objj.json +167 -172
  178. data/grammars/source.js.regexp.json +50 -50
  179. data/grammars/source.js.regexp.replacement.json +7 -7
  180. data/grammars/source.jsdoc.json +94 -94
  181. data/grammars/source.json.json +61 -71
  182. data/grammars/source.julia.console.json +5 -6
  183. data/grammars/source.julia.json +237 -234
  184. data/grammars/source.lean.json +55 -67
  185. data/grammars/source.lid.json +6 -10
  186. data/grammars/source.lilypond.json +181 -195
  187. data/grammars/source.lisp.json +40 -50
  188. data/grammars/source.litcoffee.json +169 -183
  189. data/grammars/source.livescript.json +207 -220
  190. data/grammars/source.llvm.json +28 -38
  191. data/grammars/source.logos.json +7 -14
  192. data/grammars/source.logtalk.json +136 -141
  193. data/grammars/source.loomscript.json +77 -83
  194. data/grammars/source.lsl.json +90 -106
  195. data/grammars/source.lua.json +100 -109
  196. data/grammars/source.makefile.json +181 -188
  197. data/grammars/source.makegen.json +3 -7
  198. data/grammars/source.mask.json +260 -265
  199. data/grammars/source.mata.json +38 -46
  200. data/grammars/source.mathematica.json +155 -167
  201. data/grammars/source.matlab.json +407 -684
  202. data/grammars/source.maxscript.json +293 -281
  203. data/grammars/source.mercury.json +179 -184
  204. data/grammars/source.meson.json +52 -58
  205. data/grammars/source.meta-info.json +64 -74
  206. data/grammars/source.ml.json +107 -113
  207. data/grammars/source.modelica.json +51 -59
  208. data/grammars/source.modula2.json +33 -42
  209. data/grammars/source.monkey.json +234 -241
  210. data/grammars/source.moonscript.json +51 -56
  211. data/grammars/source.mql5.json +74 -101
  212. data/grammars/source.mupad.json +30 -72
  213. data/grammars/source.ncl.json +1 -14
  214. data/grammars/source.ne.json +39 -42
  215. data/grammars/source.nemerle.json +58 -63
  216. data/grammars/source.nesc.json +9 -15
  217. data/grammars/source.netlinx.erb.json +13 -25
  218. data/grammars/source.netlinx.json +231 -292
  219. data/grammars/source.nextflow-groovy.json +1360 -0
  220. data/grammars/source.nextflow.json +74 -0
  221. data/grammars/source.nginx.json +274 -287
  222. data/grammars/source.nim.json +442 -483
  223. data/grammars/source.nim_filter.json +6 -26
  224. data/grammars/source.nimcfg.json +38 -51
  225. data/grammars/source.ninja.json +64 -70
  226. data/grammars/source.nit.json +60 -64
  227. data/grammars/source.nix.json +269 -273
  228. data/grammars/source.nmml.json +31 -37
  229. data/grammars/source.nsis.json +66 -72
  230. data/grammars/source.nu.json +129 -139
  231. data/grammars/source.nut.json +129 -133
  232. data/grammars/source.objc++.json +3 -10
  233. data/grammars/source.objc.json +303 -314
  234. data/grammars/source.objc.platform.json +145 -151
  235. data/grammars/source.ocaml.json +506 -514
  236. data/grammars/source.ocamllex.json +108 -115
  237. data/grammars/source.ocamlyacc.json +116 -123
  238. data/grammars/source.ooc.json +148 -155
  239. data/grammars/source.opa.json +39 -49
  240. data/grammars/source.opal.json +84 -89
  241. data/grammars/source.opalsysdefs.json +9 -13
  242. data/grammars/source.opencobol.json +22 -25
  243. data/grammars/source.opentype.json +148 -152
  244. data/grammars/source.ox.json +36 -44
  245. data/grammars/source.oz.json +31 -38
  246. data/grammars/source.p4.json +49 -59
  247. data/grammars/source.pan.json +273 -278
  248. data/grammars/source.papyrus.skyrim.json +705 -781
  249. data/grammars/source.parrot.pir.json +59 -65
  250. data/grammars/source.pascal.json +54 -61
  251. data/grammars/source.pawn.json +835 -849
  252. data/grammars/source.pcb.board.json +153 -158
  253. data/grammars/source.pcb.schematic.json +134 -138
  254. data/grammars/source.pcb.sexp.json +64 -74
  255. data/grammars/source.pep8.json +28 -32
  256. data/grammars/source.perl.6.json +83 -92
  257. data/grammars/source.perl.json +711 -737
  258. data/grammars/source.perl6fe.json +1204 -1218
  259. data/grammars/source.php.zephir.json +80 -89
  260. data/grammars/source.pic.json +137 -142
  261. data/grammars/source.pig_latin.json +76 -80
  262. data/grammars/source.pike.json +23 -36
  263. data/grammars/source.po.json +74 -84
  264. data/grammars/source.pogoscript.json +23 -29
  265. data/grammars/source.pony.json +98 -108
  266. data/grammars/source.postcss.json +370 -0
  267. data/grammars/source.postscript.json +88 -97
  268. data/grammars/source.pov-ray sdl.json +36 -42
  269. data/grammars/source.powershell.json +175 -197
  270. data/grammars/source.processing.json +236 -249
  271. data/grammars/source.prolog.eclipse.json +33 -38
  272. data/grammars/source.prolog.json +66 -72
  273. data/grammars/source.protobuf.json +88 -94
  274. data/grammars/source.puppet.json +144 -151
  275. data/grammars/source.purescript.json +268 -289
  276. data/grammars/source.pyjade.json +256 -281
  277. data/grammars/source.python.django.json +13 -18
  278. data/grammars/source.python.json +3319 -3367
  279. data/grammars/source.python.salt.json +3 -7
  280. data/grammars/source.qmake.json +83 -90
  281. data/grammars/source.qml.json +57 -78
  282. data/grammars/source.quoting.perl6fe.json +666 -669
  283. data/grammars/source.r.json +75 -84
  284. data/grammars/source.racket.json +17 -38
  285. data/grammars/source.rascal.json +77 -80
  286. data/grammars/source.reason.hover.type.json +1 -1
  287. data/grammars/source.reason.json +1025 -1080
  288. data/grammars/source.rebol.json +167 -177
  289. data/grammars/source.red.json +169 -177
  290. data/grammars/source.regexp.babel.json +74 -77
  291. data/grammars/source.regexp.extended.json +4 -5
  292. data/grammars/source.regexp.json +260 -264
  293. data/grammars/source.regexp.perl6fe.json +108 -111
  294. data/grammars/source.regexp.python.json +210 -215
  295. data/grammars/source.regexp.spin.json +63 -72
  296. data/grammars/source.renpy.json +617 -687
  297. data/grammars/source.rexx.json +25 -32
  298. data/grammars/source.ring.json +84 -114
  299. data/grammars/source.rpm-spec.json +392 -401
  300. data/grammars/source.ruby.gemfile.json +9 -12
  301. data/grammars/source.ruby.json +862 -952
  302. data/grammars/source.ruby.rspec.cucumber.steps.json +90 -103
  303. data/grammars/source.rust.json +223 -281
  304. data/grammars/source.sas.json +88 -105
  305. data/grammars/source.sass.json +100 -108
  306. data/grammars/source.sbt.json +16 -23
  307. data/grammars/source.scad.json +60 -67
  308. data/grammars/source.scala.json +215 -228
  309. data/grammars/source.scaml.json +120 -135
  310. data/grammars/source.scheme.json +119 -136
  311. data/grammars/source.scilab.json +40 -47
  312. data/grammars/source.scss.json +369 -403
  313. data/grammars/source.sdbl.json +14 -25
  314. data/grammars/source.shaderlab.json +24 -27
  315. data/grammars/source.shell.json +409 -440
  316. data/grammars/source.shen.json +75 -94
  317. data/grammars/source.smali.json +232 -293
  318. data/grammars/source.smalltalk.json +60 -75
  319. data/grammars/source.smt.json +67 -82
  320. data/grammars/source.solidity.json +35 -54
  321. data/grammars/source.sp.json +40 -45
  322. data/grammars/source.sparql.json +3 -8
  323. data/grammars/source.spin.json +277 -297
  324. data/grammars/source.sqf.json +34 -44
  325. data/grammars/source.sql.json +142 -156
  326. data/grammars/source.stan.json +201 -160
  327. data/grammars/source.stata.json +57 -68
  328. data/grammars/source.strings.json +26 -30
  329. data/grammars/source.stylus.json +558 -565
  330. data/grammars/source.supercollider.json +33 -40
  331. data/grammars/source.swift.json +999 -1077
  332. data/grammars/source.systemverilog.json +351 -365
  333. data/grammars/source.tcl.json +77 -94
  334. data/grammars/source.tea.json +61 -67
  335. data/grammars/source.terra.json +25 -32
  336. data/grammars/source.terraform.json +68 -88
  337. data/grammars/source.thrift.json +300 -306
  338. data/grammars/source.tl.json +112 -117
  339. data/grammars/source.tla.json +65 -69
  340. data/grammars/source.toc.json +21 -25
  341. data/grammars/source.toml.json +117 -122
  342. data/grammars/source.ts.json +2838 -2774
  343. data/grammars/source.tsx.json +180 -184
  344. data/grammars/source.turing.json +970 -974
  345. data/grammars/source.turtle.json +124 -140
  346. data/grammars/source.txl.json +23 -37
  347. data/grammars/source.ucfconstraints.json +16 -21
  348. data/grammars/source.ur.json +15 -27
  349. data/grammars/source.vala.json +221 -235
  350. data/grammars/source.varnish.vcl.json +117 -129
  351. data/grammars/source.vbnet.json +69 -106
  352. data/grammars/source.verilog.json +101 -107
  353. data/grammars/source.vhdl.json +437 -445
  354. data/grammars/source.viml.json +540 -550
  355. data/grammars/source.wavefront.mtl.json +274 -277
  356. data/grammars/source.wavefront.obj.json +781 -784
  357. data/grammars/source.wdl.json +66 -46
  358. data/grammars/source.webassembly.json +97 -102
  359. data/grammars/source.webidl.json +311 -326
  360. data/grammars/source.x10.json +28 -32
  361. data/grammars/source.x86asm.json +21 -26
  362. data/grammars/source.xc.json +164 -172
  363. data/grammars/source.xq.json +81 -92
  364. data/grammars/source.xtend.json +199 -208
  365. data/grammars/source.yaml-ext.json +118 -124
  366. data/grammars/source.yaml.json +155 -174
  367. data/grammars/source.yaml.salt.json +113 -116
  368. data/grammars/source.yang.json +10 -13
  369. data/grammars/source.yara.json +98 -0
  370. data/grammars/text.bibtex.json +95 -100
  371. data/grammars/text.cfml.basic.json +403 -404
  372. data/grammars/text.elixir.json +18 -23
  373. data/grammars/text.error-list.json +15 -16
  374. data/grammars/text.find-refs.json +487 -488
  375. data/grammars/text.gherkin.feature.json +45 -53
  376. data/grammars/text.haml.json +176 -189
  377. data/grammars/text.hamlc.json +82 -88
  378. data/grammars/text.html.abl.json +16 -21
  379. data/grammars/text.html.asciidoc.json +139 -153
  380. data/grammars/text.html.asdoc.json +145 -155
  381. data/grammars/text.html.asp.json +23 -28
  382. data/grammars/text.html.basic.json +323 -338
  383. data/grammars/text.html.cfm.json +316 -325
  384. data/grammars/text.html.creole.json +177 -189
  385. data/grammars/text.html.django.json +27 -33
  386. data/grammars/text.html.ecr.json +21 -25
  387. data/grammars/text.html.elixir.json +3 -9
  388. data/grammars/text.html.erb.json +81 -85
  389. data/grammars/text.html.erlang.yaws.json +24 -29
  390. data/grammars/text.html.factor.json +5 -11
  391. data/grammars/text.html.ftl.json +16 -25
  392. data/grammars/text.html.handlebars.json +579 -598
  393. data/grammars/text.html.javadoc.json +426 -0
  394. data/grammars/text.html.js.json +11 -17
  395. data/grammars/text.html.jsp.json +377 -384
  396. data/grammars/text.html.liquid.json +8 -18
  397. data/grammars/text.html.mako.json +257 -275
  398. data/grammars/text.html.markdown.source.gfm.apib.json +419 -427
  399. data/grammars/text.html.markdown.source.gfm.mson.json +405 -414
  400. data/grammars/text.html.mediawiki.json +318 -344
  401. data/grammars/text.html.php.blade.json +2134 -2140
  402. data/grammars/text.html.php.json +980 -1013
  403. data/grammars/text.html.slash.json +101 -107
  404. data/grammars/text.html.smarty.json +75 -83
  405. data/grammars/text.html.soy.json +250 -253
  406. data/grammars/text.html.ssp.json +18 -24
  407. data/grammars/text.html.tcl.json +17 -24
  408. data/grammars/text.html.twig.json +712 -718
  409. data/grammars/text.idl-idldoc.json +5 -9
  410. data/grammars/text.jade.json +213 -235
  411. data/grammars/text.junit-test-report.json +25 -28
  412. data/grammars/text.log.latex.json +44 -46
  413. data/grammars/text.marko.json +370 -401
  414. data/grammars/text.python.console.json +3 -7
  415. data/grammars/text.python.traceback.json +2 -5
  416. data/grammars/text.rdoc.json +15 -19
  417. data/grammars/text.restructuredtext.clean.json +8 -11
  418. data/grammars/text.restructuredtext.json +886 -873
  419. data/grammars/text.robot.json +26 -36
  420. data/grammars/text.roff.json +2852 -2915
  421. data/grammars/text.runoff.json +56 -69
  422. data/grammars/text.sfd.json +151 -155
  423. data/grammars/text.shell-session.json +5 -8
  424. data/grammars/text.slim.json +184 -210
  425. data/grammars/text.srt.json +54 -57
  426. data/grammars/text.tex.json +98 -105
  427. data/grammars/text.tex.latex.beamer.json +14 -20
  428. data/grammars/text.tex.latex.haskell.json +883 -782
  429. data/grammars/text.tex.latex.json +281 -291
  430. data/grammars/text.tex.latex.memoir.json +39 -46
  431. data/grammars/text.tex.latex.rd.json +32 -38
  432. data/grammars/text.xml.ant.json +62 -69
  433. data/grammars/text.xml.flex-config.json +1009 -1013
  434. data/grammars/text.xml.genshi.json +10 -16
  435. data/grammars/text.xml.json +117 -130
  436. data/grammars/text.xml.pom.json +235 -240
  437. data/grammars/text.xml.xsl.json +31 -37
  438. data/grammars/text.zone_file.json +24 -29
  439. data/lib/linguist/blob.rb +10 -1
  440. data/lib/linguist/blob_helper.rb +4 -1
  441. data/lib/linguist/file_blob.rb +5 -0
  442. data/lib/linguist/generated.rb +16 -0
  443. data/lib/linguist/heuristics.rb +23 -11
  444. data/lib/linguist/language.rb +3 -6
  445. data/lib/linguist/languages.json +1 -1
  446. data/lib/linguist/languages.yml +74 -12
  447. data/lib/linguist/lazy_blob.rb +15 -1
  448. data/lib/linguist/linguist.bundle +0 -0
  449. data/lib/linguist/samples.json +1666 -3381
  450. data/lib/linguist/shebang.rb +2 -0
  451. data/lib/linguist/strategy/modeline.rb +2 -0
  452. data/lib/linguist/vendor.yml +5 -6
  453. data/lib/linguist/version.rb +1 -1
  454. metadata +12 -11
  455. data/grammars/source.elm.json +0 -381
  456. data/grammars/source.nant-build.json +0 -86
  457. data/grammars/source.octave.json +0 -451
  458. data/grammars/text.html.mediawiki.elm-build-output.json +0 -111
  459. data/grammars/text.html.mediawiki.elm-documentation.json +0 -22
  460. data/grammars/text.html.vue.json +0 -936
@@ -1,11 +1,6 @@
1
1
  {
2
- "scopeName": "source.cs",
3
2
  "name": "C#",
4
- "fileTypes": [
5
- "cs"
6
- ],
7
- "foldingStartMarker": "^\\s*#\\s*region|^\\s*/\\*|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))",
8
- "foldingStopMarker": "^\\s*#\\s*endregion|^\\s*\\*/|^\\s*\\}",
3
+ "scopeName": "source.cs",
9
4
  "patterns": [
10
5
  {
11
6
  "include": "#attribute"
@@ -24,358 +19,194 @@
24
19
  }
25
20
  ],
26
21
  "repository": {
27
- "using": {
28
- "begin": "\\s*\\b(using)\\b",
29
- "beginCaptures": {
30
- "1": {
31
- "name": "keyword.other.using.cs"
32
- }
33
- },
34
- "end": "\\s*(?:$|;)",
22
+ "attribute": {
23
+ "name": "meta.annotation.cs",
24
+ "begin": "\\[",
25
+ "end": "\\]",
35
26
  "patterns": [
36
27
  {
37
- "include": "#comments"
28
+ "include": "#constants"
38
29
  },
39
30
  {
40
- "match": "\\s*\\b(static)\\b",
41
- "captures": {
42
- "1": {
43
- "name": "keyword.other.static.cs"
44
- }
45
- }
31
+ "include": "#preprocessor"
46
32
  },
47
33
  {
48
- "begin": "(\\w+)(?=.*\\=)",
49
- "beginCaptures": {
50
- "1": {
51
- "name": "entity.name.alias.namespace.cs"
52
- }
53
- },
54
- "patterns": [
55
- {
56
- "include": "#comments"
57
- },
58
- {
59
- "begin": "\\s*\\=(?=[\\w\\s/])",
60
- "patterns": [
61
- {
62
- "include": "#comments"
63
- },
64
- {
65
- "match": "[\\w.]+",
66
- "name": "entity.name.type.namespace.cs"
67
- }
68
- ],
69
- "end": "(?=;)"
70
- }
71
- ],
72
- "end": ";"
34
+ "include": "#builtinTypes"
73
35
  },
74
36
  {
75
- "match": "[\\w.]+",
76
- "name": "entity.name.type.namespace.cs"
37
+ "include": "#comments"
77
38
  }
78
39
  ]
79
40
  },
80
- "namespace": {
81
- "begin": "\\s*[^@]?((namespace)\\s+([\\w.]+))",
82
- "beginCaptures": {
83
- "1": {
84
- "name": "meta.namespace.identifier.cs"
85
- },
86
- "2": {
87
- "name": "keyword.other.namespace.cs"
88
- },
89
- "3": {
90
- "name": "entity.name.type.namespace.cs"
91
- }
92
- },
93
- "end": "}",
94
- "endCaptures": {
95
- "0": {
96
- "name": "punctuation.section.namespace.end.cs"
97
- }
98
- },
41
+ "block": {
99
42
  "patterns": [
100
43
  {
44
+ "name": "meta.block.cs",
101
45
  "begin": "{",
102
- "beginCaptures": {
103
- "0": {
104
- "name": "punctuation.section.namespace.begin.cs"
105
- }
106
- },
107
- "end": "(?=})",
46
+ "end": "}",
108
47
  "patterns": [
109
- {
110
- "include": "#using"
111
- },
112
- {
113
- "include": "#namespace"
114
- },
115
48
  {
116
49
  "include": "#code"
117
50
  }
118
- ]
119
- }
120
- ]
121
- },
122
- "field-declaration": {
123
- "patterns": [
124
- {
125
- "begin": "(?=(?:(?:(?:private|public|volatile|internal|protected|static|readonly|const|event|extern)\\s*)*)(?:[\\w\\s?*,<>\\[\\]]+?)(?:[\\w]+)\\s*(?:;|=|=>))",
126
- "end": "(?=;)",
127
- "name": "meta.field.declaration.cs",
128
- "patterns": [
129
- {
130
- "begin": "(?==>?)",
131
- "end": "(?=;|$)",
132
- "patterns": [
133
- {
134
- "include": "#code"
135
- }
136
- ]
137
- },
138
- {
139
- "begin": "\\s*=\\s*",
140
- "end": "(?=;)",
141
- "patterns": [
142
- {
143
- "include": "#code"
144
- }
145
- ]
146
- },
147
- {
148
- "match": "\\s*((?:(?:private|public|volatile|internal|protected|static|readonly|const|event|extern)\\s*)*)\\s*(.+?)\\s*([\\w]+)\\s*(?=;|=)",
149
- "captures": {
150
- "1": {
151
- "name": "storage.modifier.cs"
152
- },
153
- "2": {
154
- "patterns": [
155
- {
156
- "include": "#type"
157
- }
158
- ]
159
- },
160
- "3": {
161
- "name": "entity.name.variable.cs"
162
- }
163
- }
51
+ ],
52
+ "beginCaptures": {
53
+ "0": {
54
+ "name": "punctuation.section.block.begin.cs"
164
55
  }
165
- ]
56
+ },
57
+ "endCaptures": {
58
+ "0": {
59
+ "name": "punctuation.section.block.end.cs"
60
+ }
61
+ }
166
62
  }
167
63
  ]
168
64
  },
169
- "variable": {
65
+ "builtinTypes": {
170
66
  "patterns": [
171
67
  {
172
- "match": "\\s*\\b(var)\\s+(.*?)(?=(=|;))",
68
+ "name": "storage.value.type.cs",
69
+ "match": "\\b(bool|byte|sbyte|char|decimal|double|enum|float|int|uint|long|ulong|short|ushort)[ ]*(\\?|\\*)?\\b",
173
70
  "captures": {
174
- "1": {
175
- "name": "keyword.other.var.cs"
176
- },
177
71
  "2": {
178
- "name": "entity.name.variables.cs"
72
+ "name": "punctuation.storage.type.modifier.cs"
179
73
  }
180
74
  }
181
75
  },
182
76
  {
183
- "match": "\\s*\\b(?!var|return|yield|throw)([\\w+<>*?,\\[\\]]+)\\s+([\\w]+)\\s*(?=(=(?!=)|;))",
77
+ "name": "storage.reference.type.cs",
78
+ "match": "\\b(dynamic|object|string)[ ]*([*])?\\b",
184
79
  "captures": {
185
- "1": {
186
- "patterns": [
187
- {
188
- "include": "#type"
189
- }
190
- ]
191
- },
192
80
  "2": {
193
- "name": "entity.name.variables.cs"
81
+ "name": "punctuation.storage.type.modifier.cs"
194
82
  }
195
83
  }
196
84
  }
197
85
  ]
198
86
  },
199
- "block": {
200
- "patterns": [
201
- {
202
- "begin": "{",
203
- "beginCaptures": {
204
- "0": {
205
- "name": "punctuation.section.block.begin.cs"
206
- }
207
- },
208
- "end": "}",
209
- "endCaptures": {
210
- "0": {
211
- "name": "punctuation.section.block.end.cs"
212
- }
213
- },
214
- "name": "meta.block.cs",
87
+ "castTypeOperator": {
88
+ "match": "\\((\\w+[?*,\u003c\u003e\\[\\]]*)\\)",
89
+ "captures": {
90
+ "1": {
215
91
  "patterns": [
216
92
  {
217
- "include": "#code"
93
+ "include": "#type"
218
94
  }
219
95
  ]
220
96
  }
221
- ]
97
+ }
222
98
  },
223
- "returnType": {
99
+ "code": {
224
100
  "patterns": [
225
101
  {
226
- "match": "void",
227
- "name": "storage.type.cs"
102
+ "include": "#typeOperator"
228
103
  },
229
104
  {
230
- "include": "#type"
231
- }
232
- ]
233
- },
234
- "type": {
235
- "patterns": [
105
+ "include": "#block"
106
+ },
236
107
  {
237
- "include": "#builtinTypes"
108
+ "include": "#comments"
238
109
  },
239
110
  {
240
- "include": "#typeName"
111
+ "include": "#enum-declaration"
112
+ },
113
+ {
114
+ "include": "#type-declaration"
115
+ },
116
+ {
117
+ "include": "#constants"
118
+ },
119
+ {
120
+ "include": "#keywords"
121
+ },
122
+ {
123
+ "include": "#preprocessor"
124
+ },
125
+ {
126
+ "include": "#method-call"
127
+ },
128
+ {
129
+ "include": "#variable"
130
+ },
131
+ {
132
+ "include": "#builtinTypes"
241
133
  }
242
134
  ]
243
135
  },
244
- "builtinTypes": {
136
+ "comments": {
245
137
  "patterns": [
246
138
  {
247
- "match": "\\b(bool|byte|sbyte|char|decimal|double|enum|float|int|uint|long|ulong|short|ushort)[ ]*(\\?|\\*)?\\b",
248
- "name": "storage.value.type.cs",
249
- "captures": {
250
- "2": {
251
- "name": "punctuation.storage.type.modifier.cs"
139
+ "name": "comment.block.documentation.cs",
140
+ "begin": "///",
141
+ "end": "$",
142
+ "patterns": [
143
+ {
144
+ "include": "text.xml"
145
+ }
146
+ ],
147
+ "beginCaptures": {
148
+ "0": {
149
+ "name": "punctuation.definition.comment.cs"
252
150
  }
253
151
  }
254
152
  },
255
153
  {
256
- "match": "\\b(dynamic|object|string)[ ]*([*])?\\b",
257
- "name": "storage.reference.type.cs",
258
- "captures": {
259
- "2": {
260
- "name": "punctuation.storage.type.modifier.cs"
154
+ "name": "comment.block.cs",
155
+ "begin": "/\\*",
156
+ "end": "\\*/",
157
+ "beginCaptures": {
158
+ "0": {
159
+ "name": "punctuation.definition.comment.cs"
160
+ }
161
+ },
162
+ "endCaptures": {
163
+ "0": {
164
+ "name": "punctuation.definition.comment.cs"
261
165
  }
262
166
  }
263
- }
264
- ]
265
- },
266
- "typeName": {
267
- "patterns": [
167
+ },
268
168
  {
269
- "begin": "\\b([a-zA-Z]+[\\w\\.]*)\\s*<",
270
- "end": ">",
271
- "captures": {
272
- "1": {
273
- "name": "entity.name.generic.class.cs"
274
- }
275
- },
276
- "patterns": [
277
- {
278
- "match": ","
279
- },
280
- {
281
- "match": "(\\w+([?*])?)",
282
- "captures": {
283
- "1": {
284
- "name": "meta.generic.type.specifier.cs",
285
- "patterns": [
286
- {
287
- "include": "#type"
288
- }
289
- ]
290
- }
291
- }
292
- }
293
- ]
294
- },
295
- {
296
- "match": "\\b(I[A-Z]+[\\w\\.]*)\\s*(?:\\s*\\[\\s*\\])?\\*?\\b",
297
- "captures": {
298
- "1": {
299
- "name": "entity.name.interface.class.cs"
300
- }
301
- }
302
- },
303
- {
304
- "match": "\\b([a-zA-Z]+[\\w\\.]*)\\s*(?:\\s*\\[\\s*\\])?\\*?\\b",
305
- "captures": {
169
+ "name": "comment.line.double-slash.cs",
170
+ "begin": "//",
171
+ "end": "$",
172
+ "beginCaptures": {
306
173
  "1": {
307
- "name": "entity.name.class.cs"
174
+ "name": "punctuation.definition.comment.cs"
308
175
  }
309
176
  }
310
177
  }
311
178
  ]
312
179
  },
313
- "generic-constraints": {
314
- "name": "meta.generic.constraints.cs",
315
- "begin": "(where)\\s+(\\w+([?*])?)\\s*:",
316
- "end": "(?=where|{|$)",
317
- "beginCaptures": {
318
- "1": {
319
- "name": "keyword.other.cs"
320
- },
321
- "2": {
322
- "name": "meta.generic.type.specifier.cs",
323
- "patterns": [
324
- {
325
- "include": "#type"
326
- }
327
- ]
328
- }
329
- },
180
+ "constants": {
330
181
  "patterns": [
331
182
  {
332
- "match": "\\b(class|struct)\\b",
333
- "name": "keyword.other.cs"
334
- },
335
- {
336
- "match": "(new)\\s*\\(\\s*\\)",
337
- "captures": {
338
- "1": {
339
- "name": "keyword.other.cs"
340
- }
341
- }
342
- },
343
- {
344
- "include": "#type"
183
+ "name": "constant.language.cs",
184
+ "match": "\\b(true|false|null|this|base)\\b"
345
185
  },
346
186
  {
347
- "include": "#generic-constraints"
187
+ "name": "constant.numeric.cs",
188
+ "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(?i:f|d|m|u|l|ul|lu)?\\b"
348
189
  },
349
190
  {
350
- "include": "#comments"
191
+ "include": "#string"
351
192
  }
352
193
  ]
353
194
  },
354
195
  "enum-declaration": {
355
196
  "begin": "(?=(?:public|private|protected|internal)?(.*)?(?:enum)\\s+\\w+)",
356
197
  "end": "}",
357
- "endCaptures": {
358
- "0": {
359
- "name": "punctuation.section.enum.end.cs"
360
- }
361
- },
362
198
  "patterns": [
363
199
  {
364
- "match": "\\b(public|private|protected|internal|static)\\b",
365
- "name": "storage.modifier.cs"
200
+ "name": "storage.modifier.cs",
201
+ "match": "\\b(public|private|protected|internal|static)\\b"
366
202
  },
367
203
  {
368
204
  "include": "#comments"
369
205
  },
370
206
  {
207
+ "name": "meta.enum.declaration.cs",
371
208
  "begin": "(enum)\\s+",
372
209
  "end": "(?={)",
373
- "name": "meta.enum.declaration.cs",
374
- "beginCaptures": {
375
- "1": {
376
- "name": "keyword.enum.cs"
377
- }
378
- },
379
210
  "patterns": [
380
211
  {
381
212
  "match": "\\b([a-zA-Z]+\\w*)\\b",
@@ -385,15 +216,15 @@
385
216
  }
386
217
  }
387
218
  }
388
- ]
219
+ ],
220
+ "beginCaptures": {
221
+ "1": {
222
+ "name": "keyword.enum.cs"
223
+ }
224
+ }
389
225
  },
390
226
  {
391
227
  "begin": "{",
392
- "beginCaptures": {
393
- "0": {
394
- "name": "punctuation.section.enum.begin.cs"
395
- }
396
- },
397
228
  "end": "(?=})",
398
229
  "patterns": [
399
230
  {
@@ -407,11 +238,6 @@
407
238
  },
408
239
  {
409
240
  "begin": "\\b([a-zA-Z]+\\w*)\\b\\s*",
410
- "beginCaptures": {
411
- "1": {
412
- "name": "entity.name.enum.cs"
413
- }
414
- },
415
241
  "end": "(?=,|})",
416
242
  "patterns": [
417
243
  {
@@ -429,124 +255,122 @@
429
255
  }
430
256
  ]
431
257
  }
432
- ]
258
+ ],
259
+ "beginCaptures": {
260
+ "1": {
261
+ "name": "entity.name.enum.cs"
262
+ }
263
+ }
433
264
  }
434
- ]
265
+ ],
266
+ "beginCaptures": {
267
+ "0": {
268
+ "name": "punctuation.section.enum.begin.cs"
269
+ }
270
+ }
435
271
  }
436
- ]
437
- },
438
- "type-declaration": {
439
- "begin": "(?=(?:public|private|protected|internal|static|partial|abstract|sealed|new)?(.*)?(?:class|struct|interface)\\s+\\w+)",
440
- "end": "}",
272
+ ],
441
273
  "endCaptures": {
442
274
  "0": {
443
- "name": "punctuation.section.class.end.cs"
275
+ "name": "punctuation.section.enum.end.cs"
444
276
  }
445
- },
277
+ }
278
+ },
279
+ "field-declaration": {
446
280
  "patterns": [
447
281
  {
448
- "match": "\\b(public|private|protected|internal|static|partial|abstract|sealed|new)\\b",
449
- "name": "storage.modifier.cs"
450
- },
451
- {
452
- "include": "#comments"
453
- },
454
- {
455
- "begin": "(class|struct|interface)\\s+",
456
- "end": "(?={|:|$|where)",
457
- "name": "meta.type.declaration.cs",
458
- "beginCaptures": {
459
- "1": {
460
- "name": "keyword.class.cs"
461
- }
462
- },
282
+ "name": "meta.field.declaration.cs",
283
+ "begin": "(?=(?:(?:(?:private|public|volatile|internal|protected|static|readonly|const|event|extern)\\s*)*)(?:[\\w\\s?*,\u003c\u003e\\[\\]]+?)(?:[\\w]+)\\s*(?:;|=|=\u003e))",
284
+ "end": "(?=;)",
463
285
  "patterns": [
464
286
  {
465
- "include": "#typeName"
466
- }
467
- ]
468
- },
469
- {
470
- "begin": ":",
471
- "end": "(?={|where)",
472
- "patterns": [
287
+ "begin": "(?==\u003e?)",
288
+ "end": "(?=;|$)",
289
+ "patterns": [
290
+ {
291
+ "include": "#code"
292
+ }
293
+ ]
294
+ },
473
295
  {
474
- "include": "#typeName"
296
+ "begin": "\\s*=\\s*",
297
+ "end": "(?=;)",
298
+ "patterns": [
299
+ {
300
+ "include": "#code"
301
+ }
302
+ ]
475
303
  },
476
304
  {
477
- "match": "([\\w<>]+)\\s*",
305
+ "match": "\\s*((?:(?:private|public|volatile|internal|protected|static|readonly|const|event|extern)\\s*)*)\\s*(.+?)\\s*([\\w]+)\\s*(?=;|=)",
478
306
  "captures": {
479
307
  "1": {
480
- "name": "storage.type.cs"
308
+ "name": "storage.modifier.cs"
309
+ },
310
+ "2": {
311
+ "patterns": [
312
+ {
313
+ "include": "#type"
314
+ }
315
+ ]
316
+ },
317
+ "3": {
318
+ "name": "entity.name.variable.cs"
481
319
  }
482
320
  }
483
- },
484
- {
485
- "include": "#comments"
486
321
  }
487
322
  ]
323
+ }
324
+ ]
325
+ },
326
+ "functionTypeOperator": {
327
+ "match": "\\b(typeof|sizeof)\\s*\\((\\w+[?*,\u003c\u003e\\[\\]]*)\\)",
328
+ "captures": {
329
+ "1": {
330
+ "name": "keyword.operator.cs"
488
331
  },
489
- {
490
- "include": "#generic-constraints"
491
- },
492
- {
493
- "begin": "{",
494
- "beginCaptures": {
495
- "0": {
496
- "name": "punctuation.section.class.begin.cs"
497
- }
498
- },
499
- "end": "(?=})",
332
+ "2": {
500
333
  "patterns": [
501
334
  {
502
- "include": "#type-body"
335
+ "include": "#type"
503
336
  }
504
337
  ]
505
338
  }
506
- ]
339
+ }
507
340
  },
508
- "type-body": {
341
+ "generic-constraints": {
342
+ "name": "meta.generic.constraints.cs",
343
+ "begin": "(where)\\s+(\\w+([?*])?)\\s*:",
344
+ "end": "(?=where|{|$)",
509
345
  "patterns": [
510
346
  {
511
- "include": "#attribute"
512
- },
513
- {
514
- "include": "#enum-declaration"
515
- },
516
- {
517
- "include": "#type-declaration"
518
- },
519
- {
520
- "include": "#field-declaration"
521
- },
522
- {
523
- "include": "#property-declaration"
347
+ "name": "keyword.other.cs",
348
+ "match": "\\b(class|struct)\\b"
524
349
  },
525
350
  {
526
- "include": "#method"
351
+ "match": "(new)\\s*\\(\\s*\\)",
352
+ "captures": {
353
+ "1": {
354
+ "name": "keyword.other.cs"
355
+ }
356
+ }
527
357
  },
528
358
  {
529
- "include": "#code"
530
- }
531
- ]
532
- },
533
- "typeOperator": {
534
- "patterns": [
535
- {
536
- "include": "#keywordTypeOperator"
359
+ "include": "#type"
537
360
  },
538
361
  {
539
- "include": "#castTypeOperator"
362
+ "include": "#generic-constraints"
540
363
  },
541
364
  {
542
- "include": "#functionTypeOperator"
365
+ "include": "#comments"
543
366
  }
544
- ]
545
- },
546
- "castTypeOperator": {
547
- "match": "\\((\\w+[?*,<>\\[\\]]*)\\)",
548
- "captures": {
367
+ ],
368
+ "beginCaptures": {
549
369
  "1": {
370
+ "name": "keyword.other.cs"
371
+ },
372
+ "2": {
373
+ "name": "meta.generic.type.specifier.cs",
550
374
  "patterns": [
551
375
  {
552
376
  "include": "#type"
@@ -555,8 +379,8 @@
555
379
  }
556
380
  }
557
381
  },
558
- "functionTypeOperator": {
559
- "match": "\\b(typeof|sizeof)\\s*\\((\\w+[?*,<>\\[\\]]*)\\)",
382
+ "keywordTypeOperator": {
383
+ "match": "\\b(is|as|new)\\s+(\\w+[?*,\u003c\u003e\\[\\]]*)",
560
384
  "captures": {
561
385
  "1": {
562
386
  "name": "keyword.operator.cs"
@@ -570,319 +394,260 @@
570
394
  }
571
395
  }
572
396
  },
573
- "keywordTypeOperator": {
574
- "match": "\\b(is|as|new)\\s+(\\w+[?*,<>\\[\\]]*)",
575
- "captures": {
576
- "1": {
577
- "name": "keyword.operator.cs"
578
- },
579
- "2": {
580
- "patterns": [
581
- {
582
- "include": "#type"
583
- }
584
- ]
585
- }
586
- }
587
- },
588
- "code": {
397
+ "keywords": {
589
398
  "patterns": [
590
399
  {
591
- "include": "#typeOperator"
592
- },
593
- {
594
- "include": "#block"
595
- },
596
- {
597
- "include": "#comments"
598
- },
599
- {
600
- "include": "#enum-declaration"
601
- },
602
- {
603
- "include": "#type-declaration"
604
- },
605
- {
606
- "include": "#constants"
607
- },
608
- {
609
- "include": "#keywords"
610
- },
611
- {
612
- "include": "#preprocessor"
400
+ "name": "keyword.control.cs",
401
+ "match": "\\b(if|else|while|for|foreach|in|do|return|continue|break|switch|case|default|goto|throw|try|catch|finally|lock|yield|await|when)\\b"
613
402
  },
614
403
  {
615
- "include": "#method-call"
404
+ "name": "keyword.linq.cs",
405
+ "match": "\\b(from|where|select|group|into|orderby|join|let|on|equals|by|ascending|descending)\\b"
616
406
  },
617
407
  {
618
- "include": "#variable"
408
+ "name": "keyword.operator.cs",
409
+ "match": "\\b(using|checked|unchecked|override|readonly|stackalloc|nameof)\\b"
619
410
  },
620
411
  {
621
- "include": "#builtinTypes"
412
+ "name": "keyword.other.cs",
413
+ "match": "\\b(event|delegate|fixed|add|remove|set|get|value|alias|global|extern)\\b"
622
414
  }
623
415
  ]
624
416
  },
625
- "comments": {
417
+ "method": {
626
418
  "patterns": [
627
419
  {
628
- "begin": "///",
629
- "beginCaptures": {
630
- "0": {
631
- "name": "punctuation.definition.comment.cs"
632
- }
633
- },
634
- "end": "$",
635
- "name": "comment.block.documentation.cs",
420
+ "name": "meta.new-object.cs",
421
+ "begin": "(?=\\bnew\\s+)(?=[\\w\u003c].*\\s+)(?=[^=]+\\()",
422
+ "end": "(?={|;)",
636
423
  "patterns": [
637
424
  {
638
- "include": "text.xml"
425
+ "include": "#code"
639
426
  }
640
427
  ]
641
428
  },
642
429
  {
643
- "begin": "/\\*",
644
- "beginCaptures": {
645
- "0": {
646
- "name": "punctuation.definition.comment.cs"
647
- }
648
- },
649
- "end": "\\*/",
650
- "endCaptures": {
651
- "0": {
652
- "name": "punctuation.definition.comment.cs"
653
- }
654
- },
655
- "name": "comment.block.cs"
430
+ "name": "storage.modifier.cs",
431
+ "match": "\\b(internal|public|protected|private|static|new|abstract|virtual|override|implicit|explicit|operator|async|partial)\\b"
656
432
  },
657
433
  {
658
- "begin": "//",
659
- "beginCaptures": {
660
- "1": {
661
- "name": "punctuation.definition.comment.cs"
662
- }
663
- },
664
- "end": "$",
665
- "name": "comment.line.double-slash.cs"
666
- }
667
- ]
668
- },
669
- "string-interpolated": {
670
- "patterns": [
671
- {
672
- "begin": "\\$\"",
673
- "end": "\"|$",
674
- "beginCaptures": {
675
- "0": {
676
- "name": "punctuation.definition.string.begin.cs"
677
- }
678
- },
679
- "endCaptures": {
680
- "0": {
681
- "name": "punctuation.definition.string.end.cs"
682
- }
683
- },
434
+ "name": "meta.method.cs",
435
+ "begin": "(void|[\\w\u003c\u003e.?*\\[\\],]+)\\s*(?=.*)",
436
+ "end": "[};]",
684
437
  "patterns": [
685
438
  {
686
- "begin": "([^{}]+?)(?={|\"|$)",
687
- "end": "(?={|\"|$)",
439
+ "name": "meta.method.identifier.cs",
440
+ "begin": "([\\w]+)\\s*(\u003c[\\w\u003c\u003e\\s,`?]*\u003e)?\\s*(\\()",
441
+ "end": "\\)",
442
+ "patterns": [
443
+ {
444
+ "include": "#attribute"
445
+ },
446
+ {
447
+ "include": "#parameters"
448
+ },
449
+ {
450
+ "include": "#constants"
451
+ },
452
+ {
453
+ "include": "#comments"
454
+ }
455
+ ],
688
456
  "beginCaptures": {
689
457
  "1": {
690
- "name": "string.quoted.double.cs"
458
+ "name": "entity.name.function.declaration.cs"
459
+ },
460
+ "2": {
461
+ "name": "meta.generic.method.identifier",
462
+ "patterns": [
463
+ {
464
+ "match": ","
465
+ },
466
+ {
467
+ "match": "(\\w+)",
468
+ "captures": {
469
+ "1": {
470
+ "name": "meta.generic.type.specifier.cs",
471
+ "patterns": [
472
+ {
473
+ "include": "#type"
474
+ }
475
+ ]
476
+ }
477
+ }
478
+ }
479
+ ]
480
+ },
481
+ "3": {
482
+ "name": "punctuation.definition.method-parameters.begin.cs"
483
+ }
484
+ },
485
+ "endCaptures": {
486
+ "0": {
487
+ "name": "punctuation.definition.method-parameters.end.cs"
691
488
  }
692
489
  }
693
490
  },
694
491
  {
695
- "begin": "{",
696
- "end": "}",
697
- "name": "meta.interpolated.expression.cs",
492
+ "include": "#generic-constraints"
493
+ },
494
+ {
495
+ "name": "meta.method.base-call.cs",
496
+ "begin": ":\\s*(this|base)\\s*\\(",
497
+ "end": "\\)",
698
498
  "patterns": [
699
499
  {
700
- "include": "#code"
500
+ "include": "#builtinTypes"
701
501
  }
702
- ]
703
- },
704
- {
705
- "begin": "([^{}]+?)(?={|\"|$)",
706
- "end": "(?={|\"|$)",
502
+ ],
707
503
  "beginCaptures": {
708
504
  "1": {
709
- "name": "string.quoted.double.cs"
505
+ "name": "constant.language.cs"
710
506
  }
711
507
  }
712
- }
713
- ]
714
- }
715
- ]
716
- },
717
- "string-interpolated-verbatim": {
718
- "patterns": [
719
- {
720
- "begin": "\\$@\"",
721
- "end": "\"",
722
- "beginCaptures": {
723
- "0": {
724
- "name": "punctuation.definition.string.begin.cs"
725
- }
726
- },
727
- "endCaptures": {
728
- "0": {
729
- "name": "punctuation.definition.string.end.cs"
730
- }
731
- },
732
- "patterns": [
508
+ },
733
509
  {
734
- "begin": "([^{}]+?)(?={|\"|$)",
735
- "end": "(?={|\"|$)",
736
- "beginCaptures": {
737
- "1": {
738
- "name": "string.quoted.double.literal.cs"
739
- }
740
- }
510
+ "include": "#comments"
741
511
  },
742
512
  {
513
+ "name": "meta.method.body.cs",
743
514
  "begin": "{",
744
- "end": "}",
745
- "name": "meta.interpolated.expression.cs",
515
+ "end": "(?=})",
746
516
  "patterns": [
747
517
  {
748
518
  "include": "#code"
749
519
  }
750
- ]
520
+ ],
521
+ "beginCaptures": {
522
+ "0": {
523
+ "name": "punctuation.section.method.begin.cs"
524
+ }
525
+ }
751
526
  },
752
527
  {
753
- "begin": "([^{}]+?)(?={|\"|$)",
754
- "end": "(?={|\"|$)",
528
+ "name": "meta.method.body.cs",
529
+ "begin": "=\u003e",
530
+ "end": "(?=;)",
531
+ "patterns": [
532
+ {
533
+ "include": "#code"
534
+ }
535
+ ],
755
536
  "beginCaptures": {
756
- "1": {
757
- "name": "string.quoted.double.literal.cs"
537
+ "0": {
538
+ "name": "punctuation.section.method.begin.cs"
758
539
  }
759
540
  }
760
541
  }
761
- ]
542
+ ],
543
+ "beginCaptures": {
544
+ "1": {
545
+ "name": "meta.method.return-type.cs",
546
+ "patterns": [
547
+ {
548
+ "include": "#returnType"
549
+ }
550
+ ]
551
+ }
552
+ },
553
+ "endCaptures": {
554
+ "1": {
555
+ "name": "punctuation.section.method.end.cs"
556
+ }
557
+ }
762
558
  }
763
559
  ]
764
560
  },
765
- "string": {
561
+ "method-call": {
562
+ "name": "meta.method-call.cs",
563
+ "begin": "([\\w$]+)\\s*(\\()",
564
+ "end": "\\)",
766
565
  "patterns": [
767
566
  {
768
- "include": "#string-interpolated-verbatim"
567
+ "name": "punctuation.definition.separator.parameter.cs",
568
+ "match": ","
769
569
  },
770
570
  {
771
- "include": "#string-interpolated"
571
+ "name": "storage.modifier.cs",
572
+ "match": "\\b(ref|out)\\b"
772
573
  },
773
574
  {
774
- "captures": {
775
- "0": {
776
- "name": "punctuation.definition.string.begin.cs"
777
- }
778
- },
779
- "match": "@\"([^\"]|\"\")*\"",
780
- "name": "string.quoted.double.literal.cs"
575
+ "include": "#code"
576
+ }
577
+ ],
578
+ "beginCaptures": {
579
+ "1": {
580
+ "name": "meta.method.cs"
781
581
  },
782
- {
783
- "begin": "\"",
784
- "beginCaptures": {
785
- "0": {
786
- "name": "punctuation.definition.string.begin.cs"
787
- }
788
- },
789
- "end": "\"",
790
- "endCaptures": {
791
- "0": {
792
- "name": "punctuation.definition.string.end.cs"
793
- }
794
- },
795
- "name": "string.quoted.double.cs",
582
+ "2": {
583
+ "name": "punctuation.definition.method-parameters.begin.cs"
584
+ }
585
+ },
586
+ "endCaptures": {
587
+ "0": {
588
+ "name": "punctuation.definition.method-parameters.end.cs"
589
+ }
590
+ }
591
+ },
592
+ "namespace": {
593
+ "begin": "\\s*[^@]?((namespace)\\s+([\\w.]+))",
594
+ "end": "}",
595
+ "patterns": [
596
+ {
597
+ "begin": "{",
598
+ "end": "(?=})",
796
599
  "patterns": [
797
600
  {
798
- "match": "\\\\.",
799
- "name": "constant.character.escape.cs"
601
+ "include": "#using"
602
+ },
603
+ {
604
+ "include": "#namespace"
605
+ },
606
+ {
607
+ "include": "#code"
800
608
  }
801
- ]
802
- },
803
- {
804
- "begin": "'",
609
+ ],
805
610
  "beginCaptures": {
806
611
  "0": {
807
- "name": "punctuation.definition.string.begin.cs"
808
- }
809
- },
810
- "end": "'",
811
- "endCaptures": {
812
- "0": {
813
- "name": "punctuation.definition.string.end.cs"
814
- }
815
- },
816
- "name": "string.quoted.single.cs",
817
- "patterns": [
818
- {
819
- "match": "\\\\.",
820
- "name": "constant.character.escape.cs"
612
+ "name": "punctuation.section.namespace.begin.cs"
821
613
  }
822
- ]
614
+ }
823
615
  }
824
- ]
825
- },
826
- "constants": {
827
- "patterns": [
828
- {
829
- "match": "\\b(true|false|null|this|base)\\b",
830
- "name": "constant.language.cs"
616
+ ],
617
+ "beginCaptures": {
618
+ "1": {
619
+ "name": "meta.namespace.identifier.cs"
831
620
  },
832
- {
833
- "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(?i:f|d|m|u|l|ul|lu)?\\b",
834
- "name": "constant.numeric.cs"
621
+ "2": {
622
+ "name": "keyword.other.namespace.cs"
835
623
  },
836
- {
837
- "include": "#string"
624
+ "3": {
625
+ "name": "entity.name.type.namespace.cs"
838
626
  }
839
- ]
840
- },
841
- "keywords": {
842
- "patterns": [
843
- {
844
- "match": "\\b(if|else|while|for|foreach|in|do|return|continue|break|switch|case|default|goto|throw|try|catch|finally|lock|yield|await|when)\\b",
845
- "name": "keyword.control.cs"
846
- },
847
- {
848
- "match": "\\b(from|where|select|group|into|orderby|join|let|on|equals|by|ascending|descending)\\b",
849
- "name": "keyword.linq.cs"
850
- },
851
- {
852
- "match": "\\b(using|checked|unchecked|override|readonly|stackalloc|nameof)\\b",
853
- "name": "keyword.operator.cs"
854
- },
855
- {
856
- "match": "\\b(event|delegate|fixed|add|remove|set|get|value|alias|global|extern)\\b",
857
- "name": "keyword.other.cs"
627
+ },
628
+ "endCaptures": {
629
+ "0": {
630
+ "name": "punctuation.section.namespace.end.cs"
858
631
  }
859
- ]
632
+ }
860
633
  },
861
- "attribute": {
862
- "begin": "\\[",
863
- "end": "\\]",
864
- "name": "meta.annotation.cs",
634
+ "parameters": {
635
+ "name": "meta.parameters.cs",
636
+ "begin": "\\b(ref|params|out)?\\s*\\b(\\w+(?:\\s*\u003c.*?\u003e)?(?:\\s*\\*)*(?:\\s*\\?)?(?:\\s*\\[.*?\\])?)\\s+(@?\\w+)\\s*(=)?",
637
+ "end": "(?:(,)|(?=[\\)]))",
865
638
  "patterns": [
866
639
  {
867
640
  "include": "#constants"
868
641
  },
869
642
  {
870
- "include": "#preprocessor"
643
+ "include": "#block"
871
644
  },
872
645
  {
873
646
  "include": "#builtinTypes"
874
- },
875
- {
876
- "include": "#comments"
877
647
  }
878
- ]
879
- },
880
- "property-declaration": {
881
- "begin": "\\s*(?!.*\\b(?:class|interface|struct)\\b)((?:\\w+\\s+)*?)(?!(?:private|public|internal|protected|static|new|virtual|override))(\\w.+?)\\s+(\\w+)\\s*(?={|$)",
882
- "end": "}|;|$",
648
+ ],
883
649
  "beginCaptures": {
884
650
  "1": {
885
- "match": "\\b(private|public|internal|protected|static|new|virtual|override)\\b",
886
651
  "name": "storage.modifier.cs"
887
652
  },
888
653
  "2": {
@@ -893,10 +658,38 @@
893
658
  ]
894
659
  },
895
660
  "3": {
896
- "name": "entity.name.function.cs"
661
+ "name": "variable.parameter.function.cs"
662
+ },
663
+ "4": {
664
+ "name": "keyword.operator.assignment.cs"
897
665
  }
898
666
  },
667
+ "endCaptures": {
668
+ "1": {
669
+ "name": "punctuation.definition.separator.parameter.cs"
670
+ }
671
+ }
672
+ },
673
+ "preprocessor": {
674
+ "patterns": [
675
+ {
676
+ "name": "meta.preprocessor.cs",
677
+ "match": "^\\s*(#\\s*(if|else|elif|endif|define|undef|warning|error|line|pragma|region|endregion))\\b\\s*(.*?)(?=$|\\/\\/)",
678
+ "captures": {
679
+ "1": {
680
+ "name": "meta.directive.preprocessor.cs"
681
+ },
682
+ "3": {
683
+ "name": "entity.name.preprocessor.cs"
684
+ }
685
+ }
686
+ }
687
+ ]
688
+ },
689
+ "property-declaration": {
899
690
  "name": "meta.property.cs",
691
+ "begin": "\\s*(?!.*\\b(?:class|interface|struct)\\b)((?:\\w+\\s+)*?)(?!(?:private|public|internal|protected|static|new|virtual|override))(\\w.+?)\\s+(\\w+)\\s*(?={|$)",
692
+ "end": "}|;|$",
900
693
  "patterns": [
901
694
  {
902
695
  "include": "#block"
@@ -910,127 +703,163 @@
910
703
  }
911
704
  ]
912
705
  }
913
- ]
914
- },
915
- "method": {
916
- "patterns": [
917
- {
918
- "begin": "(?=\\bnew\\s+)(?=[\\w<].*\\s+)(?=[^=]+\\()",
919
- "end": "(?={|;)",
920
- "name": "meta.new-object.cs",
706
+ ],
707
+ "beginCaptures": {
708
+ "1": {
709
+ "name": "storage.modifier.cs",
710
+ "match": "\\b(private|public|internal|protected|static|new|virtual|override)\\b"
711
+ },
712
+ "2": {
921
713
  "patterns": [
922
714
  {
923
- "include": "#code"
715
+ "include": "#type"
924
716
  }
925
717
  ]
926
718
  },
719
+ "3": {
720
+ "name": "entity.name.function.cs"
721
+ }
722
+ }
723
+ },
724
+ "returnType": {
725
+ "patterns": [
726
+ {
727
+ "name": "storage.type.cs",
728
+ "match": "void"
729
+ },
927
730
  {
928
- "match": "\\b(internal|public|protected|private|static|new|abstract|virtual|override|implicit|explicit|operator|async|partial)\\b",
929
- "name": "storage.modifier.cs"
731
+ "include": "#type"
732
+ }
733
+ ]
734
+ },
735
+ "string": {
736
+ "patterns": [
737
+ {
738
+ "include": "#string-interpolated-verbatim"
739
+ },
740
+ {
741
+ "include": "#string-interpolated"
742
+ },
743
+ {
744
+ "name": "string.quoted.double.literal.cs",
745
+ "match": "@\"([^\"]|\"\")*\"",
746
+ "captures": {
747
+ "0": {
748
+ "name": "punctuation.definition.string.begin.cs"
749
+ }
750
+ }
930
751
  },
931
752
  {
932
- "begin": "(void|[\\w<>.?*\\[\\],]+)\\s*(?=.*)",
753
+ "name": "string.quoted.double.cs",
754
+ "begin": "\"",
755
+ "end": "\"",
756
+ "patterns": [
757
+ {
758
+ "name": "constant.character.escape.cs",
759
+ "match": "\\\\."
760
+ }
761
+ ],
933
762
  "beginCaptures": {
934
- "1": {
935
- "name": "meta.method.return-type.cs",
936
- "patterns": [
937
- {
938
- "include": "#returnType"
939
- }
940
- ]
763
+ "0": {
764
+ "name": "punctuation.definition.string.begin.cs"
941
765
  }
942
766
  },
943
- "end": "[};]",
944
767
  "endCaptures": {
945
- "1": {
946
- "name": "punctuation.section.method.end.cs"
768
+ "0": {
769
+ "name": "punctuation.definition.string.end.cs"
770
+ }
771
+ }
772
+ },
773
+ {
774
+ "name": "string.quoted.single.cs",
775
+ "begin": "'",
776
+ "end": "'",
777
+ "patterns": [
778
+ {
779
+ "name": "constant.character.escape.cs",
780
+ "match": "\\\\."
781
+ }
782
+ ],
783
+ "beginCaptures": {
784
+ "0": {
785
+ "name": "punctuation.definition.string.begin.cs"
947
786
  }
948
787
  },
949
- "name": "meta.method.cs",
788
+ "endCaptures": {
789
+ "0": {
790
+ "name": "punctuation.definition.string.end.cs"
791
+ }
792
+ }
793
+ }
794
+ ]
795
+ },
796
+ "string-interpolated": {
797
+ "patterns": [
798
+ {
799
+ "begin": "\\$\"",
800
+ "end": "\"|$",
950
801
  "patterns": [
951
802
  {
952
- "begin": "([\\w]+)\\s*(<[\\w<>\\s,`?]*>)?\\s*(\\()",
803
+ "begin": "([^{}]+?)(?={|\"|$)",
804
+ "end": "(?={|\"|$)",
953
805
  "beginCaptures": {
954
806
  "1": {
955
- "name": "entity.name.function.declaration.cs"
956
- },
957
- "2": {
958
- "name": "meta.generic.method.identifier",
959
- "patterns": [
960
- {
961
- "match": ","
962
- },
963
- {
964
- "match": "(\\w+)",
965
- "captures": {
966
- "1": {
967
- "name": "meta.generic.type.specifier.cs",
968
- "patterns": [
969
- {
970
- "include": "#type"
971
- }
972
- ]
973
- }
974
- }
975
- }
976
- ]
977
- },
978
- "3": {
979
- "name": "punctuation.definition.method-parameters.begin.cs"
807
+ "name": "string.quoted.double.cs"
980
808
  }
981
- },
982
- "end": "\\)",
983
- "endCaptures": {
984
- "0": {
985
- "name": "punctuation.definition.method-parameters.end.cs"
986
- }
987
- },
988
- "name": "meta.method.identifier.cs",
809
+ }
810
+ },
811
+ {
812
+ "name": "meta.interpolated.expression.cs",
813
+ "begin": "{",
814
+ "end": "}",
989
815
  "patterns": [
990
816
  {
991
- "include": "#attribute"
992
- },
993
- {
994
- "include": "#parameters"
995
- },
996
- {
997
- "include": "#constants"
998
- },
999
- {
1000
- "include": "#comments"
817
+ "include": "#code"
1001
818
  }
1002
819
  ]
1003
820
  },
1004
821
  {
1005
- "include": "#generic-constraints"
1006
- },
1007
- {
1008
- "begin": ":\\s*(this|base)\\s*\\(",
822
+ "begin": "([^{}]+?)(?={|\"|$)",
823
+ "end": "(?={|\"|$)",
1009
824
  "beginCaptures": {
1010
825
  "1": {
1011
- "name": "constant.language.cs"
1012
- }
1013
- },
1014
- "end": "\\)",
1015
- "name": "meta.method.base-call.cs",
1016
- "patterns": [
1017
- {
1018
- "include": "#builtinTypes"
826
+ "name": "string.quoted.double.cs"
1019
827
  }
1020
- ]
1021
- },
828
+ }
829
+ }
830
+ ],
831
+ "beginCaptures": {
832
+ "0": {
833
+ "name": "punctuation.definition.string.begin.cs"
834
+ }
835
+ },
836
+ "endCaptures": {
837
+ "0": {
838
+ "name": "punctuation.definition.string.end.cs"
839
+ }
840
+ }
841
+ }
842
+ ]
843
+ },
844
+ "string-interpolated-verbatim": {
845
+ "patterns": [
846
+ {
847
+ "begin": "\\$@\"",
848
+ "end": "\"",
849
+ "patterns": [
1022
850
  {
1023
- "include": "#comments"
851
+ "begin": "([^{}]+?)(?={|\"|$)",
852
+ "end": "(?={|\"|$)",
853
+ "beginCaptures": {
854
+ "1": {
855
+ "name": "string.quoted.double.literal.cs"
856
+ }
857
+ }
1024
858
  },
1025
859
  {
860
+ "name": "meta.interpolated.expression.cs",
1026
861
  "begin": "{",
1027
- "beginCaptures": {
1028
- "0": {
1029
- "name": "punctuation.section.method.begin.cs"
1030
- }
1031
- },
1032
- "end": "(?=})",
1033
- "name": "meta.method.body.cs",
862
+ "end": "}",
1034
863
  "patterns": [
1035
864
  {
1036
865
  "include": "#code"
@@ -1038,105 +867,275 @@
1038
867
  ]
1039
868
  },
1040
869
  {
1041
- "begin": "=>",
870
+ "begin": "([^{}]+?)(?={|\"|$)",
871
+ "end": "(?={|\"|$)",
1042
872
  "beginCaptures": {
1043
- "0": {
1044
- "name": "punctuation.section.method.begin.cs"
1045
- }
1046
- },
1047
- "end": "(?=;)",
1048
- "name": "meta.method.body.cs",
1049
- "patterns": [
1050
- {
1051
- "include": "#code"
873
+ "1": {
874
+ "name": "string.quoted.double.literal.cs"
1052
875
  }
1053
- ]
876
+ }
1054
877
  }
1055
- ]
878
+ ],
879
+ "beginCaptures": {
880
+ "0": {
881
+ "name": "punctuation.definition.string.begin.cs"
882
+ }
883
+ },
884
+ "endCaptures": {
885
+ "0": {
886
+ "name": "punctuation.definition.string.end.cs"
887
+ }
888
+ }
1056
889
  }
1057
890
  ]
1058
891
  },
1059
- "method-call": {
1060
- "begin": "([\\w$]+)\\s*(\\()",
1061
- "beginCaptures": {
1062
- "1": {
1063
- "name": "meta.method.cs"
892
+ "type": {
893
+ "patterns": [
894
+ {
895
+ "include": "#builtinTypes"
1064
896
  },
1065
- "2": {
1066
- "name": "punctuation.definition.method-parameters.begin.cs"
1067
- }
1068
- },
1069
- "end": "\\)",
1070
- "endCaptures": {
1071
- "0": {
1072
- "name": "punctuation.definition.method-parameters.end.cs"
897
+ {
898
+ "include": "#typeName"
1073
899
  }
1074
- },
1075
- "name": "meta.method-call.cs",
900
+ ]
901
+ },
902
+ "type-body": {
1076
903
  "patterns": [
1077
904
  {
1078
- "match": ",",
1079
- "name": "punctuation.definition.separator.parameter.cs"
905
+ "include": "#attribute"
906
+ },
907
+ {
908
+ "include": "#enum-declaration"
909
+ },
910
+ {
911
+ "include": "#type-declaration"
912
+ },
913
+ {
914
+ "include": "#field-declaration"
915
+ },
916
+ {
917
+ "include": "#property-declaration"
918
+ },
919
+ {
920
+ "include": "#method"
1080
921
  },
1081
922
  {
1082
923
  "include": "#code"
1083
924
  }
1084
925
  ]
1085
926
  },
1086
- "parameters": {
1087
- "name": "meta.parameters.cs",
1088
- "begin": "\\b(ref|params|out)?\\s*\\b(\\w+(?:\\s*<.*?>)?(?:\\s*\\*)*(?:\\s*\\?)?(?:\\s*\\[.*?\\])?)\\s+(@?\\w+)\\s*(=)?",
1089
- "beginCaptures": {
1090
- "1": {
1091
- "name": "storage.modifier.cs"
927
+ "type-declaration": {
928
+ "begin": "(?=(?:public|private|protected|internal|static|partial|abstract|sealed|new)?(.*)?(?:class|struct|interface)\\s+\\w+)",
929
+ "end": "}",
930
+ "patterns": [
931
+ {
932
+ "name": "storage.modifier.cs",
933
+ "match": "\\b(public|private|protected|internal|static|partial|abstract|sealed|new)\\b"
1092
934
  },
1093
- "2": {
935
+ {
936
+ "include": "#comments"
937
+ },
938
+ {
939
+ "name": "meta.type.declaration.cs",
940
+ "begin": "(class|struct|interface)\\s+",
941
+ "end": "(?={|:|$|where)",
1094
942
  "patterns": [
1095
943
  {
1096
- "include": "#type"
944
+ "include": "#typeName"
945
+ }
946
+ ],
947
+ "beginCaptures": {
948
+ "1": {
949
+ "name": "keyword.class.cs"
950
+ }
951
+ }
952
+ },
953
+ {
954
+ "begin": ":",
955
+ "end": "(?={|where)",
956
+ "patterns": [
957
+ {
958
+ "include": "#typeName"
959
+ },
960
+ {
961
+ "match": "([\\w\u003c\u003e]+)\\s*",
962
+ "captures": {
963
+ "1": {
964
+ "name": "storage.type.cs"
965
+ }
966
+ }
967
+ },
968
+ {
969
+ "include": "#comments"
1097
970
  }
1098
971
  ]
1099
972
  },
1100
- "3": {
1101
- "name": "variable.parameter.function.cs"
973
+ {
974
+ "include": "#generic-constraints"
1102
975
  },
1103
- "4": {
1104
- "name": "keyword.operator.assignment.cs"
976
+ {
977
+ "begin": "{",
978
+ "end": "(?=})",
979
+ "patterns": [
980
+ {
981
+ "include": "#type-body"
982
+ }
983
+ ],
984
+ "beginCaptures": {
985
+ "0": {
986
+ "name": "punctuation.section.class.begin.cs"
987
+ }
988
+ }
1105
989
  }
1106
- },
1107
- "end": "(?:(,)|(?=[\\)]))",
990
+ ],
1108
991
  "endCaptures": {
1109
- "1": {
1110
- "name": "punctuation.definition.separator.parameter.cs"
992
+ "0": {
993
+ "name": "punctuation.section.class.end.cs"
1111
994
  }
1112
- },
995
+ }
996
+ },
997
+ "typeName": {
1113
998
  "patterns": [
1114
999
  {
1115
- "include": "#constants"
1000
+ "begin": "\\b([a-zA-Z]+[\\w\\.]*)\\s*\u003c",
1001
+ "end": "\u003e",
1002
+ "patterns": [
1003
+ {
1004
+ "match": ","
1005
+ },
1006
+ {
1007
+ "match": "(\\w+([?*])?)",
1008
+ "captures": {
1009
+ "1": {
1010
+ "name": "meta.generic.type.specifier.cs",
1011
+ "patterns": [
1012
+ {
1013
+ "include": "#type"
1014
+ }
1015
+ ]
1016
+ }
1017
+ }
1018
+ }
1019
+ ],
1020
+ "captures": {
1021
+ "1": {
1022
+ "name": "entity.name.generic.class.cs"
1023
+ }
1024
+ }
1116
1025
  },
1117
1026
  {
1118
- "include": "#block"
1027
+ "match": "\\b(I[A-Z]+[\\w\\.]*)\\s*(?:\\s*\\[\\s*\\])?\\*?\\b",
1028
+ "captures": {
1029
+ "1": {
1030
+ "name": "entity.name.interface.class.cs"
1031
+ }
1032
+ }
1119
1033
  },
1120
1034
  {
1121
- "include": "#builtinTypes"
1035
+ "match": "\\b([a-zA-Z]+[\\w\\.]*)\\s*(?:\\s*\\[\\s*\\])?\\*?\\b",
1036
+ "captures": {
1037
+ "1": {
1038
+ "name": "entity.name.class.cs"
1039
+ }
1040
+ }
1122
1041
  }
1123
1042
  ]
1124
1043
  },
1125
- "preprocessor": {
1044
+ "typeOperator": {
1045
+ "patterns": [
1046
+ {
1047
+ "include": "#keywordTypeOperator"
1048
+ },
1049
+ {
1050
+ "include": "#castTypeOperator"
1051
+ },
1052
+ {
1053
+ "include": "#functionTypeOperator"
1054
+ }
1055
+ ]
1056
+ },
1057
+ "using": {
1058
+ "begin": "\\s*\\b(using)\\b",
1059
+ "end": "\\s*(?:$|;)",
1126
1060
  "patterns": [
1127
1061
  {
1062
+ "include": "#comments"
1063
+ },
1064
+ {
1065
+ "match": "\\s*\\b(static)\\b",
1128
1066
  "captures": {
1129
1067
  "1": {
1130
- "name": "meta.directive.preprocessor.cs"
1068
+ "name": "keyword.other.static.cs"
1069
+ }
1070
+ }
1071
+ },
1072
+ {
1073
+ "begin": "(\\w+)(?=.*\\=)",
1074
+ "end": ";",
1075
+ "patterns": [
1076
+ {
1077
+ "include": "#comments"
1131
1078
  },
1132
- "3": {
1133
- "name": "entity.name.preprocessor.cs"
1079
+ {
1080
+ "begin": "\\s*\\=(?=[\\w\\s/])",
1081
+ "end": "(?=;)",
1082
+ "patterns": [
1083
+ {
1084
+ "include": "#comments"
1085
+ },
1086
+ {
1087
+ "name": "entity.name.type.namespace.cs",
1088
+ "match": "[\\w.]+"
1089
+ }
1090
+ ]
1134
1091
  }
1135
- },
1136
- "match": "^\\s*(#\\s*(if|else|elif|endif|define|undef|warning|error|line|pragma|region|endregion))\\b\\s*(.*?)(?=$|\\/\\/)",
1137
- "name": "meta.preprocessor.cs"
1092
+ ],
1093
+ "beginCaptures": {
1094
+ "1": {
1095
+ "name": "entity.name.alias.namespace.cs"
1096
+ }
1097
+ }
1098
+ },
1099
+ {
1100
+ "name": "entity.name.type.namespace.cs",
1101
+ "match": "[\\w.]+"
1102
+ }
1103
+ ],
1104
+ "beginCaptures": {
1105
+ "1": {
1106
+ "name": "keyword.other.using.cs"
1107
+ }
1108
+ }
1109
+ },
1110
+ "variable": {
1111
+ "patterns": [
1112
+ {
1113
+ "match": "\\s*\\b(var)\\s+(.*?)(?=(=|;))",
1114
+ "captures": {
1115
+ "1": {
1116
+ "name": "keyword.other.var.cs"
1117
+ },
1118
+ "2": {
1119
+ "name": "entity.name.variables.cs"
1120
+ }
1121
+ }
1122
+ },
1123
+ {
1124
+ "match": "\\s*\\b(?!var|return|yield|throw)([\\w+\u003c\u003e*?,\\[\\]]+)\\s+([\\w]+)\\s*(?=(=(?!=)|;))",
1125
+ "captures": {
1126
+ "1": {
1127
+ "patterns": [
1128
+ {
1129
+ "include": "#type"
1130
+ }
1131
+ ]
1132
+ },
1133
+ "2": {
1134
+ "name": "entity.name.variables.cs"
1135
+ }
1136
+ }
1138
1137
  }
1139
1138
  ]
1140
1139
  }
1141
1140
  }
1142
- }
1141
+ }