@harmoniclabs/monaco-editor 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/.azure-pipelines/publish-nightly.yml +90 -0
  2. package/.azure-pipelines/publish-stable.yml +89 -0
  3. package/.devcontainer/devcontainer.json +8 -0
  4. package/.gitattributes +1 -0
  5. package/.github/ISSUE_TEMPLATE/1_bug_report.yaml +57 -0
  6. package/.github/ISSUE_TEMPLATE/2_feature_request.yaml +38 -0
  7. package/.github/ISSUE_TEMPLATE/3_other.md +4 -0
  8. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  9. package/.github/publish-failure-issue-template.md +7 -0
  10. package/.github/workflows/ci.yml +76 -0
  11. package/.github/workflows/website.yml +66 -0
  12. package/.husky/pre-commit +4 -0
  13. package/.mocharc.json +4 -0
  14. package/.nvmrc +1 -0
  15. package/.prettierignore +17 -0
  16. package/.prettierrc +8 -0
  17. package/.vscode/launch.json +68 -0
  18. package/.vscode/settings.json +16 -0
  19. package/.vscode/tasks.json +30 -0
  20. package/CHANGELOG.md +1655 -0
  21. package/CONTRIBUTING.md +125 -0
  22. package/LICENSE.txt +21 -0
  23. package/MAINTAINING.md +55 -0
  24. package/README.md +122 -0
  25. package/SECURITY.md +41 -0
  26. package/ThirdPartyNotices.txt +392 -0
  27. package/build/build-languages.ts +212 -0
  28. package/build/build-monaco-editor.ts +463 -0
  29. package/build/check-samples.ts +53 -0
  30. package/build/fillers/vscode-nls.ts +46 -0
  31. package/build/fs.ts +80 -0
  32. package/build/importTypescript.ts +192 -0
  33. package/build/npm/installAll.ts +44 -0
  34. package/build/npm/removeAll.ts +20 -0
  35. package/build/postinstall.ts +23 -0
  36. package/build/releaseMetadata.ts +280 -0
  37. package/build/simpleserver.ts +69 -0
  38. package/build/tsconfig.json +8 -0
  39. package/build/utils.ts +291 -0
  40. package/docs/code-structure.dio.svg +275 -0
  41. package/docs/debugging-core.gif +0 -0
  42. package/docs/debugging-languages.gif +0 -0
  43. package/docs/integrate-amd.md +28 -0
  44. package/docs/integrate-esm.md +229 -0
  45. package/docs/launch config.png +0 -0
  46. package/docs/out-folders.dio.svg +347 -0
  47. package/editor.code-workspace +13 -0
  48. package/gulpfile.js +9 -0
  49. package/package.json +80 -0
  50. package/samples/README.md +36 -0
  51. package/samples/browser-amd-diff-editor/index.html +62 -0
  52. package/samples/browser-amd-diff-editor/modified.txt +74 -0
  53. package/samples/browser-amd-diff-editor/original.txt +61 -0
  54. package/samples/browser-amd-editor/index.html +24 -0
  55. package/samples/browser-amd-iframe/index.html +70 -0
  56. package/samples/browser-amd-iframe/inner.html +34 -0
  57. package/samples/browser-amd-localized/index.html +30 -0
  58. package/samples/browser-amd-monarch/index.html +105 -0
  59. package/samples/browser-amd-requirejs/index.html +26 -0
  60. package/samples/browser-amd-shadow-dom/index.html +50 -0
  61. package/samples/browser-amd-shared-model/index.html +29 -0
  62. package/samples/browser-amd-trusted-types/index.html +42 -0
  63. package/samples/browser-esm-esbuild/build.js +96 -0
  64. package/samples/browser-esm-esbuild/index.html +18 -0
  65. package/samples/browser-esm-esbuild/index.js +24 -0
  66. package/samples/browser-esm-esbuild/package.json +6 -0
  67. package/samples/browser-esm-parcel/index.html +19 -0
  68. package/samples/browser-esm-parcel/package-lock.json +3953 -0
  69. package/samples/browser-esm-parcel/package.json +10 -0
  70. package/samples/browser-esm-parcel/src/index.html +11 -0
  71. package/samples/browser-esm-parcel/src/index.js +29 -0
  72. package/samples/browser-esm-vite-react/index.html +12 -0
  73. package/samples/browser-esm-vite-react/package-lock.json +2341 -0
  74. package/samples/browser-esm-vite-react/package.json +20 -0
  75. package/samples/browser-esm-vite-react/src/components/Editor.module.css +4 -0
  76. package/samples/browser-esm-vite-react/src/components/Editor.tsx +25 -0
  77. package/samples/browser-esm-vite-react/src/main.tsx +11 -0
  78. package/samples/browser-esm-vite-react/src/userWorker.ts +27 -0
  79. package/samples/browser-esm-vite-react/src/vite-env.d.ts +1 -0
  80. package/samples/browser-esm-vite-react/tsconfig.json +11 -0
  81. package/samples/browser-esm-vite-react/vite.config.ts +7 -0
  82. package/samples/browser-esm-webpack/index.html +20 -0
  83. package/samples/browser-esm-webpack/index.js +24 -0
  84. package/samples/browser-esm-webpack/package.json +6 -0
  85. package/samples/browser-esm-webpack/webpack.config.js +30 -0
  86. package/samples/browser-esm-webpack-monaco-plugin/index.html +20 -0
  87. package/samples/browser-esm-webpack-monaco-plugin/index.js +16 -0
  88. package/samples/browser-esm-webpack-monaco-plugin/package.json +6 -0
  89. package/samples/browser-esm-webpack-monaco-plugin/webpack.config.js +28 -0
  90. package/samples/browser-esm-webpack-small/generate-imports.js +140 -0
  91. package/samples/browser-esm-webpack-small/index.html +26 -0
  92. package/samples/browser-esm-webpack-small/index.js +168 -0
  93. package/samples/browser-esm-webpack-small/package.json +7 -0
  94. package/samples/browser-esm-webpack-small/webpack.config.js +35 -0
  95. package/samples/browser-esm-webpack-typescript/package.json +7 -0
  96. package/samples/browser-esm-webpack-typescript/src/index.css +5 -0
  97. package/samples/browser-esm-webpack-typescript/src/index.ts +26 -0
  98. package/samples/browser-esm-webpack-typescript/tsconfig.json +16 -0
  99. package/samples/browser-esm-webpack-typescript/webpack.config.js +44 -0
  100. package/samples/browser-esm-webpack-typescript-react/package-lock.json +6183 -0
  101. package/samples/browser-esm-webpack-typescript-react/package.json +21 -0
  102. package/samples/browser-esm-webpack-typescript-react/src/components/Editor.tsx +38 -0
  103. package/samples/browser-esm-webpack-typescript-react/src/index.css +5 -0
  104. package/samples/browser-esm-webpack-typescript-react/src/index.html +10 -0
  105. package/samples/browser-esm-webpack-typescript-react/src/index.tsx +12 -0
  106. package/samples/browser-esm-webpack-typescript-react/tsconfig.json +18 -0
  107. package/samples/browser-esm-webpack-typescript-react/webpack.config.js +59 -0
  108. package/samples/browser-script-editor/index.html +28 -0
  109. package/samples/electron-amd/electron-index.html +37 -0
  110. package/samples/electron-amd/index.html +18 -0
  111. package/samples/electron-amd/main.js +32 -0
  112. package/samples/electron-amd/package.json +7 -0
  113. package/samples/electron-amd-nodeIntegration/electron-index.html +46 -0
  114. package/samples/electron-amd-nodeIntegration/index.html +18 -0
  115. package/samples/electron-amd-nodeIntegration/main.js +37 -0
  116. package/samples/electron-amd-nodeIntegration/package.json +7 -0
  117. package/samples/electron-esm-webpack/index.js +24 -0
  118. package/samples/electron-esm-webpack/main.js +32 -0
  119. package/samples/electron-esm-webpack/package.json +8 -0
  120. package/samples/electron-esm-webpack/webpack.config.js +29 -0
  121. package/samples/nwjs-amd/index.html +48 -0
  122. package/samples/nwjs-amd-v2/index.html +57 -0
  123. package/samples/package-lock.json +7808 -0
  124. package/samples/package.json +32 -0
  125. package/scripts/ci/env.ts +15 -0
  126. package/scripts/ci/monaco-editor-core-prepare.ts +81 -0
  127. package/scripts/ci/monaco-editor-core.sh +34 -0
  128. package/scripts/ci/monaco-editor-prepare.ts +75 -0
  129. package/scripts/ci/monaco-editor.sh +29 -0
  130. package/scripts/lib/index.ts +95 -0
  131. package/src/basic-languages/_.contribution.ts +80 -0
  132. package/src/basic-languages/abap/abap.contribution.ts +24 -0
  133. package/src/basic-languages/abap/abap.test.ts +360 -0
  134. package/src/basic-languages/abap/abap.ts +1390 -0
  135. package/src/basic-languages/apex/apex.contribution.ts +25 -0
  136. package/src/basic-languages/apex/apex.test.ts +700 -0
  137. package/src/basic-languages/apex/apex.ts +355 -0
  138. package/src/basic-languages/azcli/azcli.contribution.ts +24 -0
  139. package/src/basic-languages/azcli/azcli.test.ts +172 -0
  140. package/src/basic-languages/azcli/azcli.ts +77 -0
  141. package/src/basic-languages/bat/bat.contribution.ts +24 -0
  142. package/src/basic-languages/bat/bat.test.ts +397 -0
  143. package/src/basic-languages/bat/bat.ts +121 -0
  144. package/src/basic-languages/bicep/bicep.contribution.ts +24 -0
  145. package/src/basic-languages/bicep/bicep.test.ts +1063 -0
  146. package/src/basic-languages/bicep/bicep.ts +129 -0
  147. package/src/basic-languages/cameligo/cameligo.contribution.ts +24 -0
  148. package/src/basic-languages/cameligo/cameligo.test.ts +144 -0
  149. package/src/basic-languages/cameligo/cameligo.ts +193 -0
  150. package/src/basic-languages/clojure/clojure.contribution.ts +24 -0
  151. package/src/basic-languages/clojure/clojure.test.ts +943 -0
  152. package/src/basic-languages/clojure/clojure.ts +792 -0
  153. package/src/basic-languages/coffee/coffee.contribution.ts +25 -0
  154. package/src/basic-languages/coffee/coffee.test.ts +2363 -0
  155. package/src/basic-languages/coffee/coffee.ts +258 -0
  156. package/src/basic-languages/cpp/cpp.contribution.ts +38 -0
  157. package/src/basic-languages/cpp/cpp.test.ts +979 -0
  158. package/src/basic-languages/cpp/cpp.ts +416 -0
  159. package/src/basic-languages/csharp/csharp.contribution.ts +24 -0
  160. package/src/basic-languages/csharp/csharp.test.ts +976 -0
  161. package/src/basic-languages/csharp/csharp.ts +352 -0
  162. package/src/basic-languages/csp/csp.contribution.ts +24 -0
  163. package/src/basic-languages/csp/csp.test.ts +8 -0
  164. package/src/basic-languages/csp/csp.ts +58 -0
  165. package/src/basic-languages/css/css.contribution.ts +25 -0
  166. package/src/basic-languages/css/css.test.ts +591 -0
  167. package/src/basic-languages/css/css.ts +215 -0
  168. package/src/basic-languages/cypher/cypher.contribution.ts +24 -0
  169. package/src/basic-languages/cypher/cypher.test.ts +327 -0
  170. package/src/basic-languages/cypher/cypher.ts +274 -0
  171. package/src/basic-languages/dart/dart.contribution.ts +25 -0
  172. package/src/basic-languages/dart/dart.test.ts +558 -0
  173. package/src/basic-languages/dart/dart.ts +305 -0
  174. package/src/basic-languages/dockerfile/dockerfile.contribution.ts +25 -0
  175. package/src/basic-languages/dockerfile/dockerfile.test.ts +238 -0
  176. package/src/basic-languages/dockerfile/dockerfile.ts +145 -0
  177. package/src/basic-languages/ecl/ecl.contribution.ts +24 -0
  178. package/src/basic-languages/ecl/ecl.test.ts +8 -0
  179. package/src/basic-languages/ecl/ecl.ts +481 -0
  180. package/src/basic-languages/elixir/elixir.contribution.ts +24 -0
  181. package/src/basic-languages/elixir/elixir.test.ts +447 -0
  182. package/src/basic-languages/elixir/elixir.ts +656 -0
  183. package/src/basic-languages/flow9/flow9.contribution.ts +24 -0
  184. package/src/basic-languages/flow9/flow9.test.ts +148 -0
  185. package/src/basic-languages/flow9/flow9.ts +160 -0
  186. package/src/basic-languages/freemarker2/freemarker2-angle-bracket.test.ts +3099 -0
  187. package/src/basic-languages/freemarker2/freemarker2-angle-dollar.test.ts +3099 -0
  188. package/src/basic-languages/freemarker2/freemarker2-auto-bracket.test.ts +5358 -0
  189. package/src/basic-languages/freemarker2/freemarker2-auto-dollar.test.ts +5361 -0
  190. package/src/basic-languages/freemarker2/freemarker2-bracket-bracket.test.ts +3086 -0
  191. package/src/basic-languages/freemarker2/freemarker2-bracket-dollar.test.ts +3086 -0
  192. package/src/basic-languages/freemarker2/freemarker2.contribution.ts +111 -0
  193. package/src/basic-languages/freemarker2/freemarker2.ts +1230 -0
  194. package/src/basic-languages/fsharp/fsharp.contribution.ts +24 -0
  195. package/src/basic-languages/fsharp/fsharp.test.ts +491 -0
  196. package/src/basic-languages/fsharp/fsharp.ts +237 -0
  197. package/src/basic-languages/go/go.contribution.ts +24 -0
  198. package/src/basic-languages/go/go.test.ts +1492 -0
  199. package/src/basic-languages/go/go.ts +238 -0
  200. package/src/basic-languages/graphql/graphql.contribution.ts +25 -0
  201. package/src/basic-languages/graphql/graphql.test.ts +138 -0
  202. package/src/basic-languages/graphql/graphql.ts +174 -0
  203. package/src/basic-languages/handlebars/handlebars.contribution.ts +25 -0
  204. package/src/basic-languages/handlebars/handlebars.test.ts +354 -0
  205. package/src/basic-languages/handlebars/handlebars.ts +432 -0
  206. package/src/basic-languages/hcl/hcl.contribution.ts +24 -0
  207. package/src/basic-languages/hcl/hcl.test.ts +1228 -0
  208. package/src/basic-languages/hcl/hcl.ts +189 -0
  209. package/src/basic-languages/html/html.contribution.ts +25 -0
  210. package/src/basic-languages/html/html.test.ts +743 -0
  211. package/src/basic-languages/html/html.ts +355 -0
  212. package/src/basic-languages/ini/ini.contribution.ts +25 -0
  213. package/src/basic-languages/ini/ini.ts +82 -0
  214. package/src/basic-languages/java/java.contribution.ts +25 -0
  215. package/src/basic-languages/java/java.test.ts +878 -0
  216. package/src/basic-languages/java/java.ts +252 -0
  217. package/src/basic-languages/javascript/javascript.contribution.ts +27 -0
  218. package/src/basic-languages/javascript/javascript.test.ts +924 -0
  219. package/src/basic-languages/javascript/javascript.ts +77 -0
  220. package/src/basic-languages/julia/julia.contribution.ts +24 -0
  221. package/src/basic-languages/julia/julia.test.ts +38 -0
  222. package/src/basic-languages/julia/julia.ts +550 -0
  223. package/src/basic-languages/kotlin/kotlin.contribution.ts +25 -0
  224. package/src/basic-languages/kotlin/kotlin.test.ts +753 -0
  225. package/src/basic-languages/kotlin/kotlin.ts +273 -0
  226. package/src/basic-languages/less/less.contribution.ts +25 -0
  227. package/src/basic-languages/less/less.test.ts +1560 -0
  228. package/src/basic-languages/less/less.ts +198 -0
  229. package/src/basic-languages/lexon/lexon.contribution.ts +24 -0
  230. package/src/basic-languages/lexon/lexon.test.ts +145 -0
  231. package/src/basic-languages/lexon/lexon.ts +179 -0
  232. package/src/basic-languages/liquid/liquid.contribution.ts +25 -0
  233. package/src/basic-languages/liquid/liquid.test.ts +209 -0
  234. package/src/basic-languages/liquid/liquid.ts +251 -0
  235. package/src/basic-languages/lua/lua.contribution.ts +24 -0
  236. package/src/basic-languages/lua/lua.test.ts +86 -0
  237. package/src/basic-languages/lua/lua.ts +178 -0
  238. package/src/basic-languages/m3/m3.contribution.ts +24 -0
  239. package/src/basic-languages/m3/m3.test.ts +119 -0
  240. package/src/basic-languages/m3/m3.ts +226 -0
  241. package/src/basic-languages/markdown/markdown.contribution.ts +24 -0
  242. package/src/basic-languages/markdown/markdown.test.ts +95 -0
  243. package/src/basic-languages/markdown/markdown.ts +256 -0
  244. package/src/basic-languages/mdx/mdx.contribution.ts +24 -0
  245. package/src/basic-languages/mdx/mdx.test.ts +171 -0
  246. package/src/basic-languages/mdx/mdx.ts +163 -0
  247. package/src/basic-languages/mips/mips.contribution.ts +25 -0
  248. package/src/basic-languages/mips/mips.test.ts +239 -0
  249. package/src/basic-languages/mips/mips.ts +223 -0
  250. package/src/basic-languages/monaco.contribution.ts +87 -0
  251. package/src/basic-languages/msdax/msdax.contribution.ts +24 -0
  252. package/src/basic-languages/msdax/msdax.test.ts +444 -0
  253. package/src/basic-languages/msdax/msdax.ts +382 -0
  254. package/src/basic-languages/mysql/keywords.js +32 -0
  255. package/src/basic-languages/mysql/keywords.mysql.txt +750 -0
  256. package/src/basic-languages/mysql/mysql.contribution.ts +24 -0
  257. package/src/basic-languages/mysql/mysql.test.ts +561 -0
  258. package/src/basic-languages/mysql/mysql.ts +885 -0
  259. package/src/basic-languages/objective-c/objective-c.contribution.ts +24 -0
  260. package/src/basic-languages/objective-c/objective-c.test.ts +368 -0
  261. package/src/basic-languages/objective-c/objective-c.ts +219 -0
  262. package/src/basic-languages/pascal/pascal.contribution.ts +25 -0
  263. package/src/basic-languages/pascal/pascal.test.ts +151 -0
  264. package/src/basic-languages/pascal/pascal.ts +270 -0
  265. package/src/basic-languages/pascaligo/pascaligo.contribution.ts +24 -0
  266. package/src/basic-languages/pascaligo/pascaligo.test.ts +143 -0
  267. package/src/basic-languages/pascaligo/pascaligo.ts +183 -0
  268. package/src/basic-languages/pebble/pebble.contribution.ts +24 -0
  269. package/src/basic-languages/pebble/pebble.test.ts +178 -0
  270. package/src/basic-languages/pebble/pebble.ts +457 -0
  271. package/src/basic-languages/perl/perl.contribution.ts +24 -0
  272. package/src/basic-languages/perl/perl.test.ts +475 -0
  273. package/src/basic-languages/perl/perl.ts +664 -0
  274. package/src/basic-languages/pgsql/keywords.js +30 -0
  275. package/src/basic-languages/pgsql/keywords.postgresql.txt +827 -0
  276. package/src/basic-languages/pgsql/pgsql.contribution.ts +24 -0
  277. package/src/basic-languages/pgsql/pgsql.test.ts +595 -0
  278. package/src/basic-languages/pgsql/pgsql.ts +858 -0
  279. package/src/basic-languages/php/php.contribution.ts +25 -0
  280. package/src/basic-languages/php/php.test.ts +2409 -0
  281. package/src/basic-languages/php/php.ts +636 -0
  282. package/src/basic-languages/pla/pla.contribution.ts +23 -0
  283. package/src/basic-languages/pla/pla.test.ts +598 -0
  284. package/src/basic-languages/pla/pla.ts +157 -0
  285. package/src/basic-languages/postiats/postiats.contribution.ts +24 -0
  286. package/src/basic-languages/postiats/postiats.test.ts +1050 -0
  287. package/src/basic-languages/postiats/postiats.ts +748 -0
  288. package/src/basic-languages/powerquery/powerquery.contribution.ts +24 -0
  289. package/src/basic-languages/powerquery/powerquery.test.ts +416 -0
  290. package/src/basic-languages/powerquery/powerquery.ts +917 -0
  291. package/src/basic-languages/powershell/powershell.contribution.ts +24 -0
  292. package/src/basic-languages/powershell/powershell.test.ts +884 -0
  293. package/src/basic-languages/powershell/powershell.ts +263 -0
  294. package/src/basic-languages/protobuf/protobuf.contribution.ts +24 -0
  295. package/src/basic-languages/protobuf/protobuf.test.ts +2073 -0
  296. package/src/basic-languages/protobuf/protobuf.ts +463 -0
  297. package/src/basic-languages/pug/pug.contribution.ts +24 -0
  298. package/src/basic-languages/pug/pug.test.ts +473 -0
  299. package/src/basic-languages/pug/pug.ts +434 -0
  300. package/src/basic-languages/python/python.contribution.ts +25 -0
  301. package/src/basic-languages/python/python.test.ts +257 -0
  302. package/src/basic-languages/python/python.ts +296 -0
  303. package/src/basic-languages/qsharp/qsharp.contribution.ts +24 -0
  304. package/src/basic-languages/qsharp/qsharp.test.ts +186 -0
  305. package/src/basic-languages/qsharp/qsharp.ts +325 -0
  306. package/src/basic-languages/r/r.contribution.ts +24 -0
  307. package/src/basic-languages/r/r.test.ts +600 -0
  308. package/src/basic-languages/r/r.ts +263 -0
  309. package/src/basic-languages/razor/razor.contribution.ts +25 -0
  310. package/src/basic-languages/razor/razor.test.ts +175 -0
  311. package/src/basic-languages/razor/razor.ts +571 -0
  312. package/src/basic-languages/redis/redis.contribution.ts +24 -0
  313. package/src/basic-languages/redis/redis.test.ts +306 -0
  314. package/src/basic-languages/redis/redis.ts +309 -0
  315. package/src/basic-languages/redshift/redshift.contribution.ts +24 -0
  316. package/src/basic-languages/redshift/redshift.test.ts +595 -0
  317. package/src/basic-languages/redshift/redshift.ts +815 -0
  318. package/src/basic-languages/restructuredtext/restructuredtext.contribution.ts +24 -0
  319. package/src/basic-languages/restructuredtext/restructuredtext.test.ts +454 -0
  320. package/src/basic-languages/restructuredtext/restructuredtext.ts +198 -0
  321. package/src/basic-languages/ruby/ruby.contribution.ts +25 -0
  322. package/src/basic-languages/ruby/ruby.test.ts +158 -0
  323. package/src/basic-languages/ruby/ruby.ts +590 -0
  324. package/src/basic-languages/rust/rust.contribution.ts +24 -0
  325. package/src/basic-languages/rust/rust.test.ts +208 -0
  326. package/src/basic-languages/rust/rust.ts +361 -0
  327. package/src/basic-languages/sb/sb.contribution.ts +24 -0
  328. package/src/basic-languages/sb/sb.test.ts +320 -0
  329. package/src/basic-languages/sb/sb.ts +134 -0
  330. package/src/basic-languages/scala/scala.contribution.ts +25 -0
  331. package/src/basic-languages/scala/scala.test.ts +727 -0
  332. package/src/basic-languages/scala/scala.ts +413 -0
  333. package/src/basic-languages/scheme/scheme.contribution.ts +24 -0
  334. package/src/basic-languages/scheme/scheme.test.ts +89 -0
  335. package/src/basic-languages/scheme/scheme.ts +128 -0
  336. package/src/basic-languages/scss/scss.contribution.ts +25 -0
  337. package/src/basic-languages/scss/scss.test.ts +2422 -0
  338. package/src/basic-languages/scss/scss.ts +284 -0
  339. package/src/basic-languages/shell/shell.contribution.ts +24 -0
  340. package/src/basic-languages/shell/shell.test.ts +345 -0
  341. package/src/basic-languages/shell/shell.ts +246 -0
  342. package/src/basic-languages/solidity/solidity.contribution.ts +24 -0
  343. package/src/basic-languages/solidity/solidity.test.ts +272 -0
  344. package/src/basic-languages/solidity/solidity.ts +1388 -0
  345. package/src/basic-languages/sophia/sophia.contribution.ts +24 -0
  346. package/src/basic-languages/sophia/sophia.test.ts +302 -0
  347. package/src/basic-languages/sophia/sophia.ts +220 -0
  348. package/src/basic-languages/sparql/sparql.contribution.ts +24 -0
  349. package/src/basic-languages/sparql/sparql.test.ts +187 -0
  350. package/src/basic-languages/sparql/sparql.ts +219 -0
  351. package/src/basic-languages/sql/keywords.js +612 -0
  352. package/src/basic-languages/sql/sql.contribution.ts +24 -0
  353. package/src/basic-languages/sql/sql.test.ts +692 -0
  354. package/src/basic-languages/sql/sql.ts +860 -0
  355. package/src/basic-languages/st/st.contribution.ts +24 -0
  356. package/src/basic-languages/st/st.test.ts +139 -0
  357. package/src/basic-languages/st/st.ts +441 -0
  358. package/src/basic-languages/swift/swift.contribution.ts +25 -0
  359. package/src/basic-languages/swift/swift.test.ts +254 -0
  360. package/src/basic-languages/swift/swift.ts +335 -0
  361. package/src/basic-languages/systemverilog/systemverilog.contribution.ts +39 -0
  362. package/src/basic-languages/systemverilog/systemverilog.test.ts +1267 -0
  363. package/src/basic-languages/systemverilog/systemverilog.ts +606 -0
  364. package/src/basic-languages/tcl/tcl.contribution.ts +24 -0
  365. package/src/basic-languages/tcl/tcl.test.ts +107 -0
  366. package/src/basic-languages/tcl/tcl.ts +259 -0
  367. package/src/basic-languages/test/testRunner.ts +63 -0
  368. package/src/basic-languages/twig/twig.contribution.ts +25 -0
  369. package/src/basic-languages/twig/twig.test.ts +1047 -0
  370. package/src/basic-languages/twig/twig.ts +417 -0
  371. package/src/basic-languages/typescript/typescript.contribution.ts +25 -0
  372. package/src/basic-languages/typescript/typescript.test.ts +973 -0
  373. package/src/basic-languages/typescript/typescript.ts +364 -0
  374. package/src/basic-languages/typespec/typespec.contribution.ts +24 -0
  375. package/src/basic-languages/typespec/typespec.test.ts +500 -0
  376. package/src/basic-languages/typespec/typespec.ts +130 -0
  377. package/src/basic-languages/vb/vb.contribution.ts +24 -0
  378. package/src/basic-languages/vb/vb.test.ts +598 -0
  379. package/src/basic-languages/vb/vb.ts +394 -0
  380. package/src/basic-languages/wgsl/wgsl.contribution.ts +24 -0
  381. package/src/basic-languages/wgsl/wgsl.test.ts +3915 -0
  382. package/src/basic-languages/wgsl/wgsl.ts +485 -0
  383. package/src/basic-languages/xml/xml.contribution.ts +44 -0
  384. package/src/basic-languages/xml/xml.test.ts +706 -0
  385. package/src/basic-languages/xml/xml.ts +106 -0
  386. package/src/basic-languages/yaml/yaml.contribution.ts +25 -0
  387. package/src/basic-languages/yaml/yaml.test.ts +670 -0
  388. package/src/basic-languages/yaml/yaml.ts +236 -0
  389. package/src/fillers/editor.api.d.ts +4 -0
  390. package/src/fillers/monaco-editor-core-amd.ts +11 -0
  391. package/src/fillers/monaco-editor-core.ts +6 -0
  392. package/src/language/common/lspLanguageFeatures.ts +1027 -0
  393. package/src/language/css/css.worker.ts +14 -0
  394. package/src/language/css/cssMode.ts +145 -0
  395. package/src/language/css/cssWorker.ts +239 -0
  396. package/src/language/css/monaco.contribution.ts +362 -0
  397. package/src/language/css/workerManager.ts +90 -0
  398. package/src/language/html/html.worker.ts +14 -0
  399. package/src/language/html/htmlMode.ts +171 -0
  400. package/src/language/html/htmlWorker.ts +164 -0
  401. package/src/language/html/monaco.contribution.ts +329 -0
  402. package/src/language/html/workerManager.ts +90 -0
  403. package/src/language/json/json.worker.ts +14 -0
  404. package/src/language/json/jsonMode.ts +185 -0
  405. package/src/language/json/jsonWorker.ts +235 -0
  406. package/src/language/json/monaco.contribution.ts +372 -0
  407. package/src/language/json/tokenization.ts +273 -0
  408. package/src/language/json/workerManager.ts +91 -0
  409. package/src/language/typescript/languageFeatures.ts +1269 -0
  410. package/src/language/typescript/lib/editor.worker.d.ts +8 -0
  411. package/src/language/typescript/lib/lib.index.ts +97 -0
  412. package/src/language/typescript/lib/lib.ts +97 -0
  413. package/src/language/typescript/lib/typescriptServices.d.ts +11717 -0
  414. package/src/language/typescript/lib/typescriptServices.js +190876 -0
  415. package/src/language/typescript/lib/typescriptServicesMetadata.ts +5 -0
  416. package/src/language/typescript/monaco.contribution.ts +815 -0
  417. package/src/language/typescript/ts.worker.ts +19 -0
  418. package/src/language/typescript/tsMode.ts +176 -0
  419. package/src/language/typescript/tsWorker.ts +525 -0
  420. package/src/language/typescript/workerManager.ts +101 -0
  421. package/src/nls-fix.js +39 -0
  422. package/src/tsconfig.json +14 -0
  423. package/test/manual/cross-origin.html +26 -0
  424. package/test/manual/dev-setup.js +218 -0
  425. package/test/manual/diff.html +20 -0
  426. package/test/manual/diff.js +451 -0
  427. package/test/manual/iframe-inner.html +29 -0
  428. package/test/manual/iframe.html +23 -0
  429. package/test/manual/index.css +14 -0
  430. package/test/manual/index.html +44 -0
  431. package/test/manual/index.js +421 -0
  432. package/test/manual/mouse-fixed.html +31 -0
  433. package/test/manual/mouse-scrollable-body.html +286 -0
  434. package/test/manual/mouse-scrollable-element.html +204 -0
  435. package/test/manual/samples/run-editor-failing-js.txt +44 -0
  436. package/test/manual/samples/run-editor-intellisense-js.txt +33 -0
  437. package/test/manual/samples/run-editor-jquery-min-js.txt +30 -0
  438. package/test/manual/samples/run-editor-korean.txt +10 -0
  439. package/test/manual/samples/run-editor-sample-big-css.txt +1 -0
  440. package/test/manual/samples/run-editor-sample-bom-cs.txt +493 -0
  441. package/test/manual/samples/run-editor-sample-cr-ps1.txt +12 -0
  442. package/test/manual/samples/run-editor-sample-dynamic.txt +50 -0
  443. package/test/manual/samples/run-editor-sample-f12-css.txt +31764 -0
  444. package/test/manual/samples/run-editor-sample-html.txt +23 -0
  445. package/test/manual/samples/run-editor-sample-js.txt +222 -0
  446. package/test/manual/samples/run-editor-sample-msn-js.txt +1 -0
  447. package/test/manual/samples.js +287 -0
  448. package/test/manual/shadow-dom.html +56 -0
  449. package/test/manual/transform.html +29 -0
  450. package/test/manual/typescript/custom-worker.html +210 -0
  451. package/test/manual/typescript/custom-worker.js +59 -0
  452. package/test/manual/typescript/index.html +179 -0
  453. package/test/smoke/amd/index.html +21 -0
  454. package/test/smoke/common.js +11 -0
  455. package/test/smoke/esbuild/index.html +11 -0
  456. package/test/smoke/esbuild/index.js +26 -0
  457. package/test/smoke/package-esbuild.ts +60 -0
  458. package/test/smoke/package-vite.ts +19 -0
  459. package/test/smoke/package-webpack.ts +56 -0
  460. package/test/smoke/parcel/index.html +11 -0
  461. package/test/smoke/parcel/index.js +41 -0
  462. package/test/smoke/parcel/package.json +6 -0
  463. package/test/smoke/runner.js +94 -0
  464. package/test/smoke/smoke.test.js +215 -0
  465. package/test/smoke/vite/index.html +10 -0
  466. package/test/smoke/vite/index.js +31 -0
  467. package/test/smoke/webpack/index.html +10 -0
  468. package/test/smoke/webpack/index.js +4 -0
  469. package/test/unit/all.js +70 -0
  470. package/test/unit/setup.js +34 -0
  471. package/webpack-plugin/LICENSE +21 -0
  472. package/webpack-plugin/README.md +116 -0
  473. package/webpack-plugin/package-lock.json +3132 -0
  474. package/webpack-plugin/package.json +45 -0
  475. package/webpack-plugin/tsconfig.json +11 -0
  476. package/website/.prettierrc.json +6 -0
  477. package/website/index/samples/sample.mdx.txt +92 -0
  478. package/website/package.json +60 -0
  479. package/website/scripts/check-playground-samples-js.ts +58 -0
  480. package/website/src/monaco-loader.ts +111 -0
  481. package/website/src/runner/debug.ts +75 -0
  482. package/website/src/runner/index.ts +104 -0
  483. package/website/src/runner/style.scss +35 -0
  484. package/website/src/shared.ts +37 -0
  485. package/website/src/tsconfig.json +19 -0
  486. package/website/src/types.d.ts +13 -0
  487. package/website/src/website/bootstrap.scss +6 -0
  488. package/website/src/website/code-oss.svg +1 -0
  489. package/website/src/website/components/Loader.tsx +40 -0
  490. package/website/src/website/components/Nav.tsx +75 -0
  491. package/website/src/website/components/Page.tsx +11 -0
  492. package/website/src/website/components/Radio.tsx +23 -0
  493. package/website/src/website/components/Select.tsx +75 -0
  494. package/website/src/website/components/TextBox.tsx +21 -0
  495. package/website/src/website/components/bootstrap.tsx +32 -0
  496. package/website/src/website/components/monaco/MonacoEditor.tsx +275 -0
  497. package/website/src/website/components/monaco/MonacoLoader.tsx +39 -0
  498. package/website/src/website/data/diff-sample/modified.txt +212 -0
  499. package/website/src/website/data/diff-sample/original.txt +215 -0
  500. package/website/src/website/data/home-samples/sample.abap.txt +29 -0
  501. package/website/src/website/data/home-samples/sample.aes.txt +38 -0
  502. package/website/src/website/data/home-samples/sample.apex.txt +7 -0
  503. package/website/src/website/data/home-samples/sample.azcli.txt +5 -0
  504. package/website/src/website/data/home-samples/sample.bat.txt +13 -0
  505. package/website/src/website/data/home-samples/sample.bicep.txt +29 -0
  506. package/website/src/website/data/home-samples/sample.c.txt +3463 -0
  507. package/website/src/website/data/home-samples/sample.cameligo.txt +17 -0
  508. package/website/src/website/data/home-samples/sample.clojure.txt +54 -0
  509. package/website/src/website/data/home-samples/sample.coffeescript.txt +28 -0
  510. package/website/src/website/data/home-samples/sample.cpp.txt +246 -0
  511. package/website/src/website/data/home-samples/sample.csharp.txt +38 -0
  512. package/website/src/website/data/home-samples/sample.csp.txt +1 -0
  513. package/website/src/website/data/home-samples/sample.css.txt +828 -0
  514. package/website/src/website/data/home-samples/sample.cypher.txt +3 -0
  515. package/website/src/website/data/home-samples/sample.dart.txt +45 -0
  516. package/website/src/website/data/home-samples/sample.dockerfile.txt +32 -0
  517. package/website/src/website/data/home-samples/sample.ecl.txt +7 -0
  518. package/website/src/website/data/home-samples/sample.elixir.txt +80 -0
  519. package/website/src/website/data/home-samples/sample.flow9.txt +14 -0
  520. package/website/src/website/data/home-samples/sample.freemarker2.tag-angle.interpolation-bracket.txt +61 -0
  521. package/website/src/website/data/home-samples/sample.freemarker2.tag-angle.interpolation-dollar.txt +61 -0
  522. package/website/src/website/data/home-samples/sample.freemarker2.tag-auto.interpolation-bracket.txt +65 -0
  523. package/website/src/website/data/home-samples/sample.freemarker2.tag-auto.interpolation-dollar.txt +65 -0
  524. package/website/src/website/data/home-samples/sample.freemarker2.tag-bracket.interpolation-bracket.txt +61 -0
  525. package/website/src/website/data/home-samples/sample.freemarker2.tag-bracket.interpolation-dollar.txt +61 -0
  526. package/website/src/website/data/home-samples/sample.freemarker2.txt +61 -0
  527. package/website/src/website/data/home-samples/sample.fsharp.txt +8 -0
  528. package/website/src/website/data/home-samples/sample.go.txt +111 -0
  529. package/website/src/website/data/home-samples/sample.graphql.txt +263 -0
  530. package/website/src/website/data/home-samples/sample.handlebars.txt +31 -0
  531. package/website/src/website/data/home-samples/sample.hcl.txt +48 -0
  532. package/website/src/website/data/home-samples/sample.html.txt +100 -0
  533. package/website/src/website/data/home-samples/sample.ini.txt +15 -0
  534. package/website/src/website/data/home-samples/sample.java.txt +54 -0
  535. package/website/src/website/data/home-samples/sample.javascript.txt +214 -0
  536. package/website/src/website/data/home-samples/sample.json.txt +68 -0
  537. package/website/src/website/data/home-samples/sample.julia.txt +23 -0
  538. package/website/src/website/data/home-samples/sample.kotlin.txt +28 -0
  539. package/website/src/website/data/home-samples/sample.less.txt +46 -0
  540. package/website/src/website/data/home-samples/sample.lex.txt +21 -0
  541. package/website/src/website/data/home-samples/sample.lexon.txt +17 -0
  542. package/website/src/website/data/home-samples/sample.liquid.txt +16 -0
  543. package/website/src/website/data/home-samples/sample.lua.txt +12 -0
  544. package/website/src/website/data/home-samples/sample.m3.txt +5 -0
  545. package/website/src/website/data/home-samples/sample.markdown.txt +104 -0
  546. package/website/src/website/data/home-samples/sample.mdx.txt +91 -0
  547. package/website/src/website/data/home-samples/sample.mips.txt +13 -0
  548. package/website/src/website/data/home-samples/sample.msdax.txt +1 -0
  549. package/website/src/website/data/home-samples/sample.mysql.txt +8 -0
  550. package/website/src/website/data/home-samples/sample.objective-c.txt +52 -0
  551. package/website/src/website/data/home-samples/sample.pascal.txt +28 -0
  552. package/website/src/website/data/home-samples/sample.pascaligo.txt +20 -0
  553. package/website/src/website/data/home-samples/sample.pebble.txt +54 -0
  554. package/website/src/website/data/home-samples/sample.perl.txt +18 -0
  555. package/website/src/website/data/home-samples/sample.pgsql.txt +8 -0
  556. package/website/src/website/data/home-samples/sample.php.txt +82 -0
  557. package/website/src/website/data/home-samples/sample.pla.txt +4 -0
  558. package/website/src/website/data/home-samples/sample.plaintext.txt +9 -0
  559. package/website/src/website/data/home-samples/sample.postiats.txt +64 -0
  560. package/website/src/website/data/home-samples/sample.powerquery.txt +12 -0
  561. package/website/src/website/data/home-samples/sample.powershell.txt +30 -0
  562. package/website/src/website/data/home-samples/sample.proto.txt +11 -0
  563. package/website/src/website/data/home-samples/sample.pug.txt +18 -0
  564. package/website/src/website/data/home-samples/sample.python.txt +13 -0
  565. package/website/src/website/data/home-samples/sample.qsharp.txt +45 -0
  566. package/website/src/website/data/home-samples/sample.r.txt +41 -0
  567. package/website/src/website/data/home-samples/sample.razor.txt +46 -0
  568. package/website/src/website/data/home-samples/sample.redis.txt +4 -0
  569. package/website/src/website/data/home-samples/sample.redshift.txt +9 -0
  570. package/website/src/website/data/home-samples/sample.restructuredtext.txt +26 -0
  571. package/website/src/website/data/home-samples/sample.ruby.txt +21 -0
  572. package/website/src/website/data/home-samples/sample.rust.txt +29 -0
  573. package/website/src/website/data/home-samples/sample.sb.txt +10 -0
  574. package/website/src/website/data/home-samples/sample.scala.txt +53 -0
  575. package/website/src/website/data/home-samples/sample.scheme.txt +105 -0
  576. package/website/src/website/data/home-samples/sample.scss.txt +37 -0
  577. package/website/src/website/data/home-samples/sample.shell.txt +42 -0
  578. package/website/src/website/data/home-samples/sample.sol.txt +139 -0
  579. package/website/src/website/data/home-samples/sample.sparql.txt +7 -0
  580. package/website/src/website/data/home-samples/sample.sql.txt +52 -0
  581. package/website/src/website/data/home-samples/sample.st.txt +34 -0
  582. package/website/src/website/data/home-samples/sample.swift.txt +50 -0
  583. package/website/src/website/data/home-samples/sample.systemverilog.txt +28 -0
  584. package/website/src/website/data/home-samples/sample.tcl.txt +18 -0
  585. package/website/src/website/data/home-samples/sample.twig.txt +12 -0
  586. package/website/src/website/data/home-samples/sample.typescript.txt +124 -0
  587. package/website/src/website/data/home-samples/sample.typespec.txt +71 -0
  588. package/website/src/website/data/home-samples/sample.vb.txt +59 -0
  589. package/website/src/website/data/home-samples/sample.verilog.txt +35 -0
  590. package/website/src/website/data/home-samples/sample.wgsl.txt +48 -0
  591. package/website/src/website/data/home-samples/sample.xml.txt +14 -0
  592. package/website/src/website/data/home-samples/sample.yaml.txt +14 -0
  593. package/website/src/website/data/playground-samples/all.js +196 -0
  594. package/website/src/website/data/playground-samples/creating-the-diffeditor/chapter.json +3 -0
  595. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.css +0 -0
  596. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.html +1 -0
  597. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.js +20 -0
  598. package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.json +3 -0
  599. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.css +0 -0
  600. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.html +1 -0
  601. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.js +23 -0
  602. package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.json +3 -0
  603. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.css +0 -0
  604. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.html +1 -0
  605. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.js +20 -0
  606. package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.json +3 -0
  607. package/website/src/website/data/playground-samples/creating-the-editor/chapter.json +4 -0
  608. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.css +0 -0
  609. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.html +1 -0
  610. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.js +19 -0
  611. package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.json +3 -0
  612. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.css +0 -0
  613. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.html +1 -0
  614. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.js +13 -0
  615. package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.json +3 -0
  616. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.css +0 -0
  617. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.html +1 -0
  618. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js +10 -0
  619. package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.json +4 -0
  620. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.css +0 -0
  621. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.html +35 -0
  622. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.js +4 -0
  623. package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.json +3 -0
  624. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.css +0 -0
  625. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.html +8 -0
  626. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js +35 -0
  627. package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.json +4 -0
  628. package/website/src/website/data/playground-samples/customizing-the-appearence/chapter.json +3 -0
  629. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.css +0 -0
  630. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.html +1 -0
  631. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.js +150 -0
  632. package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.json +3 -0
  633. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.css +13 -0
  634. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.html +1 -0
  635. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.js +32 -0
  636. package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.json +3 -0
  637. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.css +0 -0
  638. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.html +1 -0
  639. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.js +40 -0
  640. package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.json +3 -0
  641. package/website/src/website/data/playground-samples/extending-language-services/chapter.json +3 -0
  642. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.css +0 -0
  643. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.html +1 -0
  644. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.js +39 -0
  645. package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.json +3 -0
  646. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.css +0 -0
  647. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.html +1 -0
  648. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js +71 -0
  649. package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.json +3 -0
  650. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.css +0 -0
  651. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.html +1 -0
  652. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.js +69 -0
  653. package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.json +3 -0
  654. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.css +0 -0
  655. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.html +1 -0
  656. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.js +46 -0
  657. package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.json +3 -0
  658. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.css +0 -0
  659. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.html +1 -0
  660. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.js +42 -0
  661. package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.json +3 -0
  662. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.css +0 -0
  663. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.html +1 -0
  664. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.js +137 -0
  665. package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.json +3 -0
  666. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.css +0 -0
  667. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.html +1 -0
  668. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.js +74 -0
  669. package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.json +3 -0
  670. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.css +0 -0
  671. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.html +1 -0
  672. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.js +62 -0
  673. package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.json +3 -0
  674. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.css +0 -0
  675. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.html +1 -0
  676. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.js +47 -0
  677. package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.json +3 -0
  678. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.css +0 -0
  679. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.html +1 -0
  680. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.js +50 -0
  681. package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.json +3 -0
  682. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.css +0 -0
  683. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.html +1 -0
  684. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.js +168 -0
  685. package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.json +3 -0
  686. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.css +0 -0
  687. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.html +1 -0
  688. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.js +480 -0
  689. package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.json +3 -0
  690. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.css +0 -0
  691. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.html +1 -0
  692. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.js +43 -0
  693. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.json +3 -0
  694. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.css +0 -0
  695. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.html +1 -0
  696. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.js +49 -0
  697. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.json +3 -0
  698. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.css +0 -0
  699. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.html +1 -0
  700. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.js +52 -0
  701. package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.json +3 -0
  702. package/website/src/website/data/playground-samples/interacting-with-the-editor/chapter.json +3 -0
  703. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.css +0 -0
  704. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.html +1 -0
  705. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.js +37 -0
  706. package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.json +3 -0
  707. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.css +13 -0
  708. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.html +1 -0
  709. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.js +30 -0
  710. package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.json +3 -0
  711. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.css +0 -0
  712. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.html +1 -0
  713. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.js +11 -0
  714. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.json +3 -0
  715. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.css +6 -0
  716. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.html +5 -0
  717. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.js +114 -0
  718. package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.json +3 -0
  719. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css +7 -0
  720. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.html +1 -0
  721. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.js +30 -0
  722. package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.json +3 -0
  723. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.css +0 -0
  724. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.html +1 -0
  725. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.js +41 -0
  726. package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.json +3 -0
  727. package/website/src/website/index.tsx +10 -0
  728. package/website/src/website/monaco-loader-chunk.ts +15 -0
  729. package/website/src/website/monacoEditorVersion.ts +8 -0
  730. package/website/src/website/pages/App.tsx +21 -0
  731. package/website/src/website/pages/DocsPage.tsx +103 -0
  732. package/website/src/website/pages/MonarchPage.tsx +16 -0
  733. package/website/src/website/pages/home/Home.tsx +249 -0
  734. package/website/src/website/pages/playground/BisectModel.ts +161 -0
  735. package/website/src/website/pages/playground/LocationModel.ts +216 -0
  736. package/website/src/website/pages/playground/PlaygroundModel.ts +355 -0
  737. package/website/src/website/pages/playground/PlaygroundPage.tsx +31 -0
  738. package/website/src/website/pages/playground/PlaygroundPageContent.tsx +587 -0
  739. package/website/src/website/pages/playground/Preview.tsx +129 -0
  740. package/website/src/website/pages/playground/SettingsDialog.tsx +412 -0
  741. package/website/src/website/pages/playground/SettingsModel.ts +198 -0
  742. package/website/src/website/pages/playground/Source.ts +107 -0
  743. package/website/src/website/pages/playground/getNpmVersionsSync.ts +450 -0
  744. package/website/src/website/pages/playground/playgroundExamples.tsx +88 -0
  745. package/website/src/website/pages/playground/utils.ts +28 -0
  746. package/website/src/website/pages/routes.ts +28 -0
  747. package/website/src/website/style.scss +96 -0
  748. package/website/src/website/utils/Debouncer.ts +28 -0
  749. package/website/src/website/utils/ObservableHistory.ts +89 -0
  750. package/website/src/website/utils/ObservablePromise.ts +49 -0
  751. package/website/src/website/utils/hotComponent.tsx +49 -0
  752. package/website/src/website/utils/lzmaCompressor.ts +39 -0
  753. package/website/src/website/utils/ref.ts +39 -0
  754. package/website/src/website/utils/types.d.ts +28 -0
  755. package/website/src/website/utils/utils.ts +58 -0
  756. package/website/static/monarch/monarch-34px.png +0 -0
  757. package/website/static/monarch/monarch.css +297 -0
  758. package/website/static/monarch/monarch.js +178 -0
  759. package/website/static/monarch-static.html +5345 -0
  760. package/website/tsconfig.json +16 -0
  761. package/website/tslint.json +6 -0
  762. package/website/typedoc/tsconfig.json +8 -0
  763. package/website/typedoc/typedoc.json +11 -0
  764. package/website/vscode-web-editors.tgz +0 -0
  765. package/website/webpack.config.ts +151 -0
  766. package/website/yarn.lock +3612 -0
@@ -0,0 +1,2073 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ /* To generate an initial baseline from a .proto file, uncomment:
7
+
8
+ import { readFileSync } from 'fs';
9
+
10
+ const lines = readFileSync('/home/tochi/code/scratches/proto2_advanced.proto', {
11
+ encoding: 'utf-8'
12
+ }).split(/\r?\n/);
13
+
14
+ testTokenization('protobuf', [
15
+ lines.map((line) => ({
16
+ line,
17
+ tokens: []
18
+ }))
19
+ ]);
20
+ */
21
+
22
+ import { testTokenization } from '../test/testRunner';
23
+
24
+ testTokenization('proto', [
25
+ // proto3 example file: https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#proto_file
26
+ [
27
+ {
28
+ line: 'syntax = "proto3";',
29
+ tokens: [
30
+ { startIndex: 0, type: 'keyword.proto' },
31
+ { startIndex: 6, type: 'white.proto' },
32
+ { startIndex: 7, type: 'operators.proto' },
33
+ { startIndex: 8, type: 'white.proto' },
34
+ { startIndex: 9, type: 'string.quote.proto' },
35
+ { startIndex: 10, type: 'string.proto' },
36
+ { startIndex: 16, type: 'string.quote.proto' },
37
+ { startIndex: 17, type: 'delimiter.proto' }
38
+ ]
39
+ },
40
+ {
41
+ line: 'import public "other.proto";',
42
+ tokens: [
43
+ { startIndex: 0, type: 'keyword.proto' },
44
+ { startIndex: 6, type: 'white.proto' },
45
+ { startIndex: 7, type: 'keyword.proto' },
46
+ { startIndex: 13, type: 'white.proto' },
47
+ { startIndex: 14, type: 'string.quote.proto' },
48
+ { startIndex: 15, type: 'string.proto' },
49
+ { startIndex: 26, type: 'string.quote.proto' },
50
+ { startIndex: 27, type: 'delimiter.proto' }
51
+ ]
52
+ },
53
+ {
54
+ line: 'option java_package = "com.example.foo";',
55
+ tokens: [
56
+ { startIndex: 0, type: 'keyword.proto' },
57
+ { startIndex: 6, type: 'white.proto' },
58
+ { startIndex: 7, type: 'annotation.proto' },
59
+ { startIndex: 19, type: 'white.proto' },
60
+ { startIndex: 20, type: 'operator.proto' },
61
+ { startIndex: 21, type: 'white.proto' },
62
+ { startIndex: 22, type: 'string.quote.proto' },
63
+ { startIndex: 23, type: 'string.proto' },
64
+ { startIndex: 38, type: 'string.quote.proto' },
65
+ { startIndex: 39, type: 'delimiter.proto' }
66
+ ]
67
+ },
68
+ {
69
+ line: 'enum EnumAllowingAlias {',
70
+ tokens: [
71
+ { startIndex: 0, type: 'keyword.proto' },
72
+ { startIndex: 4, type: 'white.proto' },
73
+ { startIndex: 5, type: 'type.identifier.proto' },
74
+ { startIndex: 22, type: 'white.proto' },
75
+ { startIndex: 23, type: 'delimiter.curly.proto' }
76
+ ]
77
+ },
78
+ {
79
+ line: ' option allow_alias = true;',
80
+ tokens: [
81
+ { startIndex: 0, type: 'white.proto' },
82
+ { startIndex: 2, type: 'keyword.proto' },
83
+ { startIndex: 8, type: 'white.proto' },
84
+ { startIndex: 9, type: 'annotation.proto' },
85
+ { startIndex: 20, type: 'white.proto' },
86
+ { startIndex: 21, type: 'operator.proto' },
87
+ { startIndex: 22, type: 'white.proto' },
88
+ { startIndex: 23, type: 'keyword.constant.proto' },
89
+ { startIndex: 27, type: 'delimiter.proto' }
90
+ ]
91
+ },
92
+ {
93
+ line: ' UNKNOWN = 0;',
94
+ tokens: [
95
+ { startIndex: 0, type: 'white.proto' },
96
+ { startIndex: 2, type: 'identifier.proto' },
97
+ { startIndex: 9, type: 'white.proto' },
98
+ { startIndex: 10, type: 'operators.proto' },
99
+ { startIndex: 11, type: 'white.proto' },
100
+ { startIndex: 12, type: 'number.octal.proto' },
101
+ { startIndex: 13, type: 'delimiter.proto' }
102
+ ]
103
+ },
104
+ {
105
+ line: ' STARTED = 1;',
106
+ tokens: [
107
+ { startIndex: 0, type: 'white.proto' },
108
+ { startIndex: 2, type: 'identifier.proto' },
109
+ { startIndex: 9, type: 'white.proto' },
110
+ { startIndex: 10, type: 'operators.proto' },
111
+ { startIndex: 11, type: 'white.proto' },
112
+ { startIndex: 12, type: 'number.proto' },
113
+ { startIndex: 13, type: 'delimiter.proto' }
114
+ ]
115
+ },
116
+ {
117
+ line: ' RUNNING = 2 [(custom_option) = "hello world"];',
118
+ tokens: [
119
+ { startIndex: 0, type: 'white.proto' },
120
+ { startIndex: 2, type: 'identifier.proto' },
121
+ { startIndex: 9, type: 'white.proto' },
122
+ { startIndex: 10, type: 'operators.proto' },
123
+ { startIndex: 11, type: 'white.proto' },
124
+ { startIndex: 12, type: 'number.proto' },
125
+ { startIndex: 13, type: 'white.proto' },
126
+ { startIndex: 14, type: 'delimiter.square.proto' },
127
+ { startIndex: 15, type: 'annotation.proto' },
128
+ { startIndex: 30, type: 'white.proto' },
129
+ { startIndex: 31, type: 'operator.proto' },
130
+ { startIndex: 32, type: 'white.proto' },
131
+ { startIndex: 33, type: 'string.quote.proto' },
132
+ { startIndex: 34, type: 'string.proto' },
133
+ { startIndex: 45, type: 'string.quote.proto' },
134
+ { startIndex: 46, type: 'delimiter.square.proto' },
135
+ { startIndex: 47, type: 'delimiter.proto' }
136
+ ]
137
+ },
138
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
139
+ {
140
+ line: 'message Outer {',
141
+ tokens: [
142
+ { startIndex: 0, type: 'keyword.proto' },
143
+ { startIndex: 7, type: 'white.proto' },
144
+ { startIndex: 8, type: 'type.identifier.proto' },
145
+ { startIndex: 13, type: 'white.proto' },
146
+ { startIndex: 14, type: 'delimiter.curly.proto' }
147
+ ]
148
+ },
149
+ {
150
+ line: ' option (my_option).a = true;',
151
+ tokens: [
152
+ { startIndex: 0, type: 'white.proto' },
153
+ { startIndex: 2, type: 'keyword.proto' },
154
+ { startIndex: 8, type: 'white.proto' },
155
+ { startIndex: 9, type: 'annotation.proto' },
156
+ { startIndex: 22, type: 'white.proto' },
157
+ { startIndex: 23, type: 'operator.proto' },
158
+ { startIndex: 24, type: 'white.proto' },
159
+ { startIndex: 25, type: 'keyword.constant.proto' },
160
+ { startIndex: 29, type: 'delimiter.proto' }
161
+ ]
162
+ },
163
+ {
164
+ line: ' message Inner { // Level 2',
165
+ tokens: [
166
+ { startIndex: 0, type: 'white.proto' },
167
+ { startIndex: 2, type: 'keyword.proto' },
168
+ { startIndex: 9, type: 'white.proto' },
169
+ { startIndex: 10, type: 'type.identifier.proto' },
170
+ { startIndex: 15, type: 'white.proto' },
171
+ { startIndex: 16, type: 'delimiter.curly.proto' },
172
+ { startIndex: 17, type: 'white.proto' },
173
+ { startIndex: 20, type: 'comment.proto' }
174
+ ]
175
+ },
176
+ {
177
+ line: ' int64 ival = 1;',
178
+ tokens: [
179
+ { startIndex: 0, type: 'white.proto' },
180
+ { startIndex: 4, type: 'keyword.proto' },
181
+ { startIndex: 9, type: 'white.proto' },
182
+ { startIndex: 10, type: 'identifier.proto' },
183
+ { startIndex: 14, type: 'white.proto' },
184
+ { startIndex: 15, type: 'delimiter.proto' },
185
+ { startIndex: 16, type: 'white.proto' },
186
+ { startIndex: 17, type: 'number.proto' },
187
+ { startIndex: 18, type: 'delimiter.proto' }
188
+ ]
189
+ },
190
+ {
191
+ line: ' }',
192
+ tokens: [
193
+ { startIndex: 0, type: 'white.proto' },
194
+ { startIndex: 2, type: 'delimiter.curly.proto' }
195
+ ]
196
+ },
197
+ {
198
+ line: ' repeated Inner inner_message = 2;',
199
+ tokens: [
200
+ { startIndex: 0, type: 'white.proto' },
201
+ { startIndex: 2, type: 'keyword.proto' },
202
+ { startIndex: 10, type: 'white.proto' },
203
+ { startIndex: 11, type: 'type.identifier.proto' },
204
+ { startIndex: 16, type: 'white.proto' },
205
+ { startIndex: 17, type: 'identifier.proto' },
206
+ { startIndex: 30, type: 'white.proto' },
207
+ { startIndex: 31, type: 'delimiter.proto' },
208
+ { startIndex: 32, type: 'white.proto' },
209
+ { startIndex: 33, type: 'number.proto' },
210
+ { startIndex: 34, type: 'delimiter.proto' }
211
+ ]
212
+ },
213
+ {
214
+ line: ' EnumAllowingAlias enum_field =3;',
215
+ tokens: [
216
+ { startIndex: 0, type: 'white.proto' },
217
+ { startIndex: 2, type: 'type.identifier.proto' },
218
+ { startIndex: 19, type: 'white.proto' },
219
+ { startIndex: 20, type: 'identifier.proto' },
220
+ { startIndex: 30, type: 'white.proto' },
221
+ { startIndex: 31, type: 'delimiter.proto' },
222
+ { startIndex: 32, type: 'number.proto' },
223
+ { startIndex: 33, type: 'delimiter.proto' }
224
+ ]
225
+ },
226
+ {
227
+ line: ' map<int32, string> my_map = 4;',
228
+ tokens: [
229
+ { startIndex: 0, type: 'white.proto' },
230
+ { startIndex: 2, type: 'keyword.proto' },
231
+ { startIndex: 5, type: 'delimiter.angle.proto' },
232
+ { startIndex: 6, type: 'keyword.proto' },
233
+ { startIndex: 11, type: 'delimiter.proto' },
234
+ { startIndex: 12, type: 'white.proto' },
235
+ { startIndex: 13, type: 'keyword.proto' },
236
+ { startIndex: 19, type: 'delimiter.angle.proto' },
237
+ { startIndex: 20, type: 'white.proto' },
238
+ { startIndex: 21, type: 'identifier.proto' },
239
+ { startIndex: 27, type: 'white.proto' },
240
+ { startIndex: 28, type: 'operators.proto' },
241
+ { startIndex: 29, type: 'white.proto' },
242
+ { startIndex: 30, type: 'number.proto' },
243
+ { startIndex: 31, type: 'delimiter.proto' }
244
+ ]
245
+ },
246
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] }
247
+ ],
248
+ // proto2 example file: https://developers.google.com/protocol-buffers/docs/reference/proto2-spec#proto_file
249
+ [
250
+ {
251
+ line: 'syntax = "proto2";',
252
+ tokens: [
253
+ { startIndex: 0, type: 'keyword.proto' },
254
+ { startIndex: 6, type: 'white.proto' },
255
+ { startIndex: 7, type: 'operators.proto' },
256
+ { startIndex: 8, type: 'white.proto' },
257
+ { startIndex: 9, type: 'string.quote.proto' },
258
+ { startIndex: 10, type: 'string.proto' },
259
+ { startIndex: 16, type: 'string.quote.proto' },
260
+ { startIndex: 17, type: 'delimiter.proto' }
261
+ ]
262
+ },
263
+ {
264
+ line: 'import public "other.proto";',
265
+ tokens: [
266
+ { startIndex: 0, type: 'keyword.proto' },
267
+ { startIndex: 6, type: 'white.proto' },
268
+ { startIndex: 7, type: 'keyword.proto' },
269
+ { startIndex: 13, type: 'white.proto' },
270
+ { startIndex: 14, type: 'string.quote.proto' },
271
+ { startIndex: 15, type: 'string.proto' },
272
+ { startIndex: 26, type: 'string.quote.proto' },
273
+ { startIndex: 27, type: 'delimiter.proto' }
274
+ ]
275
+ },
276
+ {
277
+ line: 'option java_package = "com.example.foo";',
278
+ tokens: [
279
+ { startIndex: 0, type: 'keyword.proto' },
280
+ { startIndex: 6, type: 'white.proto' },
281
+ { startIndex: 7, type: 'annotation.proto' },
282
+ { startIndex: 19, type: 'white.proto' },
283
+ { startIndex: 20, type: 'operator.proto' },
284
+ { startIndex: 21, type: 'white.proto' },
285
+ { startIndex: 22, type: 'string.quote.proto' },
286
+ { startIndex: 23, type: 'string.proto' },
287
+ { startIndex: 38, type: 'string.quote.proto' },
288
+ { startIndex: 39, type: 'delimiter.proto' }
289
+ ]
290
+ },
291
+ {
292
+ line: 'enum EnumAllowingAlias {',
293
+ tokens: [
294
+ { startIndex: 0, type: 'keyword.proto' },
295
+ { startIndex: 4, type: 'white.proto' },
296
+ { startIndex: 5, type: 'type.identifier.proto' },
297
+ { startIndex: 22, type: 'white.proto' },
298
+ { startIndex: 23, type: 'delimiter.curly.proto' }
299
+ ]
300
+ },
301
+ {
302
+ line: ' option allow_alias = true;',
303
+ tokens: [
304
+ { startIndex: 0, type: 'white.proto' },
305
+ { startIndex: 2, type: 'keyword.proto' },
306
+ { startIndex: 8, type: 'white.proto' },
307
+ { startIndex: 9, type: 'annotation.proto' },
308
+ { startIndex: 20, type: 'white.proto' },
309
+ { startIndex: 21, type: 'operator.proto' },
310
+ { startIndex: 22, type: 'white.proto' },
311
+ { startIndex: 23, type: 'keyword.constant.proto' },
312
+ { startIndex: 27, type: 'delimiter.proto' }
313
+ ]
314
+ },
315
+ {
316
+ line: ' UNKNOWN = 0;',
317
+ tokens: [
318
+ { startIndex: 0, type: 'white.proto' },
319
+ { startIndex: 2, type: 'identifier.proto' },
320
+ { startIndex: 9, type: 'white.proto' },
321
+ { startIndex: 10, type: 'operators.proto' },
322
+ { startIndex: 11, type: 'white.proto' },
323
+ { startIndex: 12, type: 'number.octal.proto' },
324
+ { startIndex: 13, type: 'delimiter.proto' }
325
+ ]
326
+ },
327
+ {
328
+ line: ' STARTED = 1;',
329
+ tokens: [
330
+ { startIndex: 0, type: 'white.proto' },
331
+ { startIndex: 2, type: 'identifier.proto' },
332
+ { startIndex: 9, type: 'white.proto' },
333
+ { startIndex: 10, type: 'operators.proto' },
334
+ { startIndex: 11, type: 'white.proto' },
335
+ { startIndex: 12, type: 'number.proto' },
336
+ { startIndex: 13, type: 'delimiter.proto' }
337
+ ]
338
+ },
339
+ {
340
+ line: ' RUNNING = 2 [(custom_option) = "hello world"];',
341
+ tokens: [
342
+ { startIndex: 0, type: 'white.proto' },
343
+ { startIndex: 2, type: 'identifier.proto' },
344
+ { startIndex: 9, type: 'white.proto' },
345
+ { startIndex: 10, type: 'operators.proto' },
346
+ { startIndex: 11, type: 'white.proto' },
347
+ { startIndex: 12, type: 'number.proto' },
348
+ { startIndex: 13, type: 'white.proto' },
349
+ { startIndex: 14, type: 'delimiter.square.proto' },
350
+ { startIndex: 15, type: 'annotation.proto' },
351
+ { startIndex: 30, type: 'white.proto' },
352
+ { startIndex: 31, type: 'operator.proto' },
353
+ { startIndex: 32, type: 'white.proto' },
354
+ { startIndex: 33, type: 'string.quote.proto' },
355
+ { startIndex: 34, type: 'string.proto' },
356
+ { startIndex: 45, type: 'string.quote.proto' },
357
+ { startIndex: 46, type: 'delimiter.square.proto' },
358
+ { startIndex: 47, type: 'delimiter.proto' }
359
+ ]
360
+ },
361
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
362
+ {
363
+ line: 'message Outer {',
364
+ tokens: [
365
+ { startIndex: 0, type: 'keyword.proto' },
366
+ { startIndex: 7, type: 'white.proto' },
367
+ { startIndex: 8, type: 'type.identifier.proto' },
368
+ { startIndex: 13, type: 'white.proto' },
369
+ { startIndex: 14, type: 'delimiter.curly.proto' }
370
+ ]
371
+ },
372
+ {
373
+ line: ' option (my_option).a = true;',
374
+ tokens: [
375
+ { startIndex: 0, type: 'white.proto' },
376
+ { startIndex: 2, type: 'keyword.proto' },
377
+ { startIndex: 8, type: 'white.proto' },
378
+ { startIndex: 9, type: 'annotation.proto' },
379
+ { startIndex: 22, type: 'white.proto' },
380
+ { startIndex: 23, type: 'operator.proto' },
381
+ { startIndex: 24, type: 'white.proto' },
382
+ { startIndex: 25, type: 'keyword.constant.proto' },
383
+ { startIndex: 29, type: 'delimiter.proto' }
384
+ ]
385
+ },
386
+ {
387
+ line: ' message Inner { // Level 2',
388
+ tokens: [
389
+ { startIndex: 0, type: 'white.proto' },
390
+ { startIndex: 2, type: 'keyword.proto' },
391
+ { startIndex: 9, type: 'white.proto' },
392
+ { startIndex: 10, type: 'type.identifier.proto' },
393
+ { startIndex: 15, type: 'white.proto' },
394
+ { startIndex: 16, type: 'delimiter.curly.proto' },
395
+ { startIndex: 17, type: 'white.proto' },
396
+ { startIndex: 20, type: 'comment.proto' }
397
+ ]
398
+ },
399
+ {
400
+ line: ' required int64 ival = 1;',
401
+ tokens: [
402
+ { startIndex: 0, type: 'white.proto' },
403
+ { startIndex: 4, type: 'keyword.proto' },
404
+ { startIndex: 12, type: 'white.proto' },
405
+ { startIndex: 13, type: 'keyword.proto' },
406
+ { startIndex: 18, type: 'white.proto' },
407
+ { startIndex: 19, type: 'identifier.proto' },
408
+ { startIndex: 23, type: 'white.proto' },
409
+ { startIndex: 24, type: 'delimiter.proto' },
410
+ { startIndex: 25, type: 'white.proto' },
411
+ { startIndex: 26, type: 'number.proto' },
412
+ { startIndex: 27, type: 'delimiter.proto' }
413
+ ]
414
+ },
415
+ {
416
+ line: ' }',
417
+ tokens: [
418
+ { startIndex: 0, type: 'white.proto' },
419
+ { startIndex: 2, type: 'delimiter.curly.proto' }
420
+ ]
421
+ },
422
+ {
423
+ line: ' repeated Inner inner_message = 2;',
424
+ tokens: [
425
+ { startIndex: 0, type: 'white.proto' },
426
+ { startIndex: 2, type: 'keyword.proto' },
427
+ { startIndex: 10, type: 'white.proto' },
428
+ { startIndex: 11, type: 'type.identifier.proto' },
429
+ { startIndex: 16, type: 'white.proto' },
430
+ { startIndex: 17, type: 'identifier.proto' },
431
+ { startIndex: 30, type: 'white.proto' },
432
+ { startIndex: 31, type: 'delimiter.proto' },
433
+ { startIndex: 32, type: 'white.proto' },
434
+ { startIndex: 33, type: 'number.proto' },
435
+ { startIndex: 34, type: 'delimiter.proto' }
436
+ ]
437
+ },
438
+ {
439
+ line: ' optional EnumAllowingAlias enum_field = 3;',
440
+ tokens: [
441
+ { startIndex: 0, type: 'white.proto' },
442
+ { startIndex: 2, type: 'keyword.proto' },
443
+ { startIndex: 10, type: 'white.proto' },
444
+ { startIndex: 11, type: 'type.identifier.proto' },
445
+ { startIndex: 28, type: 'white.proto' },
446
+ { startIndex: 29, type: 'identifier.proto' },
447
+ { startIndex: 39, type: 'white.proto' },
448
+ { startIndex: 40, type: 'delimiter.proto' },
449
+ { startIndex: 41, type: 'white.proto' },
450
+ { startIndex: 42, type: 'number.proto' },
451
+ { startIndex: 43, type: 'delimiter.proto' }
452
+ ]
453
+ },
454
+ {
455
+ line: ' map<int32, string> my_map = 4;',
456
+ tokens: [
457
+ { startIndex: 0, type: 'white.proto' },
458
+ { startIndex: 2, type: 'keyword.proto' },
459
+ { startIndex: 5, type: 'delimiter.angle.proto' },
460
+ { startIndex: 6, type: 'keyword.proto' },
461
+ { startIndex: 11, type: 'delimiter.proto' },
462
+ { startIndex: 12, type: 'white.proto' },
463
+ { startIndex: 13, type: 'keyword.proto' },
464
+ { startIndex: 19, type: 'delimiter.angle.proto' },
465
+ { startIndex: 20, type: 'white.proto' },
466
+ { startIndex: 21, type: 'identifier.proto' },
467
+ { startIndex: 27, type: 'white.proto' },
468
+ { startIndex: 28, type: 'operators.proto' },
469
+ { startIndex: 29, type: 'white.proto' },
470
+ { startIndex: 30, type: 'number.proto' },
471
+ { startIndex: 31, type: 'delimiter.proto' }
472
+ ]
473
+ },
474
+ {
475
+ line: ' extensions 20 to 30;',
476
+ tokens: [
477
+ { startIndex: 0, type: 'white.proto' },
478
+ { startIndex: 2, type: 'keyword.proto' },
479
+ { startIndex: 12, type: 'white.proto' },
480
+ { startIndex: 13, type: 'number.proto' },
481
+ { startIndex: 15, type: 'white.proto' },
482
+ { startIndex: 16, type: 'keyword.proto' },
483
+ { startIndex: 18, type: 'white.proto' },
484
+ { startIndex: 19, type: 'number.proto' },
485
+ { startIndex: 21, type: 'delimiter.proto' }
486
+ ]
487
+ },
488
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
489
+ {
490
+ line: 'message Foo {',
491
+ tokens: [
492
+ { startIndex: 0, type: 'keyword.proto' },
493
+ { startIndex: 7, type: 'white.proto' },
494
+ { startIndex: 8, type: 'type.identifier.proto' },
495
+ { startIndex: 11, type: 'white.proto' },
496
+ { startIndex: 12, type: 'delimiter.curly.proto' }
497
+ ]
498
+ },
499
+ {
500
+ line: ' optional group GroupMessage {',
501
+ tokens: [
502
+ { startIndex: 0, type: 'white.proto' },
503
+ { startIndex: 2, type: 'keyword.proto' },
504
+ { startIndex: 10, type: 'white.proto' },
505
+ { startIndex: 11, type: 'keyword.proto' },
506
+ { startIndex: 16, type: 'white.proto' },
507
+ { startIndex: 17, type: 'identifier.proto' },
508
+ { startIndex: 29, type: 'white.proto' },
509
+ { startIndex: 30, type: 'delimiter.curly.proto' }
510
+ ]
511
+ },
512
+ {
513
+ line: ' optional a = 1;',
514
+ tokens: [
515
+ { startIndex: 0, type: 'white.proto' },
516
+ { startIndex: 4, type: 'keyword.proto' },
517
+ { startIndex: 12, type: 'white.proto' },
518
+ { startIndex: 13, type: 'identifier.proto' },
519
+ { startIndex: 14, type: 'white.proto' },
520
+ { startIndex: 15, type: 'delimiter.proto' },
521
+ { startIndex: 16, type: 'white.proto' },
522
+ { startIndex: 17, type: 'number.proto' },
523
+ { startIndex: 18, type: 'delimiter.proto' }
524
+ ]
525
+ },
526
+ {
527
+ line: ' }',
528
+ tokens: [
529
+ { startIndex: 0, type: 'white.proto' },
530
+ { startIndex: 2, type: 'delimiter.curly.proto' }
531
+ ]
532
+ },
533
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] }
534
+ ],
535
+ // proto3 edge cases
536
+ [
537
+ {
538
+ line: 'syntax = "proto3";',
539
+ tokens: [
540
+ { startIndex: 0, type: 'keyword.proto' },
541
+ { startIndex: 6, type: 'white.proto' },
542
+ { startIndex: 7, type: 'operators.proto' },
543
+ { startIndex: 8, type: 'white.proto' },
544
+ { startIndex: 9, type: 'string.quote.proto' },
545
+ { startIndex: 10, type: 'string.proto' },
546
+ { startIndex: 16, type: 'string.quote.proto' },
547
+ { startIndex: 17, type: 'delimiter.proto' }
548
+ ]
549
+ },
550
+ { line: '', tokens: [] },
551
+ {
552
+ line: 'package foo . /**/ bar;',
553
+ tokens: [
554
+ { startIndex: 0, type: 'keyword.proto' },
555
+ { startIndex: 7, type: 'white.proto' },
556
+ { startIndex: 8, type: 'identifier.proto' },
557
+ { startIndex: 11, type: 'white.proto' },
558
+ { startIndex: 12, type: 'delimiter.proto' },
559
+ { startIndex: 13, type: 'white.proto' },
560
+ { startIndex: 14, type: 'comment.proto' },
561
+ { startIndex: 18, type: 'white.proto' },
562
+ { startIndex: 20, type: 'identifier.proto' },
563
+ { startIndex: 23, type: 'delimiter.proto' }
564
+ ]
565
+ },
566
+ { line: '', tokens: [] },
567
+ {
568
+ line: 'import public "options.proto";',
569
+ tokens: [
570
+ { startIndex: 0, type: 'keyword.proto' },
571
+ { startIndex: 6, type: 'white.proto' },
572
+ { startIndex: 7, type: 'keyword.proto' },
573
+ { startIndex: 13, type: 'white.proto' },
574
+ { startIndex: 14, type: 'string.quote.proto' },
575
+ { startIndex: 15, type: 'string.proto' },
576
+ { startIndex: 28, type: 'string.quote.proto' },
577
+ { startIndex: 29, type: 'delimiter.proto' }
578
+ ]
579
+ },
580
+ { line: '', tokens: [] },
581
+ {
582
+ line: 'option java_package = "com.example.foo";',
583
+ tokens: [
584
+ { startIndex: 0, type: 'keyword.proto' },
585
+ { startIndex: 6, type: 'white.proto' },
586
+ { startIndex: 7, type: 'annotation.proto' },
587
+ { startIndex: 19, type: 'white.proto' },
588
+ { startIndex: 20, type: 'operator.proto' },
589
+ { startIndex: 21, type: 'white.proto' },
590
+ { startIndex: 22, type: 'string.quote.proto' },
591
+ { startIndex: 23, type: 'string.proto' },
592
+ { startIndex: 38, type: 'string.quote.proto' },
593
+ { startIndex: 39, type: 'delimiter.proto' }
594
+ ]
595
+ },
596
+ { line: '', tokens: [] },
597
+ {
598
+ line: 'message Foo {',
599
+ tokens: [
600
+ { startIndex: 0, type: 'keyword.proto' },
601
+ { startIndex: 7, type: 'white.proto' },
602
+ { startIndex: 8, type: 'type.identifier.proto' },
603
+ { startIndex: 11, type: 'white.proto' },
604
+ { startIndex: 12, type: 'delimiter.curly.proto' }
605
+ ]
606
+ },
607
+ {
608
+ line: ' foo.bar.Bar nested_message = 2;',
609
+ tokens: [
610
+ { startIndex: 0, type: 'white.proto' },
611
+ { startIndex: 2, type: 'type.identifier.proto' },
612
+ { startIndex: 13, type: 'white.proto' },
613
+ { startIndex: 14, type: 'identifier.proto' },
614
+ { startIndex: 28, type: 'white.proto' },
615
+ { startIndex: 29, type: 'delimiter.proto' },
616
+ { startIndex: 30, type: 'white.proto' },
617
+ { startIndex: 31, type: 'number.proto' },
618
+ { startIndex: 32, type: 'delimiter.proto' }
619
+ ]
620
+ },
621
+ {
622
+ line: ' repeated int32 samples = 3 [packed=true];',
623
+ tokens: [
624
+ { startIndex: 0, type: 'white.proto' },
625
+ { startIndex: 2, type: 'keyword.proto' },
626
+ { startIndex: 10, type: 'white.proto' },
627
+ { startIndex: 11, type: 'keyword.proto' },
628
+ { startIndex: 16, type: 'white.proto' },
629
+ { startIndex: 17, type: 'identifier.proto' },
630
+ { startIndex: 24, type: 'white.proto' },
631
+ { startIndex: 25, type: 'delimiter.proto' },
632
+ { startIndex: 26, type: 'white.proto' },
633
+ { startIndex: 27, type: 'number.proto' },
634
+ { startIndex: 28, type: 'white.proto' },
635
+ { startIndex: 29, type: 'delimiter.square.proto' },
636
+ { startIndex: 30, type: 'annotation.proto' },
637
+ { startIndex: 36, type: 'operator.proto' },
638
+ { startIndex: 37, type: 'keyword.constant.proto' },
639
+ { startIndex: 41, type: 'delimiter.square.proto' },
640
+ { startIndex: 42, type: 'delimiter.proto' }
641
+ ]
642
+ },
643
+ {
644
+ line: ' oneof foo {',
645
+ tokens: [
646
+ { startIndex: 0, type: 'white.proto' },
647
+ { startIndex: 2, type: 'keyword.proto' },
648
+ { startIndex: 7, type: 'white.proto' },
649
+ { startIndex: 8, type: 'identifier.proto' },
650
+ { startIndex: 11, type: 'white.proto' },
651
+ { startIndex: 12, type: 'delimiter.curly.proto' }
652
+ ]
653
+ },
654
+ {
655
+ line: ' string name = 4;',
656
+ tokens: [
657
+ { startIndex: 0, type: 'white.proto' },
658
+ { startIndex: 4, type: 'keyword.proto' },
659
+ { startIndex: 10, type: 'white.proto' },
660
+ { startIndex: 11, type: 'identifier.proto' },
661
+ { startIndex: 15, type: 'white.proto' },
662
+ { startIndex: 16, type: 'delimiter.proto' },
663
+ { startIndex: 17, type: 'white.proto' },
664
+ { startIndex: 18, type: 'number.proto' },
665
+ { startIndex: 19, type: 'delimiter.proto' }
666
+ ]
667
+ },
668
+ {
669
+ line: ' Bar sub_message = 92;',
670
+ tokens: [
671
+ { startIndex: 0, type: 'white.proto' },
672
+ { startIndex: 4, type: 'type.identifier.proto' },
673
+ { startIndex: 7, type: 'white.proto' },
674
+ { startIndex: 8, type: 'identifier.proto' },
675
+ { startIndex: 19, type: 'white.proto' },
676
+ { startIndex: 20, type: 'delimiter.proto' },
677
+ { startIndex: 21, type: 'white.proto' },
678
+ { startIndex: 22, type: 'number.proto' },
679
+ { startIndex: 24, type: 'delimiter.proto' }
680
+ ]
681
+ },
682
+ {
683
+ line: ' }',
684
+ tokens: [
685
+ { startIndex: 0, type: 'white.proto' },
686
+ { startIndex: 2, type: 'delimiter.curly.proto' }
687
+ ]
688
+ },
689
+ {
690
+ line: ' reserved 5, 15, 203 to 30;',
691
+ tokens: [
692
+ { startIndex: 0, type: 'white.proto' },
693
+ { startIndex: 2, type: 'keyword.proto' },
694
+ { startIndex: 10, type: 'white.proto' },
695
+ { startIndex: 11, type: 'number.proto' },
696
+ { startIndex: 12, type: 'delimiter.proto' },
697
+ { startIndex: 13, type: 'white.proto' },
698
+ { startIndex: 14, type: 'number.proto' },
699
+ { startIndex: 16, type: 'delimiter.proto' },
700
+ { startIndex: 17, type: 'white.proto' },
701
+ { startIndex: 18, type: 'number.proto' },
702
+ { startIndex: 21, type: 'white.proto' },
703
+ { startIndex: 22, type: 'keyword.proto' },
704
+ { startIndex: 24, type: 'white.proto' },
705
+ { startIndex: 25, type: 'number.proto' },
706
+ { startIndex: 27, type: 'delimiter.proto' }
707
+ ]
708
+ },
709
+ {
710
+ line: ' reserved "$46_ _$%$%\\"bar" "baz";',
711
+ tokens: [
712
+ { startIndex: 0, type: 'white.proto' },
713
+ { startIndex: 2, type: 'keyword.proto' },
714
+ { startIndex: 10, type: 'white.proto' },
715
+ { startIndex: 11, type: 'string.quote.proto' },
716
+ { startIndex: 12, type: 'string.proto' },
717
+ { startIndex: 22, type: 'string.escape.invalid.proto' },
718
+ { startIndex: 24, type: 'string.proto' },
719
+ { startIndex: 27, type: 'string.quote.proto' },
720
+ { startIndex: 28, type: 'white.proto' },
721
+ { startIndex: 29, type: 'string.quote.proto' },
722
+ { startIndex: 30, type: 'string.proto' },
723
+ { startIndex: 33, type: 'string.quote.proto' },
724
+ { startIndex: 34, type: 'delimiter.proto' }
725
+ ]
726
+ },
727
+ {
728
+ line: ' reserved 100 to max ;',
729
+ tokens: [
730
+ { startIndex: 0, type: 'white.proto' },
731
+ { startIndex: 2, type: 'keyword.proto' },
732
+ { startIndex: 10, type: 'white.proto' },
733
+ { startIndex: 11, type: 'number.proto' },
734
+ { startIndex: 14, type: 'white.proto' },
735
+ { startIndex: 15, type: 'keyword.proto' },
736
+ { startIndex: 17, type: 'white.proto' },
737
+ { startIndex: 18, type: 'keyword.proto' },
738
+ { startIndex: 21, type: 'white.proto' },
739
+ { startIndex: 22, type: 'delimiter.proto' }
740
+ ]
741
+ },
742
+ {
743
+ line: ' string baz = 10;',
744
+ tokens: [
745
+ { startIndex: 0, type: 'white.proto' },
746
+ { startIndex: 2, type: 'keyword.proto' },
747
+ { startIndex: 8, type: 'white.proto' },
748
+ { startIndex: 9, type: 'identifier.proto' },
749
+ { startIndex: 12, type: 'white.proto' },
750
+ { startIndex: 13, type: 'delimiter.proto' },
751
+ { startIndex: 14, type: 'white.proto' },
752
+ { startIndex: 15, type: 'number.proto' },
753
+ { startIndex: 17, type: 'delimiter.proto' }
754
+ ]
755
+ },
756
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
757
+ { line: '', tokens: [] },
758
+ { line: 'message', tokens: [{ startIndex: 0, type: 'keyword.proto' }] },
759
+ {
760
+ line: 'map {}',
761
+ tokens: [
762
+ { startIndex: 0, type: 'type.identifier.proto' },
763
+ { startIndex: 3, type: 'white.proto' },
764
+ { startIndex: 4, type: 'delimiter.curly.proto' }
765
+ ]
766
+ },
767
+ { line: '', tokens: [] },
768
+ {
769
+ line: 'message Bar {',
770
+ tokens: [
771
+ { startIndex: 0, type: 'keyword.proto' },
772
+ { startIndex: 7, type: 'white.proto' },
773
+ { startIndex: 8, type: 'type.identifier.proto' },
774
+ { startIndex: 11, type: 'white.proto' },
775
+ { startIndex: 12, type: 'delimiter.curly.proto' }
776
+ ]
777
+ },
778
+ {
779
+ line: ' int32 x = 1;',
780
+ tokens: [
781
+ { startIndex: 0, type: 'white.proto' },
782
+ { startIndex: 2, type: 'keyword.proto' },
783
+ { startIndex: 7, type: 'white.proto' },
784
+ { startIndex: 8, type: 'identifier.proto' },
785
+ { startIndex: 9, type: 'white.proto' },
786
+ { startIndex: 10, type: 'delimiter.proto' },
787
+ { startIndex: 11, type: 'white.proto' },
788
+ { startIndex: 12, type: 'number.proto' },
789
+ { startIndex: 13, type: 'delimiter.proto' }
790
+ ]
791
+ },
792
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
793
+ { line: '', tokens: [] },
794
+ {
795
+ line: 'message int32 {}',
796
+ tokens: [
797
+ { startIndex: 0, type: 'keyword.proto' },
798
+ { startIndex: 7, type: 'white.proto' },
799
+ { startIndex: 8, type: 'type.identifier.proto' },
800
+ { startIndex: 13, type: 'white.proto' },
801
+ { startIndex: 14, type: 'delimiter.curly.proto' }
802
+ ]
803
+ },
804
+ { line: '', tokens: [] },
805
+ {
806
+ line: 'enum EnumAllowingAlias {',
807
+ tokens: [
808
+ { startIndex: 0, type: 'keyword.proto' },
809
+ { startIndex: 4, type: 'white.proto' },
810
+ { startIndex: 5, type: 'type.identifier.proto' },
811
+ { startIndex: 22, type: 'white.proto' },
812
+ { startIndex: 23, type: 'delimiter.curly.proto' }
813
+ ]
814
+ },
815
+ {
816
+ line: ' option allow_alias = true;',
817
+ tokens: [
818
+ { startIndex: 0, type: 'white.proto' },
819
+ { startIndex: 2, type: 'keyword.proto' },
820
+ { startIndex: 8, type: 'white.proto' },
821
+ { startIndex: 9, type: 'annotation.proto' },
822
+ { startIndex: 20, type: 'white.proto' },
823
+ { startIndex: 21, type: 'operator.proto' },
824
+ { startIndex: 22, type: 'white.proto' },
825
+ { startIndex: 23, type: 'keyword.constant.proto' },
826
+ { startIndex: 27, type: 'delimiter.proto' }
827
+ ]
828
+ },
829
+ {
830
+ line: ' uNkNoWN2 = 0;',
831
+ tokens: [
832
+ { startIndex: 0, type: 'white.proto' },
833
+ { startIndex: 2, type: 'identifier.proto' },
834
+ { startIndex: 10, type: 'white.proto' },
835
+ { startIndex: 11, type: 'operators.proto' },
836
+ { startIndex: 12, type: 'white.proto' },
837
+ { startIndex: 13, type: 'number.octal.proto' },
838
+ { startIndex: 14, type: 'delimiter.proto' }
839
+ ]
840
+ },
841
+ {
842
+ line: ' ENUM_ALLOWING_ALIAS_UNKNOWN = 0;',
843
+ tokens: [
844
+ { startIndex: 0, type: 'white.proto' },
845
+ { startIndex: 2, type: 'identifier.proto' },
846
+ { startIndex: 29, type: 'white.proto' },
847
+ { startIndex: 30, type: 'operators.proto' },
848
+ { startIndex: 31, type: 'white.proto' },
849
+ { startIndex: 32, type: 'number.octal.proto' },
850
+ { startIndex: 33, type: 'delimiter.proto' }
851
+ ]
852
+ },
853
+ {
854
+ line: ' STARTED = 1;',
855
+ tokens: [
856
+ { startIndex: 0, type: 'white.proto' },
857
+ { startIndex: 2, type: 'identifier.proto' },
858
+ { startIndex: 9, type: 'white.proto' },
859
+ { startIndex: 10, type: 'operators.proto' },
860
+ { startIndex: 11, type: 'white.proto' },
861
+ { startIndex: 12, type: 'number.proto' },
862
+ { startIndex: 13, type: 'delimiter.proto' }
863
+ ]
864
+ },
865
+ {
866
+ line: " running = 2 [( /***/ custom_option) = 'hello world'];",
867
+ tokens: [
868
+ { startIndex: 0, type: 'white.proto' },
869
+ { startIndex: 2, type: 'identifier.proto' },
870
+ { startIndex: 9, type: 'white.proto' },
871
+ { startIndex: 10, type: 'operators.proto' },
872
+ { startIndex: 11, type: 'white.proto' },
873
+ { startIndex: 12, type: 'number.proto' },
874
+ { startIndex: 13, type: 'white.proto' },
875
+ { startIndex: 14, type: 'delimiter.square.proto' },
876
+ { startIndex: 15, type: 'annotation.brackets.proto' },
877
+ { startIndex: 16, type: 'white.proto' },
878
+ { startIndex: 17, type: 'comment.proto' },
879
+ { startIndex: 22, type: 'white.proto' },
880
+ { startIndex: 23, type: 'annotation.proto' },
881
+ { startIndex: 36, type: 'annotation.brackets.proto' },
882
+ { startIndex: 37, type: 'white.proto' },
883
+ { startIndex: 38, type: 'operator.proto' },
884
+ { startIndex: 39, type: 'white.proto' },
885
+ { startIndex: 40, type: 'string.quote.proto' },
886
+ { startIndex: 41, type: 'string.proto' },
887
+ { startIndex: 52, type: 'string.quote.proto' },
888
+ { startIndex: 53, type: 'delimiter.square.proto' },
889
+ { startIndex: 54, type: 'delimiter.proto' }
890
+ ]
891
+ },
892
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
893
+ { line: '', tokens: [] },
894
+ {
895
+ line: 'message Outer {',
896
+ tokens: [
897
+ { startIndex: 0, type: 'keyword.proto' },
898
+ { startIndex: 7, type: 'white.proto' },
899
+ { startIndex: 8, type: 'type.identifier.proto' },
900
+ { startIndex: 13, type: 'white.proto' },
901
+ { startIndex: 14, type: 'delimiter.curly.proto' }
902
+ ]
903
+ },
904
+ {
905
+ line: ' option (my_option).a= true;',
906
+ tokens: [
907
+ { startIndex: 0, type: 'white.proto' },
908
+ { startIndex: 2, type: 'keyword.proto' },
909
+ { startIndex: 8, type: 'white.proto' },
910
+ { startIndex: 9, type: 'annotation.proto' },
911
+ { startIndex: 22, type: 'operator.proto' },
912
+ { startIndex: 23, type: 'white.proto' },
913
+ { startIndex: 24, type: 'keyword.constant.proto' },
914
+ { startIndex: 28, type: 'delimiter.proto' }
915
+ ]
916
+ },
917
+ {
918
+ line: ' message Inner { // Level 2',
919
+ tokens: [
920
+ { startIndex: 0, type: 'white.proto' },
921
+ { startIndex: 2, type: 'keyword.proto' },
922
+ { startIndex: 9, type: 'white.proto' },
923
+ { startIndex: 10, type: 'type.identifier.proto' },
924
+ { startIndex: 15, type: 'white.proto' },
925
+ { startIndex: 16, type: 'delimiter.curly.proto' },
926
+ { startIndex: 17, type: 'white.proto' },
927
+ { startIndex: 20, type: 'comment.proto' }
928
+ ]
929
+ },
930
+ {
931
+ line: ' int64 ival = 1;',
932
+ tokens: [
933
+ { startIndex: 0, type: 'white.proto' },
934
+ { startIndex: 4, type: 'keyword.proto' },
935
+ { startIndex: 9, type: 'white.proto' },
936
+ { startIndex: 10, type: 'identifier.proto' },
937
+ { startIndex: 14, type: 'white.proto' },
938
+ { startIndex: 15, type: 'delimiter.proto' },
939
+ { startIndex: 16, type: 'white.proto' },
940
+ { startIndex: 17, type: 'number.proto' },
941
+ { startIndex: 18, type: 'delimiter.proto' }
942
+ ]
943
+ },
944
+ {
945
+ line: ' }',
946
+ tokens: [
947
+ { startIndex: 0, type: 'white.proto' },
948
+ { startIndex: 2, type: 'delimiter.curly.proto' }
949
+ ]
950
+ },
951
+ {
952
+ line: ' repeated Inner inner_message = 2;',
953
+ tokens: [
954
+ { startIndex: 0, type: 'white.proto' },
955
+ { startIndex: 2, type: 'keyword.proto' },
956
+ { startIndex: 10, type: 'white.proto' },
957
+ { startIndex: 11, type: 'type.identifier.proto' },
958
+ { startIndex: 16, type: 'white.proto' },
959
+ { startIndex: 17, type: 'identifier.proto' },
960
+ { startIndex: 30, type: 'white.proto' },
961
+ { startIndex: 31, type: 'delimiter.proto' },
962
+ { startIndex: 32, type: 'white.proto' },
963
+ { startIndex: 33, type: 'number.proto' },
964
+ { startIndex: 34, type: 'delimiter.proto' }
965
+ ]
966
+ },
967
+ {
968
+ line: ' foo .bar',
969
+ tokens: [
970
+ { startIndex: 0, type: 'white.proto' },
971
+ { startIndex: 2, type: 'type.identifier.proto' }
972
+ ]
973
+ },
974
+ {
975
+ line: ' /**/ .EnumAllowingAlias enum_field =3;',
976
+ tokens: [
977
+ { startIndex: 0, type: 'white.proto' },
978
+ { startIndex: 3, type: 'comment.proto' },
979
+ { startIndex: 7, type: 'white.proto' },
980
+ { startIndex: 8, type: 'type.identifier.proto' },
981
+ { startIndex: 26, type: 'white.proto' },
982
+ { startIndex: 27, type: 'identifier.proto' },
983
+ { startIndex: 37, type: 'white.proto' },
984
+ { startIndex: 38, type: 'delimiter.proto' },
985
+ { startIndex: 39, type: 'number.proto' },
986
+ { startIndex: 40, type: 'delimiter.proto' }
987
+ ]
988
+ },
989
+ {
990
+ line: ' map my_map = 4;',
991
+ tokens: [
992
+ { startIndex: 0, type: 'white.proto' },
993
+ { startIndex: 2, type: 'type.identifier.proto' },
994
+ { startIndex: 5, type: 'white.proto' },
995
+ { startIndex: 6, type: 'identifier.proto' },
996
+ { startIndex: 12, type: 'white.proto' },
997
+ { startIndex: 13, type: 'delimiter.proto' },
998
+ { startIndex: 14, type: 'white.proto' },
999
+ { startIndex: 15, type: 'number.proto' },
1000
+ { startIndex: 16, type: 'delimiter.proto' }
1001
+ ]
1002
+ },
1003
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1004
+ { line: '', tokens: [] },
1005
+ {
1006
+ line: 'message message {',
1007
+ tokens: [
1008
+ { startIndex: 0, type: 'keyword.proto' },
1009
+ { startIndex: 7, type: 'white.proto' },
1010
+ { startIndex: 8, type: 'type.identifier.proto' },
1011
+ { startIndex: 15, type: 'white.proto' },
1012
+ { startIndex: 16, type: 'delimiter.curly.proto' }
1013
+ ]
1014
+ },
1015
+ {
1016
+ line: ' repeated Foo enum = 1;',
1017
+ tokens: [
1018
+ { startIndex: 0, type: 'white.proto' },
1019
+ { startIndex: 2, type: 'keyword.proto' },
1020
+ { startIndex: 10, type: 'white.proto' },
1021
+ { startIndex: 11, type: 'type.identifier.proto' },
1022
+ { startIndex: 14, type: 'white.proto' },
1023
+ { startIndex: 15, type: 'identifier.proto' },
1024
+ { startIndex: 19, type: 'white.proto' },
1025
+ { startIndex: 20, type: 'delimiter.proto' },
1026
+ { startIndex: 21, type: 'white.proto' },
1027
+ { startIndex: 22, type: 'number.proto' },
1028
+ { startIndex: 23, type: 'delimiter.proto' }
1029
+ ]
1030
+ },
1031
+ {
1032
+ line: ' Foo int32 = 2;',
1033
+ tokens: [
1034
+ { startIndex: 0, type: 'white.proto' },
1035
+ { startIndex: 2, type: 'type.identifier.proto' },
1036
+ { startIndex: 5, type: 'white.proto' },
1037
+ { startIndex: 6, type: 'identifier.proto' },
1038
+ { startIndex: 11, type: 'white.proto' },
1039
+ { startIndex: 12, type: 'delimiter.proto' },
1040
+ { startIndex: 13, type: 'white.proto' },
1041
+ { startIndex: 14, type: 'number.proto' },
1042
+ { startIndex: 15, type: 'delimiter.proto' }
1043
+ ]
1044
+ },
1045
+ {
1046
+ line: ' service x = 3;',
1047
+ tokens: [
1048
+ { startIndex: 0, type: 'white.proto' },
1049
+ { startIndex: 2, type: 'type.identifier.proto' },
1050
+ { startIndex: 9, type: 'white.proto' },
1051
+ { startIndex: 10, type: 'identifier.proto' },
1052
+ { startIndex: 11, type: 'white.proto' },
1053
+ { startIndex: 12, type: 'delimiter.proto' },
1054
+ { startIndex: 13, type: 'white.proto' },
1055
+ { startIndex: 14, type: 'number.proto' },
1056
+ { startIndex: 15, type: 'delimiter.proto' }
1057
+ ]
1058
+ },
1059
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1060
+ { line: '', tokens: [] },
1061
+ {
1062
+ line: 'message service {}',
1063
+ tokens: [
1064
+ { startIndex: 0, type: 'keyword.proto' },
1065
+ { startIndex: 7, type: 'white.proto' },
1066
+ { startIndex: 8, type: 'type.identifier.proto' },
1067
+ { startIndex: 15, type: 'white.proto' },
1068
+ { startIndex: 16, type: 'delimiter.curly.proto' }
1069
+ ]
1070
+ },
1071
+ { line: '', tokens: [] },
1072
+ {
1073
+ line: '/** SearchService does nothing and returns the string "foo"',
1074
+ tokens: [{ startIndex: 0, type: 'comment.proto' }]
1075
+ },
1076
+ { line: '*/', tokens: [{ startIndex: 0, type: 'comment.proto' }] },
1077
+ {
1078
+ line: 'service SearchService {',
1079
+ tokens: [
1080
+ { startIndex: 0, type: 'keyword.proto' },
1081
+ { startIndex: 7, type: 'white.proto' },
1082
+ { startIndex: 8, type: 'identifier.proto' },
1083
+ { startIndex: 21, type: 'white.proto' },
1084
+ { startIndex: 22, type: 'delimiter.curly.proto' }
1085
+ ]
1086
+ },
1087
+ {
1088
+ line: ' rpc Search (stream SearchRequest) returns (SearchResponse) {',
1089
+ tokens: [
1090
+ { startIndex: 0, type: 'white.proto' },
1091
+ { startIndex: 2, type: 'keyword.proto' },
1092
+ { startIndex: 5, type: 'white.proto' },
1093
+ { startIndex: 6, type: 'identifier.proto' },
1094
+ { startIndex: 12, type: 'white.proto' },
1095
+ { startIndex: 13, type: 'delimiter.parenthesis.proto' },
1096
+ { startIndex: 14, type: 'keyword.proto' },
1097
+ { startIndex: 20, type: 'white.proto' },
1098
+ { startIndex: 21, type: 'type.identifier.proto' },
1099
+ { startIndex: 34, type: 'delimiter.parenthesis.proto' },
1100
+ { startIndex: 35, type: 'white.proto' },
1101
+ { startIndex: 36, type: 'keyword.proto' },
1102
+ { startIndex: 43, type: 'white.proto' },
1103
+ { startIndex: 44, type: 'delimiter.parenthesis.proto' },
1104
+ { startIndex: 45, type: 'type.identifier.proto' },
1105
+ { startIndex: 59, type: 'delimiter.parenthesis.proto' },
1106
+ { startIndex: 60, type: 'white.proto' },
1107
+ { startIndex: 61, type: 'delimiter.curly.proto' }
1108
+ ]
1109
+ },
1110
+ {
1111
+ line: ' option (method_option) = {',
1112
+ tokens: [
1113
+ { startIndex: 0, type: 'white.proto' },
1114
+ { startIndex: 4, type: 'keyword.proto' },
1115
+ { startIndex: 10, type: 'white.proto' },
1116
+ { startIndex: 11, type: 'annotation.proto' },
1117
+ { startIndex: 26, type: 'white.proto' },
1118
+ { startIndex: 27, type: 'operator.proto' },
1119
+ { startIndex: 28, type: 'white.proto' },
1120
+ { startIndex: 29, type: 'delimiter.curly.proto' }
1121
+ ]
1122
+ },
1123
+ {
1124
+ line: ' method_id: 2;',
1125
+ tokens: [
1126
+ { startIndex: 0, type: 'white.proto' },
1127
+ { startIndex: 6, type: 'identifier.proto' },
1128
+ { startIndex: 15, type: 'delimiter.proto' },
1129
+ { startIndex: 16, type: 'white.proto' },
1130
+ { startIndex: 17, type: 'number.proto' },
1131
+ { startIndex: 18, type: 'delimiter.proto' }
1132
+ ]
1133
+ },
1134
+ {
1135
+ line: ' method_name: "hello";',
1136
+ tokens: [
1137
+ { startIndex: 0, type: 'white.proto' },
1138
+ { startIndex: 6, type: 'identifier.proto' },
1139
+ { startIndex: 17, type: 'delimiter.proto' },
1140
+ { startIndex: 18, type: 'white.proto' },
1141
+ { startIndex: 19, type: 'string.quote.proto' },
1142
+ { startIndex: 20, type: 'string.proto' },
1143
+ { startIndex: 25, type: 'string.quote.proto' },
1144
+ { startIndex: 26, type: 'delimiter.proto' }
1145
+ ]
1146
+ },
1147
+ {
1148
+ line: ' method_sla: 9.807E+4;',
1149
+ tokens: [
1150
+ { startIndex: 0, type: 'white.proto' },
1151
+ { startIndex: 6, type: 'identifier.proto' },
1152
+ { startIndex: 16, type: 'delimiter.proto' },
1153
+ { startIndex: 17, type: 'white.proto' },
1154
+ { startIndex: 18, type: 'number.proto' },
1155
+ { startIndex: 19, type: 'number.float.proto' },
1156
+ { startIndex: 26, type: 'delimiter.proto' }
1157
+ ]
1158
+ },
1159
+ {
1160
+ line: ' };',
1161
+ tokens: [
1162
+ { startIndex: 0, type: 'white.proto' },
1163
+ { startIndex: 4, type: 'delimiter.curly.proto' },
1164
+ { startIndex: 5, type: 'delimiter.proto' }
1165
+ ]
1166
+ },
1167
+ {
1168
+ line: ' };',
1169
+ tokens: [
1170
+ { startIndex: 0, type: 'white.proto' },
1171
+ { startIndex: 2, type: 'delimiter.curly.proto' },
1172
+ { startIndex: 3, type: 'delimiter.proto' }
1173
+ ]
1174
+ },
1175
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1176
+ { line: '', tokens: [] },
1177
+ {
1178
+ line: 'message SearchRequest {};',
1179
+ tokens: [
1180
+ { startIndex: 0, type: 'keyword.proto' },
1181
+ { startIndex: 7, type: 'white.proto' },
1182
+ { startIndex: 8, type: 'type.identifier.proto' },
1183
+ { startIndex: 21, type: 'white.proto' },
1184
+ { startIndex: 22, type: 'delimiter.curly.proto' },
1185
+ { startIndex: 24, type: 'delimiter.proto' }
1186
+ ]
1187
+ },
1188
+ {
1189
+ line: 'message SearchResponse {',
1190
+ tokens: [
1191
+ { startIndex: 0, type: 'keyword.proto' },
1192
+ { startIndex: 7, type: 'white.proto' },
1193
+ { startIndex: 8, type: 'type.identifier.proto' },
1194
+ { startIndex: 22, type: 'white.proto' },
1195
+ { startIndex: 23, type: 'delimiter.curly.proto' }
1196
+ ]
1197
+ },
1198
+ {
1199
+ line: ' string response = 1;',
1200
+ tokens: [
1201
+ { startIndex: 0, type: 'white.proto' },
1202
+ { startIndex: 2, type: 'keyword.proto' },
1203
+ { startIndex: 8, type: 'white.proto' },
1204
+ { startIndex: 9, type: 'identifier.proto' },
1205
+ { startIndex: 17, type: 'white.proto' },
1206
+ { startIndex: 18, type: 'delimiter.proto' },
1207
+ { startIndex: 19, type: 'white.proto' },
1208
+ { startIndex: 20, type: 'number.proto' },
1209
+ { startIndex: 21, type: 'delimiter.proto' }
1210
+ ]
1211
+ },
1212
+ {
1213
+ line: '};',
1214
+ tokens: [
1215
+ { startIndex: 0, type: 'delimiter.curly.proto' },
1216
+ { startIndex: 1, type: 'delimiter.proto' }
1217
+ ]
1218
+ }
1219
+ ],
1220
+ // proto2 edge cases
1221
+ [
1222
+ {
1223
+ line: 'syntax = "proto2";',
1224
+ tokens: [
1225
+ { startIndex: 0, type: 'keyword.proto' },
1226
+ { startIndex: 6, type: 'white.proto' },
1227
+ { startIndex: 7, type: 'operators.proto' },
1228
+ { startIndex: 8, type: 'white.proto' },
1229
+ { startIndex: 9, type: 'string.quote.proto' },
1230
+ { startIndex: 10, type: 'string.proto' },
1231
+ { startIndex: 16, type: 'string.quote.proto' },
1232
+ { startIndex: 17, type: 'delimiter.proto' }
1233
+ ]
1234
+ },
1235
+ { line: '', tokens: [] },
1236
+ {
1237
+ line: 'package foo . /**/ bar;',
1238
+ tokens: [
1239
+ { startIndex: 0, type: 'keyword.proto' },
1240
+ { startIndex: 7, type: 'white.proto' },
1241
+ { startIndex: 8, type: 'identifier.proto' },
1242
+ { startIndex: 11, type: 'white.proto' },
1243
+ { startIndex: 12, type: 'delimiter.proto' },
1244
+ { startIndex: 13, type: 'white.proto' },
1245
+ { startIndex: 14, type: 'comment.proto' },
1246
+ { startIndex: 18, type: 'white.proto' },
1247
+ { startIndex: 20, type: 'identifier.proto' },
1248
+ { startIndex: 23, type: 'delimiter.proto' }
1249
+ ]
1250
+ },
1251
+ { line: '', tokens: [] },
1252
+ {
1253
+ line: 'import public "options.proto";',
1254
+ tokens: [
1255
+ { startIndex: 0, type: 'keyword.proto' },
1256
+ { startIndex: 6, type: 'white.proto' },
1257
+ { startIndex: 7, type: 'keyword.proto' },
1258
+ { startIndex: 13, type: 'white.proto' },
1259
+ { startIndex: 14, type: 'string.quote.proto' },
1260
+ { startIndex: 15, type: 'string.proto' },
1261
+ { startIndex: 28, type: 'string.quote.proto' },
1262
+ { startIndex: 29, type: 'delimiter.proto' }
1263
+ ]
1264
+ },
1265
+ { line: '', tokens: [] },
1266
+ {
1267
+ line: 'option java_package = "com.example.foo";',
1268
+ tokens: [
1269
+ { startIndex: 0, type: 'keyword.proto' },
1270
+ { startIndex: 6, type: 'white.proto' },
1271
+ { startIndex: 7, type: 'annotation.proto' },
1272
+ { startIndex: 19, type: 'white.proto' },
1273
+ { startIndex: 20, type: 'operator.proto' },
1274
+ { startIndex: 21, type: 'white.proto' },
1275
+ { startIndex: 22, type: 'string.quote.proto' },
1276
+ { startIndex: 23, type: 'string.proto' },
1277
+ { startIndex: 38, type: 'string.quote.proto' },
1278
+ { startIndex: 39, type: 'delimiter.proto' }
1279
+ ]
1280
+ },
1281
+ { line: '', tokens: [] },
1282
+ {
1283
+ line: 'message Foo {',
1284
+ tokens: [
1285
+ { startIndex: 0, type: 'keyword.proto' },
1286
+ { startIndex: 7, type: 'white.proto' },
1287
+ { startIndex: 8, type: 'type.identifier.proto' },
1288
+ { startIndex: 11, type: 'white.proto' },
1289
+ { startIndex: 12, type: 'delimiter.curly.proto' }
1290
+ ]
1291
+ },
1292
+ {
1293
+ line: ' required foo.bar.Bar nested_message = 2;',
1294
+ tokens: [
1295
+ { startIndex: 0, type: 'white.proto' },
1296
+ { startIndex: 2, type: 'keyword.proto' },
1297
+ { startIndex: 10, type: 'white.proto' },
1298
+ { startIndex: 11, type: 'type.identifier.proto' },
1299
+ { startIndex: 22, type: 'white.proto' },
1300
+ { startIndex: 23, type: 'identifier.proto' },
1301
+ { startIndex: 37, type: 'white.proto' },
1302
+ { startIndex: 38, type: 'delimiter.proto' },
1303
+ { startIndex: 39, type: 'white.proto' },
1304
+ { startIndex: 40, type: 'number.proto' },
1305
+ { startIndex: 41, type: 'delimiter.proto' }
1306
+ ]
1307
+ },
1308
+ {
1309
+ line: ' repeated int32 samples = 3 [packed=true];',
1310
+ tokens: [
1311
+ { startIndex: 0, type: 'white.proto' },
1312
+ { startIndex: 2, type: 'keyword.proto' },
1313
+ { startIndex: 10, type: 'white.proto' },
1314
+ { startIndex: 11, type: 'keyword.proto' },
1315
+ { startIndex: 16, type: 'white.proto' },
1316
+ { startIndex: 17, type: 'identifier.proto' },
1317
+ { startIndex: 24, type: 'white.proto' },
1318
+ { startIndex: 25, type: 'delimiter.proto' },
1319
+ { startIndex: 26, type: 'white.proto' },
1320
+ { startIndex: 27, type: 'number.proto' },
1321
+ { startIndex: 28, type: 'white.proto' },
1322
+ { startIndex: 29, type: 'delimiter.square.proto' },
1323
+ { startIndex: 30, type: 'annotation.proto' },
1324
+ { startIndex: 36, type: 'operator.proto' },
1325
+ { startIndex: 37, type: 'keyword.constant.proto' },
1326
+ { startIndex: 41, type: 'delimiter.square.proto' },
1327
+ { startIndex: 42, type: 'delimiter.proto' }
1328
+ ]
1329
+ },
1330
+ {
1331
+ line: ' oneof foo {',
1332
+ tokens: [
1333
+ { startIndex: 0, type: 'white.proto' },
1334
+ { startIndex: 2, type: 'keyword.proto' },
1335
+ { startIndex: 7, type: 'white.proto' },
1336
+ { startIndex: 8, type: 'identifier.proto' },
1337
+ { startIndex: 11, type: 'white.proto' },
1338
+ { startIndex: 12, type: 'delimiter.curly.proto' }
1339
+ ]
1340
+ },
1341
+ {
1342
+ line: ' string name = 4;',
1343
+ tokens: [
1344
+ { startIndex: 0, type: 'white.proto' },
1345
+ { startIndex: 4, type: 'keyword.proto' },
1346
+ { startIndex: 10, type: 'white.proto' },
1347
+ { startIndex: 11, type: 'identifier.proto' },
1348
+ { startIndex: 15, type: 'white.proto' },
1349
+ { startIndex: 16, type: 'delimiter.proto' },
1350
+ { startIndex: 17, type: 'white.proto' },
1351
+ { startIndex: 18, type: 'number.proto' },
1352
+ { startIndex: 19, type: 'delimiter.proto' }
1353
+ ]
1354
+ },
1355
+ {
1356
+ line: ' Bar sub_message = 6;',
1357
+ tokens: [
1358
+ { startIndex: 0, type: 'white.proto' },
1359
+ { startIndex: 4, type: 'type.identifier.proto' },
1360
+ { startIndex: 7, type: 'white.proto' },
1361
+ { startIndex: 8, type: 'identifier.proto' },
1362
+ { startIndex: 19, type: 'white.proto' },
1363
+ { startIndex: 20, type: 'delimiter.proto' },
1364
+ { startIndex: 21, type: 'white.proto' },
1365
+ { startIndex: 22, type: 'number.proto' },
1366
+ { startIndex: 23, type: 'delimiter.proto' }
1367
+ ]
1368
+ },
1369
+ {
1370
+ line: ' }',
1371
+ tokens: [
1372
+ { startIndex: 0, type: 'white.proto' },
1373
+ { startIndex: 2, type: 'delimiter.curly.proto' }
1374
+ ]
1375
+ },
1376
+ {
1377
+ line: ' reserved 5, 15, 20 to 30;',
1378
+ tokens: [
1379
+ { startIndex: 0, type: 'white.proto' },
1380
+ { startIndex: 2, type: 'keyword.proto' },
1381
+ { startIndex: 10, type: 'white.proto' },
1382
+ { startIndex: 11, type: 'number.proto' },
1383
+ { startIndex: 12, type: 'delimiter.proto' },
1384
+ { startIndex: 13, type: 'white.proto' },
1385
+ { startIndex: 14, type: 'number.proto' },
1386
+ { startIndex: 16, type: 'delimiter.proto' },
1387
+ { startIndex: 17, type: 'white.proto' },
1388
+ { startIndex: 18, type: 'number.proto' },
1389
+ { startIndex: 20, type: 'white.proto' },
1390
+ { startIndex: 21, type: 'keyword.proto' },
1391
+ { startIndex: 23, type: 'white.proto' },
1392
+ { startIndex: 24, type: 'number.proto' },
1393
+ { startIndex: 26, type: 'delimiter.proto' }
1394
+ ]
1395
+ },
1396
+ {
1397
+ line: ' reserved \'bar\' "baz";',
1398
+ tokens: [
1399
+ { startIndex: 0, type: 'white.proto' },
1400
+ { startIndex: 2, type: 'keyword.proto' },
1401
+ { startIndex: 10, type: 'white.proto' },
1402
+ { startIndex: 11, type: 'string.quote.proto' },
1403
+ { startIndex: 12, type: 'string.proto' },
1404
+ { startIndex: 15, type: 'string.quote.proto' },
1405
+ { startIndex: 16, type: 'white.proto' },
1406
+ { startIndex: 17, type: 'string.quote.proto' },
1407
+ { startIndex: 18, type: 'string.proto' },
1408
+ { startIndex: 21, type: 'string.quote.proto' },
1409
+ { startIndex: 22, type: 'delimiter.proto' }
1410
+ ]
1411
+ },
1412
+ {
1413
+ line: ' extensions 50 to 99;',
1414
+ tokens: [
1415
+ { startIndex: 0, type: 'white.proto' },
1416
+ { startIndex: 2, type: 'keyword.proto' },
1417
+ { startIndex: 12, type: 'white.proto' },
1418
+ { startIndex: 13, type: 'number.proto' },
1419
+ { startIndex: 15, type: 'white.proto' },
1420
+ { startIndex: 16, type: 'keyword.proto' },
1421
+ { startIndex: 18, type: 'white.proto' },
1422
+ { startIndex: 19, type: 'number.proto' },
1423
+ { startIndex: 21, type: 'delimiter.proto' }
1424
+ ]
1425
+ },
1426
+ {
1427
+ line: ' reserved 100 to max ;',
1428
+ tokens: [
1429
+ { startIndex: 0, type: 'white.proto' },
1430
+ { startIndex: 2, type: 'keyword.proto' },
1431
+ { startIndex: 10, type: 'white.proto' },
1432
+ { startIndex: 11, type: 'number.proto' },
1433
+ { startIndex: 14, type: 'white.proto' },
1434
+ { startIndex: 15, type: 'keyword.proto' },
1435
+ { startIndex: 17, type: 'white.proto' },
1436
+ { startIndex: 18, type: 'keyword.proto' },
1437
+ { startIndex: 21, type: 'white.proto' },
1438
+ { startIndex: 22, type: 'delimiter.proto' }
1439
+ ]
1440
+ },
1441
+ {
1442
+ line: ' optional string baz = 10;',
1443
+ tokens: [
1444
+ { startIndex: 0, type: 'white.proto' },
1445
+ { startIndex: 2, type: 'keyword.proto' },
1446
+ { startIndex: 10, type: 'white.proto' },
1447
+ { startIndex: 11, type: 'keyword.proto' },
1448
+ { startIndex: 17, type: 'white.proto' },
1449
+ { startIndex: 18, type: 'identifier.proto' },
1450
+ { startIndex: 21, type: 'white.proto' },
1451
+ { startIndex: 22, type: 'delimiter.proto' },
1452
+ { startIndex: 23, type: 'white.proto' },
1453
+ { startIndex: 24, type: 'number.proto' },
1454
+ { startIndex: 26, type: 'delimiter.proto' }
1455
+ ]
1456
+ },
1457
+ {
1458
+ line: ' repeated group Result = 1 {',
1459
+ tokens: [
1460
+ { startIndex: 0, type: 'white.proto' },
1461
+ { startIndex: 2, type: 'keyword.proto' },
1462
+ { startIndex: 10, type: 'white.proto' },
1463
+ { startIndex: 11, type: 'keyword.proto' },
1464
+ { startIndex: 16, type: 'white.proto' },
1465
+ { startIndex: 17, type: 'identifier.proto' },
1466
+ { startIndex: 23, type: 'white.proto' },
1467
+ { startIndex: 24, type: 'operator.proto' },
1468
+ { startIndex: 25, type: 'white.proto' },
1469
+ { startIndex: 26, type: 'number.proto' },
1470
+ { startIndex: 27, type: 'white.proto' },
1471
+ { startIndex: 28, type: 'delimiter.curly.proto' }
1472
+ ]
1473
+ },
1474
+ {
1475
+ line: ' required string url = 2;',
1476
+ tokens: [
1477
+ { startIndex: 0, type: 'white.proto' },
1478
+ { startIndex: 4, type: 'keyword.proto' },
1479
+ { startIndex: 12, type: 'white.proto' },
1480
+ { startIndex: 13, type: 'keyword.proto' },
1481
+ { startIndex: 19, type: 'white.proto' },
1482
+ { startIndex: 20, type: 'identifier.proto' },
1483
+ { startIndex: 23, type: 'white.proto' },
1484
+ { startIndex: 24, type: 'delimiter.proto' },
1485
+ { startIndex: 25, type: 'white.proto' },
1486
+ { startIndex: 26, type: 'number.proto' },
1487
+ { startIndex: 27, type: 'delimiter.proto' }
1488
+ ]
1489
+ },
1490
+ {
1491
+ line: ' optional string title = 3;',
1492
+ tokens: [
1493
+ { startIndex: 0, type: 'white.proto' },
1494
+ { startIndex: 4, type: 'keyword.proto' },
1495
+ { startIndex: 12, type: 'white.proto' },
1496
+ { startIndex: 13, type: 'keyword.proto' },
1497
+ { startIndex: 19, type: 'white.proto' },
1498
+ { startIndex: 20, type: 'identifier.proto' },
1499
+ { startIndex: 25, type: 'white.proto' },
1500
+ { startIndex: 26, type: 'delimiter.proto' },
1501
+ { startIndex: 27, type: 'white.proto' },
1502
+ { startIndex: 28, type: 'number.proto' },
1503
+ { startIndex: 29, type: 'delimiter.proto' }
1504
+ ]
1505
+ },
1506
+ {
1507
+ line: ' repeated string snippets = 4;',
1508
+ tokens: [
1509
+ { startIndex: 0, type: 'white.proto' },
1510
+ { startIndex: 4, type: 'keyword.proto' },
1511
+ { startIndex: 12, type: 'white.proto' },
1512
+ { startIndex: 13, type: 'keyword.proto' },
1513
+ { startIndex: 19, type: 'white.proto' },
1514
+ { startIndex: 20, type: 'identifier.proto' },
1515
+ { startIndex: 28, type: 'white.proto' },
1516
+ { startIndex: 29, type: 'delimiter.proto' },
1517
+ { startIndex: 30, type: 'white.proto' },
1518
+ { startIndex: 31, type: 'number.proto' },
1519
+ { startIndex: 32, type: 'delimiter.proto' }
1520
+ ]
1521
+ },
1522
+ {
1523
+ line: ' }',
1524
+ tokens: [
1525
+ { startIndex: 0, type: 'white.proto' },
1526
+ { startIndex: 2, type: 'delimiter.curly.proto' }
1527
+ ]
1528
+ },
1529
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1530
+ { line: '', tokens: [] },
1531
+ {
1532
+ line: 'extend Foo {',
1533
+ tokens: [
1534
+ { startIndex: 0, type: 'keyword.proto' },
1535
+ { startIndex: 6, type: 'white.proto' },
1536
+ { startIndex: 7, type: 'type.identifier.proto' },
1537
+ { startIndex: 10, type: 'white.proto' },
1538
+ { startIndex: 11, type: 'delimiter.curly.proto' }
1539
+ ]
1540
+ },
1541
+ {
1542
+ line: ' optional int32 bar = 50;',
1543
+ tokens: [
1544
+ { startIndex: 0, type: 'white.proto' },
1545
+ { startIndex: 2, type: 'keyword.proto' },
1546
+ { startIndex: 10, type: 'white.proto' },
1547
+ { startIndex: 11, type: 'keyword.proto' },
1548
+ { startIndex: 16, type: 'white.proto' },
1549
+ { startIndex: 17, type: 'identifier.proto' },
1550
+ { startIndex: 20, type: 'white.proto' },
1551
+ { startIndex: 21, type: 'delimiter.proto' },
1552
+ { startIndex: 22, type: 'white.proto' },
1553
+ { startIndex: 23, type: 'number.proto' },
1554
+ { startIndex: 25, type: 'delimiter.proto' }
1555
+ ]
1556
+ },
1557
+ {
1558
+ line: ' repeated group More = 51 {',
1559
+ tokens: [
1560
+ { startIndex: 0, type: 'white.proto' },
1561
+ { startIndex: 2, type: 'keyword.proto' },
1562
+ { startIndex: 10, type: 'white.proto' },
1563
+ { startIndex: 11, type: 'keyword.proto' },
1564
+ { startIndex: 16, type: 'white.proto' },
1565
+ { startIndex: 17, type: 'identifier.proto' },
1566
+ { startIndex: 21, type: 'white.proto' },
1567
+ { startIndex: 22, type: 'operator.proto' },
1568
+ { startIndex: 23, type: 'white.proto' },
1569
+ { startIndex: 24, type: 'number.proto' },
1570
+ { startIndex: 26, type: 'white.proto' },
1571
+ { startIndex: 27, type: 'delimiter.curly.proto' }
1572
+ ]
1573
+ },
1574
+ {
1575
+ line: ' required string url = 2;',
1576
+ tokens: [
1577
+ { startIndex: 0, type: 'white.proto' },
1578
+ { startIndex: 4, type: 'keyword.proto' },
1579
+ { startIndex: 12, type: 'white.proto' },
1580
+ { startIndex: 13, type: 'keyword.proto' },
1581
+ { startIndex: 19, type: 'white.proto' },
1582
+ { startIndex: 20, type: 'identifier.proto' },
1583
+ { startIndex: 23, type: 'white.proto' },
1584
+ { startIndex: 24, type: 'delimiter.proto' },
1585
+ { startIndex: 25, type: 'white.proto' },
1586
+ { startIndex: 26, type: 'number.proto' },
1587
+ { startIndex: 27, type: 'delimiter.proto' }
1588
+ ]
1589
+ },
1590
+ {
1591
+ line: ' }',
1592
+ tokens: [
1593
+ { startIndex: 0, type: 'white.proto' },
1594
+ { startIndex: 2, type: 'delimiter.curly.proto' }
1595
+ ]
1596
+ },
1597
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1598
+ { line: '', tokens: [] },
1599
+ { line: 'message', tokens: [{ startIndex: 0, type: 'keyword.proto' }] },
1600
+ {
1601
+ line: 'map {}',
1602
+ tokens: [
1603
+ { startIndex: 0, type: 'type.identifier.proto' },
1604
+ { startIndex: 3, type: 'white.proto' },
1605
+ { startIndex: 4, type: 'delimiter.curly.proto' }
1606
+ ]
1607
+ },
1608
+ { line: '', tokens: [] },
1609
+ {
1610
+ line: 'message Bar {',
1611
+ tokens: [
1612
+ { startIndex: 0, type: 'keyword.proto' },
1613
+ { startIndex: 7, type: 'white.proto' },
1614
+ { startIndex: 8, type: 'type.identifier.proto' },
1615
+ { startIndex: 11, type: 'white.proto' },
1616
+ { startIndex: 12, type: 'delimiter.curly.proto' }
1617
+ ]
1618
+ },
1619
+ {
1620
+ line: ' optional int32 x = 1;',
1621
+ tokens: [
1622
+ { startIndex: 0, type: 'white.proto' },
1623
+ { startIndex: 2, type: 'keyword.proto' },
1624
+ { startIndex: 10, type: 'white.proto' },
1625
+ { startIndex: 11, type: 'keyword.proto' },
1626
+ { startIndex: 16, type: 'white.proto' },
1627
+ { startIndex: 17, type: 'identifier.proto' },
1628
+ { startIndex: 18, type: 'white.proto' },
1629
+ { startIndex: 19, type: 'delimiter.proto' },
1630
+ { startIndex: 20, type: 'white.proto' },
1631
+ { startIndex: 21, type: 'number.proto' },
1632
+ { startIndex: 22, type: 'delimiter.proto' }
1633
+ ]
1634
+ },
1635
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1636
+ { line: '', tokens: [] },
1637
+ {
1638
+ line: 'message int32 {}',
1639
+ tokens: [
1640
+ { startIndex: 0, type: 'keyword.proto' },
1641
+ { startIndex: 7, type: 'white.proto' },
1642
+ { startIndex: 8, type: 'type.identifier.proto' },
1643
+ { startIndex: 13, type: 'white.proto' },
1644
+ { startIndex: 14, type: 'delimiter.curly.proto' }
1645
+ ]
1646
+ },
1647
+ { line: '', tokens: [] },
1648
+ {
1649
+ line: 'enum EnumAllowingAlias {',
1650
+ tokens: [
1651
+ { startIndex: 0, type: 'keyword.proto' },
1652
+ { startIndex: 4, type: 'white.proto' },
1653
+ { startIndex: 5, type: 'type.identifier.proto' },
1654
+ { startIndex: 22, type: 'white.proto' },
1655
+ { startIndex: 23, type: 'delimiter.curly.proto' }
1656
+ ]
1657
+ },
1658
+ {
1659
+ line: ' option allow_alias = true;',
1660
+ tokens: [
1661
+ { startIndex: 0, type: 'white.proto' },
1662
+ { startIndex: 2, type: 'keyword.proto' },
1663
+ { startIndex: 8, type: 'white.proto' },
1664
+ { startIndex: 9, type: 'annotation.proto' },
1665
+ { startIndex: 20, type: 'white.proto' },
1666
+ { startIndex: 21, type: 'operator.proto' },
1667
+ { startIndex: 22, type: 'white.proto' },
1668
+ { startIndex: 23, type: 'keyword.constant.proto' },
1669
+ { startIndex: 27, type: 'delimiter.proto' }
1670
+ ]
1671
+ },
1672
+ {
1673
+ line: ' uNkNoWN2 = 0;',
1674
+ tokens: [
1675
+ { startIndex: 0, type: 'white.proto' },
1676
+ { startIndex: 2, type: 'identifier.proto' },
1677
+ { startIndex: 10, type: 'white.proto' },
1678
+ { startIndex: 11, type: 'operators.proto' },
1679
+ { startIndex: 12, type: 'white.proto' },
1680
+ { startIndex: 13, type: 'number.octal.proto' },
1681
+ { startIndex: 14, type: 'delimiter.proto' }
1682
+ ]
1683
+ },
1684
+ {
1685
+ line: ' ENUM_ALLOWING_ALIAS_UNKNOWN = 0;',
1686
+ tokens: [
1687
+ { startIndex: 0, type: 'white.proto' },
1688
+ { startIndex: 2, type: 'identifier.proto' },
1689
+ { startIndex: 29, type: 'white.proto' },
1690
+ { startIndex: 30, type: 'operators.proto' },
1691
+ { startIndex: 31, type: 'white.proto' },
1692
+ { startIndex: 32, type: 'number.octal.proto' },
1693
+ { startIndex: 33, type: 'delimiter.proto' }
1694
+ ]
1695
+ },
1696
+ {
1697
+ line: ' STARTED = 1;',
1698
+ tokens: [
1699
+ { startIndex: 0, type: 'white.proto' },
1700
+ { startIndex: 2, type: 'identifier.proto' },
1701
+ { startIndex: 9, type: 'white.proto' },
1702
+ { startIndex: 10, type: 'operators.proto' },
1703
+ { startIndex: 11, type: 'white.proto' },
1704
+ { startIndex: 12, type: 'number.proto' },
1705
+ { startIndex: 13, type: 'delimiter.proto' }
1706
+ ]
1707
+ },
1708
+ {
1709
+ line: " running = 2 [( /***/ custom_option) = 'hello world'];",
1710
+ tokens: [
1711
+ { startIndex: 0, type: 'white.proto' },
1712
+ { startIndex: 2, type: 'identifier.proto' },
1713
+ { startIndex: 9, type: 'white.proto' },
1714
+ { startIndex: 10, type: 'operators.proto' },
1715
+ { startIndex: 11, type: 'white.proto' },
1716
+ { startIndex: 12, type: 'number.proto' },
1717
+ { startIndex: 13, type: 'white.proto' },
1718
+ { startIndex: 14, type: 'delimiter.square.proto' },
1719
+ { startIndex: 15, type: 'annotation.brackets.proto' },
1720
+ { startIndex: 16, type: 'white.proto' },
1721
+ { startIndex: 17, type: 'comment.proto' },
1722
+ { startIndex: 22, type: 'white.proto' },
1723
+ { startIndex: 23, type: 'annotation.proto' },
1724
+ { startIndex: 36, type: 'annotation.brackets.proto' },
1725
+ { startIndex: 37, type: 'white.proto' },
1726
+ { startIndex: 38, type: 'operator.proto' },
1727
+ { startIndex: 39, type: 'white.proto' },
1728
+ { startIndex: 40, type: 'string.quote.proto' },
1729
+ { startIndex: 41, type: 'string.proto' },
1730
+ { startIndex: 52, type: 'string.quote.proto' },
1731
+ { startIndex: 53, type: 'delimiter.square.proto' },
1732
+ { startIndex: 54, type: 'delimiter.proto' }
1733
+ ]
1734
+ },
1735
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1736
+ { line: '', tokens: [] },
1737
+ {
1738
+ line: 'message Outer {',
1739
+ tokens: [
1740
+ { startIndex: 0, type: 'keyword.proto' },
1741
+ { startIndex: 7, type: 'white.proto' },
1742
+ { startIndex: 8, type: 'type.identifier.proto' },
1743
+ { startIndex: 13, type: 'white.proto' },
1744
+ { startIndex: 14, type: 'delimiter.curly.proto' }
1745
+ ]
1746
+ },
1747
+ {
1748
+ line: ' option (my_option).a= true;',
1749
+ tokens: [
1750
+ { startIndex: 0, type: 'white.proto' },
1751
+ { startIndex: 2, type: 'keyword.proto' },
1752
+ { startIndex: 8, type: 'white.proto' },
1753
+ { startIndex: 9, type: 'annotation.proto' },
1754
+ { startIndex: 22, type: 'operator.proto' },
1755
+ { startIndex: 23, type: 'white.proto' },
1756
+ { startIndex: 24, type: 'keyword.constant.proto' },
1757
+ { startIndex: 28, type: 'delimiter.proto' }
1758
+ ]
1759
+ },
1760
+ {
1761
+ line: ' message Inner { // Level 2',
1762
+ tokens: [
1763
+ { startIndex: 0, type: 'white.proto' },
1764
+ { startIndex: 2, type: 'keyword.proto' },
1765
+ { startIndex: 9, type: 'white.proto' },
1766
+ { startIndex: 10, type: 'type.identifier.proto' },
1767
+ { startIndex: 15, type: 'white.proto' },
1768
+ { startIndex: 16, type: 'delimiter.curly.proto' },
1769
+ { startIndex: 17, type: 'white.proto' },
1770
+ { startIndex: 20, type: 'comment.proto' }
1771
+ ]
1772
+ },
1773
+ {
1774
+ line: ' required int64 ival = 1;',
1775
+ tokens: [
1776
+ { startIndex: 0, type: 'white.proto' },
1777
+ { startIndex: 4, type: 'keyword.proto' },
1778
+ { startIndex: 12, type: 'white.proto' },
1779
+ { startIndex: 13, type: 'keyword.proto' },
1780
+ { startIndex: 18, type: 'white.proto' },
1781
+ { startIndex: 19, type: 'identifier.proto' },
1782
+ { startIndex: 23, type: 'white.proto' },
1783
+ { startIndex: 24, type: 'delimiter.proto' },
1784
+ { startIndex: 25, type: 'white.proto' },
1785
+ { startIndex: 26, type: 'number.proto' },
1786
+ { startIndex: 27, type: 'delimiter.proto' }
1787
+ ]
1788
+ },
1789
+ {
1790
+ line: ' }',
1791
+ tokens: [
1792
+ { startIndex: 0, type: 'white.proto' },
1793
+ { startIndex: 2, type: 'delimiter.curly.proto' }
1794
+ ]
1795
+ },
1796
+ {
1797
+ line: ' repeated Inner inner_message = 2;',
1798
+ tokens: [
1799
+ { startIndex: 0, type: 'white.proto' },
1800
+ { startIndex: 2, type: 'keyword.proto' },
1801
+ { startIndex: 10, type: 'white.proto' },
1802
+ { startIndex: 11, type: 'type.identifier.proto' },
1803
+ { startIndex: 16, type: 'white.proto' },
1804
+ { startIndex: 17, type: 'identifier.proto' },
1805
+ { startIndex: 30, type: 'white.proto' },
1806
+ { startIndex: 31, type: 'delimiter.proto' },
1807
+ { startIndex: 32, type: 'white.proto' },
1808
+ { startIndex: 33, type: 'number.proto' },
1809
+ { startIndex: 34, type: 'delimiter.proto' }
1810
+ ]
1811
+ },
1812
+ {
1813
+ line: ' optional foo .bar',
1814
+ tokens: [
1815
+ { startIndex: 0, type: 'white.proto' },
1816
+ { startIndex: 2, type: 'keyword.proto' },
1817
+ { startIndex: 10, type: 'white.proto' },
1818
+ { startIndex: 11, type: 'type.identifier.proto' }
1819
+ ]
1820
+ },
1821
+ {
1822
+ line: ' /**/ .EnumAllowingAlias enum_field =3;',
1823
+ tokens: [
1824
+ { startIndex: 0, type: 'white.proto' },
1825
+ { startIndex: 3, type: 'comment.proto' },
1826
+ { startIndex: 7, type: 'white.proto' },
1827
+ { startIndex: 8, type: 'type.identifier.proto' },
1828
+ { startIndex: 26, type: 'white.proto' },
1829
+ { startIndex: 27, type: 'identifier.proto' },
1830
+ { startIndex: 37, type: 'white.proto' },
1831
+ { startIndex: 38, type: 'delimiter.proto' },
1832
+ { startIndex: 39, type: 'number.proto' },
1833
+ { startIndex: 40, type: 'delimiter.proto' }
1834
+ ]
1835
+ },
1836
+ {
1837
+ line: ' optional map my_map = 4;',
1838
+ tokens: [
1839
+ { startIndex: 0, type: 'white.proto' },
1840
+ { startIndex: 2, type: 'keyword.proto' },
1841
+ { startIndex: 10, type: 'white.proto' },
1842
+ { startIndex: 11, type: 'type.identifier.proto' },
1843
+ { startIndex: 14, type: 'white.proto' },
1844
+ { startIndex: 15, type: 'identifier.proto' },
1845
+ { startIndex: 21, type: 'white.proto' },
1846
+ { startIndex: 22, type: 'delimiter.proto' },
1847
+ { startIndex: 23, type: 'white.proto' },
1848
+ { startIndex: 24, type: 'number.proto' },
1849
+ { startIndex: 25, type: 'delimiter.proto' }
1850
+ ]
1851
+ },
1852
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1853
+ { line: '', tokens: [] },
1854
+ {
1855
+ line: 'message message {',
1856
+ tokens: [
1857
+ { startIndex: 0, type: 'keyword.proto' },
1858
+ { startIndex: 7, type: 'white.proto' },
1859
+ { startIndex: 8, type: 'type.identifier.proto' },
1860
+ { startIndex: 15, type: 'white.proto' },
1861
+ { startIndex: 16, type: 'delimiter.curly.proto' }
1862
+ ]
1863
+ },
1864
+ {
1865
+ line: ' repeated Foo enum = 1;',
1866
+ tokens: [
1867
+ { startIndex: 0, type: 'white.proto' },
1868
+ { startIndex: 2, type: 'keyword.proto' },
1869
+ { startIndex: 10, type: 'white.proto' },
1870
+ { startIndex: 11, type: 'type.identifier.proto' },
1871
+ { startIndex: 14, type: 'white.proto' },
1872
+ { startIndex: 15, type: 'identifier.proto' },
1873
+ { startIndex: 19, type: 'white.proto' },
1874
+ { startIndex: 20, type: 'delimiter.proto' },
1875
+ { startIndex: 21, type: 'white.proto' },
1876
+ { startIndex: 22, type: 'number.proto' },
1877
+ { startIndex: 23, type: 'delimiter.proto' }
1878
+ ]
1879
+ },
1880
+ {
1881
+ line: ' optional Foo int32 = 2;',
1882
+ tokens: [
1883
+ { startIndex: 0, type: 'white.proto' },
1884
+ { startIndex: 2, type: 'keyword.proto' },
1885
+ { startIndex: 10, type: 'white.proto' },
1886
+ { startIndex: 11, type: 'type.identifier.proto' },
1887
+ { startIndex: 14, type: 'white.proto' },
1888
+ { startIndex: 15, type: 'identifier.proto' },
1889
+ { startIndex: 20, type: 'white.proto' },
1890
+ { startIndex: 21, type: 'delimiter.proto' },
1891
+ { startIndex: 22, type: 'white.proto' },
1892
+ { startIndex: 23, type: 'number.proto' },
1893
+ { startIndex: 24, type: 'delimiter.proto' }
1894
+ ]
1895
+ },
1896
+ {
1897
+ line: ' optional service x = 3;',
1898
+ tokens: [
1899
+ { startIndex: 0, type: 'white.proto' },
1900
+ { startIndex: 2, type: 'keyword.proto' },
1901
+ { startIndex: 10, type: 'white.proto' },
1902
+ { startIndex: 11, type: 'type.identifier.proto' },
1903
+ { startIndex: 18, type: 'white.proto' },
1904
+ { startIndex: 19, type: 'identifier.proto' },
1905
+ { startIndex: 20, type: 'white.proto' },
1906
+ { startIndex: 21, type: 'delimiter.proto' },
1907
+ { startIndex: 22, type: 'white.proto' },
1908
+ { startIndex: 23, type: 'number.proto' },
1909
+ { startIndex: 24, type: 'delimiter.proto' }
1910
+ ]
1911
+ },
1912
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
1913
+ { line: '', tokens: [] },
1914
+ {
1915
+ line: 'message service {}',
1916
+ tokens: [
1917
+ { startIndex: 0, type: 'keyword.proto' },
1918
+ { startIndex: 7, type: 'white.proto' },
1919
+ { startIndex: 8, type: 'type.identifier.proto' },
1920
+ { startIndex: 15, type: 'white.proto' },
1921
+ { startIndex: 16, type: 'delimiter.curly.proto' }
1922
+ ]
1923
+ },
1924
+ { line: '', tokens: [] },
1925
+ {
1926
+ line: '/** SearchService does nothing and returns the string "foo"',
1927
+ tokens: [{ startIndex: 0, type: 'comment.proto' }]
1928
+ },
1929
+ { line: '*/', tokens: [{ startIndex: 0, type: 'comment.proto' }] },
1930
+ {
1931
+ line: 'service SearchService {',
1932
+ tokens: [
1933
+ { startIndex: 0, type: 'keyword.proto' },
1934
+ { startIndex: 7, type: 'white.proto' },
1935
+ { startIndex: 8, type: 'identifier.proto' },
1936
+ { startIndex: 21, type: 'white.proto' },
1937
+ { startIndex: 22, type: 'delimiter.curly.proto' }
1938
+ ]
1939
+ },
1940
+ {
1941
+ line: ' rpc Search (SearchRequest) returns (SearchResponse) {',
1942
+ tokens: [
1943
+ { startIndex: 0, type: 'white.proto' },
1944
+ { startIndex: 2, type: 'keyword.proto' },
1945
+ { startIndex: 5, type: 'white.proto' },
1946
+ { startIndex: 6, type: 'identifier.proto' },
1947
+ { startIndex: 12, type: 'white.proto' },
1948
+ { startIndex: 13, type: 'delimiter.parenthesis.proto' },
1949
+ { startIndex: 14, type: 'type.identifier.proto' },
1950
+ { startIndex: 27, type: 'delimiter.parenthesis.proto' },
1951
+ { startIndex: 28, type: 'white.proto' },
1952
+ { startIndex: 29, type: 'keyword.proto' },
1953
+ { startIndex: 36, type: 'white.proto' },
1954
+ { startIndex: 37, type: 'delimiter.parenthesis.proto' },
1955
+ { startIndex: 38, type: 'type.identifier.proto' },
1956
+ { startIndex: 52, type: 'delimiter.parenthesis.proto' },
1957
+ { startIndex: 53, type: 'white.proto' },
1958
+ { startIndex: 54, type: 'delimiter.curly.proto' }
1959
+ ]
1960
+ },
1961
+ {
1962
+ line: ' option (method_option) = {',
1963
+ tokens: [
1964
+ { startIndex: 0, type: 'white.proto' },
1965
+ { startIndex: 4, type: 'keyword.proto' },
1966
+ { startIndex: 10, type: 'white.proto' },
1967
+ { startIndex: 11, type: 'annotation.proto' },
1968
+ { startIndex: 26, type: 'white.proto' },
1969
+ { startIndex: 27, type: 'operator.proto' },
1970
+ { startIndex: 28, type: 'white.proto' },
1971
+ { startIndex: 29, type: 'delimiter.curly.proto' }
1972
+ ]
1973
+ },
1974
+ {
1975
+ line: ' method_id: 2;',
1976
+ tokens: [
1977
+ { startIndex: 0, type: 'white.proto' },
1978
+ { startIndex: 6, type: 'identifier.proto' },
1979
+ { startIndex: 15, type: 'delimiter.proto' },
1980
+ { startIndex: 16, type: 'white.proto' },
1981
+ { startIndex: 17, type: 'number.proto' },
1982
+ { startIndex: 18, type: 'delimiter.proto' }
1983
+ ]
1984
+ },
1985
+ {
1986
+ line: ' method_name: "hello";',
1987
+ tokens: [
1988
+ { startIndex: 0, type: 'white.proto' },
1989
+ { startIndex: 6, type: 'identifier.proto' },
1990
+ { startIndex: 17, type: 'delimiter.proto' },
1991
+ { startIndex: 18, type: 'white.proto' },
1992
+ { startIndex: 19, type: 'string.quote.proto' },
1993
+ { startIndex: 20, type: 'string.proto' },
1994
+ { startIndex: 25, type: 'string.quote.proto' },
1995
+ { startIndex: 26, type: 'delimiter.proto' }
1996
+ ]
1997
+ },
1998
+ {
1999
+ line: ' method_sla: 9.807E+4;',
2000
+ tokens: [
2001
+ { startIndex: 0, type: 'white.proto' },
2002
+ { startIndex: 6, type: 'identifier.proto' },
2003
+ { startIndex: 16, type: 'delimiter.proto' },
2004
+ { startIndex: 17, type: 'white.proto' },
2005
+ { startIndex: 18, type: 'number.proto' },
2006
+ { startIndex: 19, type: 'number.float.proto' },
2007
+ { startIndex: 26, type: 'delimiter.proto' }
2008
+ ]
2009
+ },
2010
+ {
2011
+ line: ' };',
2012
+ tokens: [
2013
+ { startIndex: 0, type: 'white.proto' },
2014
+ { startIndex: 4, type: 'delimiter.curly.proto' },
2015
+ { startIndex: 5, type: 'delimiter.proto' }
2016
+ ]
2017
+ },
2018
+ {
2019
+ line: ' };',
2020
+ tokens: [
2021
+ { startIndex: 0, type: 'white.proto' },
2022
+ { startIndex: 2, type: 'delimiter.curly.proto' },
2023
+ { startIndex: 3, type: 'delimiter.proto' }
2024
+ ]
2025
+ },
2026
+ { line: '}', tokens: [{ startIndex: 0, type: 'delimiter.curly.proto' }] },
2027
+ { line: '', tokens: [] },
2028
+ {
2029
+ line: 'message SearchRequest {};',
2030
+ tokens: [
2031
+ { startIndex: 0, type: 'keyword.proto' },
2032
+ { startIndex: 7, type: 'white.proto' },
2033
+ { startIndex: 8, type: 'type.identifier.proto' },
2034
+ { startIndex: 21, type: 'white.proto' },
2035
+ { startIndex: 22, type: 'delimiter.curly.proto' },
2036
+ { startIndex: 24, type: 'delimiter.proto' }
2037
+ ]
2038
+ },
2039
+ {
2040
+ line: 'message SearchResponse {',
2041
+ tokens: [
2042
+ { startIndex: 0, type: 'keyword.proto' },
2043
+ { startIndex: 7, type: 'white.proto' },
2044
+ { startIndex: 8, type: 'type.identifier.proto' },
2045
+ { startIndex: 22, type: 'white.proto' },
2046
+ { startIndex: 23, type: 'delimiter.curly.proto' }
2047
+ ]
2048
+ },
2049
+ {
2050
+ line: ' optional string response = 1;',
2051
+ tokens: [
2052
+ { startIndex: 0, type: 'white.proto' },
2053
+ { startIndex: 2, type: 'keyword.proto' },
2054
+ { startIndex: 10, type: 'white.proto' },
2055
+ { startIndex: 11, type: 'keyword.proto' },
2056
+ { startIndex: 17, type: 'white.proto' },
2057
+ { startIndex: 18, type: 'identifier.proto' },
2058
+ { startIndex: 26, type: 'white.proto' },
2059
+ { startIndex: 27, type: 'delimiter.proto' },
2060
+ { startIndex: 28, type: 'white.proto' },
2061
+ { startIndex: 29, type: 'number.proto' },
2062
+ { startIndex: 30, type: 'delimiter.proto' }
2063
+ ]
2064
+ },
2065
+ {
2066
+ line: '};',
2067
+ tokens: [
2068
+ { startIndex: 0, type: 'delimiter.curly.proto' },
2069
+ { startIndex: 1, type: 'delimiter.proto' }
2070
+ ]
2071
+ }
2072
+ ]
2073
+ ]);