@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.
- package/.azure-pipelines/publish-nightly.yml +90 -0
- package/.azure-pipelines/publish-stable.yml +89 -0
- package/.devcontainer/devcontainer.json +8 -0
- package/.gitattributes +1 -0
- package/.github/ISSUE_TEMPLATE/1_bug_report.yaml +57 -0
- package/.github/ISSUE_TEMPLATE/2_feature_request.yaml +38 -0
- package/.github/ISSUE_TEMPLATE/3_other.md +4 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/publish-failure-issue-template.md +7 -0
- package/.github/workflows/ci.yml +76 -0
- package/.github/workflows/website.yml +66 -0
- package/.husky/pre-commit +4 -0
- package/.mocharc.json +4 -0
- package/.nvmrc +1 -0
- package/.prettierignore +17 -0
- package/.prettierrc +8 -0
- package/.vscode/launch.json +68 -0
- package/.vscode/settings.json +16 -0
- package/.vscode/tasks.json +30 -0
- package/CHANGELOG.md +1655 -0
- package/CONTRIBUTING.md +125 -0
- package/LICENSE.txt +21 -0
- package/MAINTAINING.md +55 -0
- package/README.md +122 -0
- package/SECURITY.md +41 -0
- package/ThirdPartyNotices.txt +392 -0
- package/build/build-languages.ts +212 -0
- package/build/build-monaco-editor.ts +463 -0
- package/build/check-samples.ts +53 -0
- package/build/fillers/vscode-nls.ts +46 -0
- package/build/fs.ts +80 -0
- package/build/importTypescript.ts +192 -0
- package/build/npm/installAll.ts +44 -0
- package/build/npm/removeAll.ts +20 -0
- package/build/postinstall.ts +23 -0
- package/build/releaseMetadata.ts +280 -0
- package/build/simpleserver.ts +69 -0
- package/build/tsconfig.json +8 -0
- package/build/utils.ts +291 -0
- package/docs/code-structure.dio.svg +275 -0
- package/docs/debugging-core.gif +0 -0
- package/docs/debugging-languages.gif +0 -0
- package/docs/integrate-amd.md +28 -0
- package/docs/integrate-esm.md +229 -0
- package/docs/launch config.png +0 -0
- package/docs/out-folders.dio.svg +347 -0
- package/editor.code-workspace +13 -0
- package/gulpfile.js +9 -0
- package/package.json +80 -0
- package/samples/README.md +36 -0
- package/samples/browser-amd-diff-editor/index.html +62 -0
- package/samples/browser-amd-diff-editor/modified.txt +74 -0
- package/samples/browser-amd-diff-editor/original.txt +61 -0
- package/samples/browser-amd-editor/index.html +24 -0
- package/samples/browser-amd-iframe/index.html +70 -0
- package/samples/browser-amd-iframe/inner.html +34 -0
- package/samples/browser-amd-localized/index.html +30 -0
- package/samples/browser-amd-monarch/index.html +105 -0
- package/samples/browser-amd-requirejs/index.html +26 -0
- package/samples/browser-amd-shadow-dom/index.html +50 -0
- package/samples/browser-amd-shared-model/index.html +29 -0
- package/samples/browser-amd-trusted-types/index.html +42 -0
- package/samples/browser-esm-esbuild/build.js +96 -0
- package/samples/browser-esm-esbuild/index.html +18 -0
- package/samples/browser-esm-esbuild/index.js +24 -0
- package/samples/browser-esm-esbuild/package.json +6 -0
- package/samples/browser-esm-parcel/index.html +19 -0
- package/samples/browser-esm-parcel/package-lock.json +3953 -0
- package/samples/browser-esm-parcel/package.json +10 -0
- package/samples/browser-esm-parcel/src/index.html +11 -0
- package/samples/browser-esm-parcel/src/index.js +29 -0
- package/samples/browser-esm-vite-react/index.html +12 -0
- package/samples/browser-esm-vite-react/package-lock.json +2341 -0
- package/samples/browser-esm-vite-react/package.json +20 -0
- package/samples/browser-esm-vite-react/src/components/Editor.module.css +4 -0
- package/samples/browser-esm-vite-react/src/components/Editor.tsx +25 -0
- package/samples/browser-esm-vite-react/src/main.tsx +11 -0
- package/samples/browser-esm-vite-react/src/userWorker.ts +27 -0
- package/samples/browser-esm-vite-react/src/vite-env.d.ts +1 -0
- package/samples/browser-esm-vite-react/tsconfig.json +11 -0
- package/samples/browser-esm-vite-react/vite.config.ts +7 -0
- package/samples/browser-esm-webpack/index.html +20 -0
- package/samples/browser-esm-webpack/index.js +24 -0
- package/samples/browser-esm-webpack/package.json +6 -0
- package/samples/browser-esm-webpack/webpack.config.js +30 -0
- package/samples/browser-esm-webpack-monaco-plugin/index.html +20 -0
- package/samples/browser-esm-webpack-monaco-plugin/index.js +16 -0
- package/samples/browser-esm-webpack-monaco-plugin/package.json +6 -0
- package/samples/browser-esm-webpack-monaco-plugin/webpack.config.js +28 -0
- package/samples/browser-esm-webpack-small/generate-imports.js +140 -0
- package/samples/browser-esm-webpack-small/index.html +26 -0
- package/samples/browser-esm-webpack-small/index.js +168 -0
- package/samples/browser-esm-webpack-small/package.json +7 -0
- package/samples/browser-esm-webpack-small/webpack.config.js +35 -0
- package/samples/browser-esm-webpack-typescript/package.json +7 -0
- package/samples/browser-esm-webpack-typescript/src/index.css +5 -0
- package/samples/browser-esm-webpack-typescript/src/index.ts +26 -0
- package/samples/browser-esm-webpack-typescript/tsconfig.json +16 -0
- package/samples/browser-esm-webpack-typescript/webpack.config.js +44 -0
- package/samples/browser-esm-webpack-typescript-react/package-lock.json +6183 -0
- package/samples/browser-esm-webpack-typescript-react/package.json +21 -0
- package/samples/browser-esm-webpack-typescript-react/src/components/Editor.tsx +38 -0
- package/samples/browser-esm-webpack-typescript-react/src/index.css +5 -0
- package/samples/browser-esm-webpack-typescript-react/src/index.html +10 -0
- package/samples/browser-esm-webpack-typescript-react/src/index.tsx +12 -0
- package/samples/browser-esm-webpack-typescript-react/tsconfig.json +18 -0
- package/samples/browser-esm-webpack-typescript-react/webpack.config.js +59 -0
- package/samples/browser-script-editor/index.html +28 -0
- package/samples/electron-amd/electron-index.html +37 -0
- package/samples/electron-amd/index.html +18 -0
- package/samples/electron-amd/main.js +32 -0
- package/samples/electron-amd/package.json +7 -0
- package/samples/electron-amd-nodeIntegration/electron-index.html +46 -0
- package/samples/electron-amd-nodeIntegration/index.html +18 -0
- package/samples/electron-amd-nodeIntegration/main.js +37 -0
- package/samples/electron-amd-nodeIntegration/package.json +7 -0
- package/samples/electron-esm-webpack/index.js +24 -0
- package/samples/electron-esm-webpack/main.js +32 -0
- package/samples/electron-esm-webpack/package.json +8 -0
- package/samples/electron-esm-webpack/webpack.config.js +29 -0
- package/samples/nwjs-amd/index.html +48 -0
- package/samples/nwjs-amd-v2/index.html +57 -0
- package/samples/package-lock.json +7808 -0
- package/samples/package.json +32 -0
- package/scripts/ci/env.ts +15 -0
- package/scripts/ci/monaco-editor-core-prepare.ts +81 -0
- package/scripts/ci/monaco-editor-core.sh +34 -0
- package/scripts/ci/monaco-editor-prepare.ts +75 -0
- package/scripts/ci/monaco-editor.sh +29 -0
- package/scripts/lib/index.ts +95 -0
- package/src/basic-languages/_.contribution.ts +80 -0
- package/src/basic-languages/abap/abap.contribution.ts +24 -0
- package/src/basic-languages/abap/abap.test.ts +360 -0
- package/src/basic-languages/abap/abap.ts +1390 -0
- package/src/basic-languages/apex/apex.contribution.ts +25 -0
- package/src/basic-languages/apex/apex.test.ts +700 -0
- package/src/basic-languages/apex/apex.ts +355 -0
- package/src/basic-languages/azcli/azcli.contribution.ts +24 -0
- package/src/basic-languages/azcli/azcli.test.ts +172 -0
- package/src/basic-languages/azcli/azcli.ts +77 -0
- package/src/basic-languages/bat/bat.contribution.ts +24 -0
- package/src/basic-languages/bat/bat.test.ts +397 -0
- package/src/basic-languages/bat/bat.ts +121 -0
- package/src/basic-languages/bicep/bicep.contribution.ts +24 -0
- package/src/basic-languages/bicep/bicep.test.ts +1063 -0
- package/src/basic-languages/bicep/bicep.ts +129 -0
- package/src/basic-languages/cameligo/cameligo.contribution.ts +24 -0
- package/src/basic-languages/cameligo/cameligo.test.ts +144 -0
- package/src/basic-languages/cameligo/cameligo.ts +193 -0
- package/src/basic-languages/clojure/clojure.contribution.ts +24 -0
- package/src/basic-languages/clojure/clojure.test.ts +943 -0
- package/src/basic-languages/clojure/clojure.ts +792 -0
- package/src/basic-languages/coffee/coffee.contribution.ts +25 -0
- package/src/basic-languages/coffee/coffee.test.ts +2363 -0
- package/src/basic-languages/coffee/coffee.ts +258 -0
- package/src/basic-languages/cpp/cpp.contribution.ts +38 -0
- package/src/basic-languages/cpp/cpp.test.ts +979 -0
- package/src/basic-languages/cpp/cpp.ts +416 -0
- package/src/basic-languages/csharp/csharp.contribution.ts +24 -0
- package/src/basic-languages/csharp/csharp.test.ts +976 -0
- package/src/basic-languages/csharp/csharp.ts +352 -0
- package/src/basic-languages/csp/csp.contribution.ts +24 -0
- package/src/basic-languages/csp/csp.test.ts +8 -0
- package/src/basic-languages/csp/csp.ts +58 -0
- package/src/basic-languages/css/css.contribution.ts +25 -0
- package/src/basic-languages/css/css.test.ts +591 -0
- package/src/basic-languages/css/css.ts +215 -0
- package/src/basic-languages/cypher/cypher.contribution.ts +24 -0
- package/src/basic-languages/cypher/cypher.test.ts +327 -0
- package/src/basic-languages/cypher/cypher.ts +274 -0
- package/src/basic-languages/dart/dart.contribution.ts +25 -0
- package/src/basic-languages/dart/dart.test.ts +558 -0
- package/src/basic-languages/dart/dart.ts +305 -0
- package/src/basic-languages/dockerfile/dockerfile.contribution.ts +25 -0
- package/src/basic-languages/dockerfile/dockerfile.test.ts +238 -0
- package/src/basic-languages/dockerfile/dockerfile.ts +145 -0
- package/src/basic-languages/ecl/ecl.contribution.ts +24 -0
- package/src/basic-languages/ecl/ecl.test.ts +8 -0
- package/src/basic-languages/ecl/ecl.ts +481 -0
- package/src/basic-languages/elixir/elixir.contribution.ts +24 -0
- package/src/basic-languages/elixir/elixir.test.ts +447 -0
- package/src/basic-languages/elixir/elixir.ts +656 -0
- package/src/basic-languages/flow9/flow9.contribution.ts +24 -0
- package/src/basic-languages/flow9/flow9.test.ts +148 -0
- package/src/basic-languages/flow9/flow9.ts +160 -0
- package/src/basic-languages/freemarker2/freemarker2-angle-bracket.test.ts +3099 -0
- package/src/basic-languages/freemarker2/freemarker2-angle-dollar.test.ts +3099 -0
- package/src/basic-languages/freemarker2/freemarker2-auto-bracket.test.ts +5358 -0
- package/src/basic-languages/freemarker2/freemarker2-auto-dollar.test.ts +5361 -0
- package/src/basic-languages/freemarker2/freemarker2-bracket-bracket.test.ts +3086 -0
- package/src/basic-languages/freemarker2/freemarker2-bracket-dollar.test.ts +3086 -0
- package/src/basic-languages/freemarker2/freemarker2.contribution.ts +111 -0
- package/src/basic-languages/freemarker2/freemarker2.ts +1230 -0
- package/src/basic-languages/fsharp/fsharp.contribution.ts +24 -0
- package/src/basic-languages/fsharp/fsharp.test.ts +491 -0
- package/src/basic-languages/fsharp/fsharp.ts +237 -0
- package/src/basic-languages/go/go.contribution.ts +24 -0
- package/src/basic-languages/go/go.test.ts +1492 -0
- package/src/basic-languages/go/go.ts +238 -0
- package/src/basic-languages/graphql/graphql.contribution.ts +25 -0
- package/src/basic-languages/graphql/graphql.test.ts +138 -0
- package/src/basic-languages/graphql/graphql.ts +174 -0
- package/src/basic-languages/handlebars/handlebars.contribution.ts +25 -0
- package/src/basic-languages/handlebars/handlebars.test.ts +354 -0
- package/src/basic-languages/handlebars/handlebars.ts +432 -0
- package/src/basic-languages/hcl/hcl.contribution.ts +24 -0
- package/src/basic-languages/hcl/hcl.test.ts +1228 -0
- package/src/basic-languages/hcl/hcl.ts +189 -0
- package/src/basic-languages/html/html.contribution.ts +25 -0
- package/src/basic-languages/html/html.test.ts +743 -0
- package/src/basic-languages/html/html.ts +355 -0
- package/src/basic-languages/ini/ini.contribution.ts +25 -0
- package/src/basic-languages/ini/ini.ts +82 -0
- package/src/basic-languages/java/java.contribution.ts +25 -0
- package/src/basic-languages/java/java.test.ts +878 -0
- package/src/basic-languages/java/java.ts +252 -0
- package/src/basic-languages/javascript/javascript.contribution.ts +27 -0
- package/src/basic-languages/javascript/javascript.test.ts +924 -0
- package/src/basic-languages/javascript/javascript.ts +77 -0
- package/src/basic-languages/julia/julia.contribution.ts +24 -0
- package/src/basic-languages/julia/julia.test.ts +38 -0
- package/src/basic-languages/julia/julia.ts +550 -0
- package/src/basic-languages/kotlin/kotlin.contribution.ts +25 -0
- package/src/basic-languages/kotlin/kotlin.test.ts +753 -0
- package/src/basic-languages/kotlin/kotlin.ts +273 -0
- package/src/basic-languages/less/less.contribution.ts +25 -0
- package/src/basic-languages/less/less.test.ts +1560 -0
- package/src/basic-languages/less/less.ts +198 -0
- package/src/basic-languages/lexon/lexon.contribution.ts +24 -0
- package/src/basic-languages/lexon/lexon.test.ts +145 -0
- package/src/basic-languages/lexon/lexon.ts +179 -0
- package/src/basic-languages/liquid/liquid.contribution.ts +25 -0
- package/src/basic-languages/liquid/liquid.test.ts +209 -0
- package/src/basic-languages/liquid/liquid.ts +251 -0
- package/src/basic-languages/lua/lua.contribution.ts +24 -0
- package/src/basic-languages/lua/lua.test.ts +86 -0
- package/src/basic-languages/lua/lua.ts +178 -0
- package/src/basic-languages/m3/m3.contribution.ts +24 -0
- package/src/basic-languages/m3/m3.test.ts +119 -0
- package/src/basic-languages/m3/m3.ts +226 -0
- package/src/basic-languages/markdown/markdown.contribution.ts +24 -0
- package/src/basic-languages/markdown/markdown.test.ts +95 -0
- package/src/basic-languages/markdown/markdown.ts +256 -0
- package/src/basic-languages/mdx/mdx.contribution.ts +24 -0
- package/src/basic-languages/mdx/mdx.test.ts +171 -0
- package/src/basic-languages/mdx/mdx.ts +163 -0
- package/src/basic-languages/mips/mips.contribution.ts +25 -0
- package/src/basic-languages/mips/mips.test.ts +239 -0
- package/src/basic-languages/mips/mips.ts +223 -0
- package/src/basic-languages/monaco.contribution.ts +87 -0
- package/src/basic-languages/msdax/msdax.contribution.ts +24 -0
- package/src/basic-languages/msdax/msdax.test.ts +444 -0
- package/src/basic-languages/msdax/msdax.ts +382 -0
- package/src/basic-languages/mysql/keywords.js +32 -0
- package/src/basic-languages/mysql/keywords.mysql.txt +750 -0
- package/src/basic-languages/mysql/mysql.contribution.ts +24 -0
- package/src/basic-languages/mysql/mysql.test.ts +561 -0
- package/src/basic-languages/mysql/mysql.ts +885 -0
- package/src/basic-languages/objective-c/objective-c.contribution.ts +24 -0
- package/src/basic-languages/objective-c/objective-c.test.ts +368 -0
- package/src/basic-languages/objective-c/objective-c.ts +219 -0
- package/src/basic-languages/pascal/pascal.contribution.ts +25 -0
- package/src/basic-languages/pascal/pascal.test.ts +151 -0
- package/src/basic-languages/pascal/pascal.ts +270 -0
- package/src/basic-languages/pascaligo/pascaligo.contribution.ts +24 -0
- package/src/basic-languages/pascaligo/pascaligo.test.ts +143 -0
- package/src/basic-languages/pascaligo/pascaligo.ts +183 -0
- package/src/basic-languages/pebble/pebble.contribution.ts +24 -0
- package/src/basic-languages/pebble/pebble.test.ts +178 -0
- package/src/basic-languages/pebble/pebble.ts +457 -0
- package/src/basic-languages/perl/perl.contribution.ts +24 -0
- package/src/basic-languages/perl/perl.test.ts +475 -0
- package/src/basic-languages/perl/perl.ts +664 -0
- package/src/basic-languages/pgsql/keywords.js +30 -0
- package/src/basic-languages/pgsql/keywords.postgresql.txt +827 -0
- package/src/basic-languages/pgsql/pgsql.contribution.ts +24 -0
- package/src/basic-languages/pgsql/pgsql.test.ts +595 -0
- package/src/basic-languages/pgsql/pgsql.ts +858 -0
- package/src/basic-languages/php/php.contribution.ts +25 -0
- package/src/basic-languages/php/php.test.ts +2409 -0
- package/src/basic-languages/php/php.ts +636 -0
- package/src/basic-languages/pla/pla.contribution.ts +23 -0
- package/src/basic-languages/pla/pla.test.ts +598 -0
- package/src/basic-languages/pla/pla.ts +157 -0
- package/src/basic-languages/postiats/postiats.contribution.ts +24 -0
- package/src/basic-languages/postiats/postiats.test.ts +1050 -0
- package/src/basic-languages/postiats/postiats.ts +748 -0
- package/src/basic-languages/powerquery/powerquery.contribution.ts +24 -0
- package/src/basic-languages/powerquery/powerquery.test.ts +416 -0
- package/src/basic-languages/powerquery/powerquery.ts +917 -0
- package/src/basic-languages/powershell/powershell.contribution.ts +24 -0
- package/src/basic-languages/powershell/powershell.test.ts +884 -0
- package/src/basic-languages/powershell/powershell.ts +263 -0
- package/src/basic-languages/protobuf/protobuf.contribution.ts +24 -0
- package/src/basic-languages/protobuf/protobuf.test.ts +2073 -0
- package/src/basic-languages/protobuf/protobuf.ts +463 -0
- package/src/basic-languages/pug/pug.contribution.ts +24 -0
- package/src/basic-languages/pug/pug.test.ts +473 -0
- package/src/basic-languages/pug/pug.ts +434 -0
- package/src/basic-languages/python/python.contribution.ts +25 -0
- package/src/basic-languages/python/python.test.ts +257 -0
- package/src/basic-languages/python/python.ts +296 -0
- package/src/basic-languages/qsharp/qsharp.contribution.ts +24 -0
- package/src/basic-languages/qsharp/qsharp.test.ts +186 -0
- package/src/basic-languages/qsharp/qsharp.ts +325 -0
- package/src/basic-languages/r/r.contribution.ts +24 -0
- package/src/basic-languages/r/r.test.ts +600 -0
- package/src/basic-languages/r/r.ts +263 -0
- package/src/basic-languages/razor/razor.contribution.ts +25 -0
- package/src/basic-languages/razor/razor.test.ts +175 -0
- package/src/basic-languages/razor/razor.ts +571 -0
- package/src/basic-languages/redis/redis.contribution.ts +24 -0
- package/src/basic-languages/redis/redis.test.ts +306 -0
- package/src/basic-languages/redis/redis.ts +309 -0
- package/src/basic-languages/redshift/redshift.contribution.ts +24 -0
- package/src/basic-languages/redshift/redshift.test.ts +595 -0
- package/src/basic-languages/redshift/redshift.ts +815 -0
- package/src/basic-languages/restructuredtext/restructuredtext.contribution.ts +24 -0
- package/src/basic-languages/restructuredtext/restructuredtext.test.ts +454 -0
- package/src/basic-languages/restructuredtext/restructuredtext.ts +198 -0
- package/src/basic-languages/ruby/ruby.contribution.ts +25 -0
- package/src/basic-languages/ruby/ruby.test.ts +158 -0
- package/src/basic-languages/ruby/ruby.ts +590 -0
- package/src/basic-languages/rust/rust.contribution.ts +24 -0
- package/src/basic-languages/rust/rust.test.ts +208 -0
- package/src/basic-languages/rust/rust.ts +361 -0
- package/src/basic-languages/sb/sb.contribution.ts +24 -0
- package/src/basic-languages/sb/sb.test.ts +320 -0
- package/src/basic-languages/sb/sb.ts +134 -0
- package/src/basic-languages/scala/scala.contribution.ts +25 -0
- package/src/basic-languages/scala/scala.test.ts +727 -0
- package/src/basic-languages/scala/scala.ts +413 -0
- package/src/basic-languages/scheme/scheme.contribution.ts +24 -0
- package/src/basic-languages/scheme/scheme.test.ts +89 -0
- package/src/basic-languages/scheme/scheme.ts +128 -0
- package/src/basic-languages/scss/scss.contribution.ts +25 -0
- package/src/basic-languages/scss/scss.test.ts +2422 -0
- package/src/basic-languages/scss/scss.ts +284 -0
- package/src/basic-languages/shell/shell.contribution.ts +24 -0
- package/src/basic-languages/shell/shell.test.ts +345 -0
- package/src/basic-languages/shell/shell.ts +246 -0
- package/src/basic-languages/solidity/solidity.contribution.ts +24 -0
- package/src/basic-languages/solidity/solidity.test.ts +272 -0
- package/src/basic-languages/solidity/solidity.ts +1388 -0
- package/src/basic-languages/sophia/sophia.contribution.ts +24 -0
- package/src/basic-languages/sophia/sophia.test.ts +302 -0
- package/src/basic-languages/sophia/sophia.ts +220 -0
- package/src/basic-languages/sparql/sparql.contribution.ts +24 -0
- package/src/basic-languages/sparql/sparql.test.ts +187 -0
- package/src/basic-languages/sparql/sparql.ts +219 -0
- package/src/basic-languages/sql/keywords.js +612 -0
- package/src/basic-languages/sql/sql.contribution.ts +24 -0
- package/src/basic-languages/sql/sql.test.ts +692 -0
- package/src/basic-languages/sql/sql.ts +860 -0
- package/src/basic-languages/st/st.contribution.ts +24 -0
- package/src/basic-languages/st/st.test.ts +139 -0
- package/src/basic-languages/st/st.ts +441 -0
- package/src/basic-languages/swift/swift.contribution.ts +25 -0
- package/src/basic-languages/swift/swift.test.ts +254 -0
- package/src/basic-languages/swift/swift.ts +335 -0
- package/src/basic-languages/systemverilog/systemverilog.contribution.ts +39 -0
- package/src/basic-languages/systemverilog/systemverilog.test.ts +1267 -0
- package/src/basic-languages/systemverilog/systemverilog.ts +606 -0
- package/src/basic-languages/tcl/tcl.contribution.ts +24 -0
- package/src/basic-languages/tcl/tcl.test.ts +107 -0
- package/src/basic-languages/tcl/tcl.ts +259 -0
- package/src/basic-languages/test/testRunner.ts +63 -0
- package/src/basic-languages/twig/twig.contribution.ts +25 -0
- package/src/basic-languages/twig/twig.test.ts +1047 -0
- package/src/basic-languages/twig/twig.ts +417 -0
- package/src/basic-languages/typescript/typescript.contribution.ts +25 -0
- package/src/basic-languages/typescript/typescript.test.ts +973 -0
- package/src/basic-languages/typescript/typescript.ts +364 -0
- package/src/basic-languages/typespec/typespec.contribution.ts +24 -0
- package/src/basic-languages/typespec/typespec.test.ts +500 -0
- package/src/basic-languages/typespec/typespec.ts +130 -0
- package/src/basic-languages/vb/vb.contribution.ts +24 -0
- package/src/basic-languages/vb/vb.test.ts +598 -0
- package/src/basic-languages/vb/vb.ts +394 -0
- package/src/basic-languages/wgsl/wgsl.contribution.ts +24 -0
- package/src/basic-languages/wgsl/wgsl.test.ts +3915 -0
- package/src/basic-languages/wgsl/wgsl.ts +485 -0
- package/src/basic-languages/xml/xml.contribution.ts +44 -0
- package/src/basic-languages/xml/xml.test.ts +706 -0
- package/src/basic-languages/xml/xml.ts +106 -0
- package/src/basic-languages/yaml/yaml.contribution.ts +25 -0
- package/src/basic-languages/yaml/yaml.test.ts +670 -0
- package/src/basic-languages/yaml/yaml.ts +236 -0
- package/src/fillers/editor.api.d.ts +4 -0
- package/src/fillers/monaco-editor-core-amd.ts +11 -0
- package/src/fillers/monaco-editor-core.ts +6 -0
- package/src/language/common/lspLanguageFeatures.ts +1027 -0
- package/src/language/css/css.worker.ts +14 -0
- package/src/language/css/cssMode.ts +145 -0
- package/src/language/css/cssWorker.ts +239 -0
- package/src/language/css/monaco.contribution.ts +362 -0
- package/src/language/css/workerManager.ts +90 -0
- package/src/language/html/html.worker.ts +14 -0
- package/src/language/html/htmlMode.ts +171 -0
- package/src/language/html/htmlWorker.ts +164 -0
- package/src/language/html/monaco.contribution.ts +329 -0
- package/src/language/html/workerManager.ts +90 -0
- package/src/language/json/json.worker.ts +14 -0
- package/src/language/json/jsonMode.ts +185 -0
- package/src/language/json/jsonWorker.ts +235 -0
- package/src/language/json/monaco.contribution.ts +372 -0
- package/src/language/json/tokenization.ts +273 -0
- package/src/language/json/workerManager.ts +91 -0
- package/src/language/typescript/languageFeatures.ts +1269 -0
- package/src/language/typescript/lib/editor.worker.d.ts +8 -0
- package/src/language/typescript/lib/lib.index.ts +97 -0
- package/src/language/typescript/lib/lib.ts +97 -0
- package/src/language/typescript/lib/typescriptServices.d.ts +11717 -0
- package/src/language/typescript/lib/typescriptServices.js +190876 -0
- package/src/language/typescript/lib/typescriptServicesMetadata.ts +5 -0
- package/src/language/typescript/monaco.contribution.ts +815 -0
- package/src/language/typescript/ts.worker.ts +19 -0
- package/src/language/typescript/tsMode.ts +176 -0
- package/src/language/typescript/tsWorker.ts +525 -0
- package/src/language/typescript/workerManager.ts +101 -0
- package/src/nls-fix.js +39 -0
- package/src/tsconfig.json +14 -0
- package/test/manual/cross-origin.html +26 -0
- package/test/manual/dev-setup.js +218 -0
- package/test/manual/diff.html +20 -0
- package/test/manual/diff.js +451 -0
- package/test/manual/iframe-inner.html +29 -0
- package/test/manual/iframe.html +23 -0
- package/test/manual/index.css +14 -0
- package/test/manual/index.html +44 -0
- package/test/manual/index.js +421 -0
- package/test/manual/mouse-fixed.html +31 -0
- package/test/manual/mouse-scrollable-body.html +286 -0
- package/test/manual/mouse-scrollable-element.html +204 -0
- package/test/manual/samples/run-editor-failing-js.txt +44 -0
- package/test/manual/samples/run-editor-intellisense-js.txt +33 -0
- package/test/manual/samples/run-editor-jquery-min-js.txt +30 -0
- package/test/manual/samples/run-editor-korean.txt +10 -0
- package/test/manual/samples/run-editor-sample-big-css.txt +1 -0
- package/test/manual/samples/run-editor-sample-bom-cs.txt +493 -0
- package/test/manual/samples/run-editor-sample-cr-ps1.txt +12 -0
- package/test/manual/samples/run-editor-sample-dynamic.txt +50 -0
- package/test/manual/samples/run-editor-sample-f12-css.txt +31764 -0
- package/test/manual/samples/run-editor-sample-html.txt +23 -0
- package/test/manual/samples/run-editor-sample-js.txt +222 -0
- package/test/manual/samples/run-editor-sample-msn-js.txt +1 -0
- package/test/manual/samples.js +287 -0
- package/test/manual/shadow-dom.html +56 -0
- package/test/manual/transform.html +29 -0
- package/test/manual/typescript/custom-worker.html +210 -0
- package/test/manual/typescript/custom-worker.js +59 -0
- package/test/manual/typescript/index.html +179 -0
- package/test/smoke/amd/index.html +21 -0
- package/test/smoke/common.js +11 -0
- package/test/smoke/esbuild/index.html +11 -0
- package/test/smoke/esbuild/index.js +26 -0
- package/test/smoke/package-esbuild.ts +60 -0
- package/test/smoke/package-vite.ts +19 -0
- package/test/smoke/package-webpack.ts +56 -0
- package/test/smoke/parcel/index.html +11 -0
- package/test/smoke/parcel/index.js +41 -0
- package/test/smoke/parcel/package.json +6 -0
- package/test/smoke/runner.js +94 -0
- package/test/smoke/smoke.test.js +215 -0
- package/test/smoke/vite/index.html +10 -0
- package/test/smoke/vite/index.js +31 -0
- package/test/smoke/webpack/index.html +10 -0
- package/test/smoke/webpack/index.js +4 -0
- package/test/unit/all.js +70 -0
- package/test/unit/setup.js +34 -0
- package/webpack-plugin/LICENSE +21 -0
- package/webpack-plugin/README.md +116 -0
- package/webpack-plugin/package-lock.json +3132 -0
- package/webpack-plugin/package.json +45 -0
- package/webpack-plugin/tsconfig.json +11 -0
- package/website/.prettierrc.json +6 -0
- package/website/index/samples/sample.mdx.txt +92 -0
- package/website/package.json +60 -0
- package/website/scripts/check-playground-samples-js.ts +58 -0
- package/website/src/monaco-loader.ts +111 -0
- package/website/src/runner/debug.ts +75 -0
- package/website/src/runner/index.ts +104 -0
- package/website/src/runner/style.scss +35 -0
- package/website/src/shared.ts +37 -0
- package/website/src/tsconfig.json +19 -0
- package/website/src/types.d.ts +13 -0
- package/website/src/website/bootstrap.scss +6 -0
- package/website/src/website/code-oss.svg +1 -0
- package/website/src/website/components/Loader.tsx +40 -0
- package/website/src/website/components/Nav.tsx +75 -0
- package/website/src/website/components/Page.tsx +11 -0
- package/website/src/website/components/Radio.tsx +23 -0
- package/website/src/website/components/Select.tsx +75 -0
- package/website/src/website/components/TextBox.tsx +21 -0
- package/website/src/website/components/bootstrap.tsx +32 -0
- package/website/src/website/components/monaco/MonacoEditor.tsx +275 -0
- package/website/src/website/components/monaco/MonacoLoader.tsx +39 -0
- package/website/src/website/data/diff-sample/modified.txt +212 -0
- package/website/src/website/data/diff-sample/original.txt +215 -0
- package/website/src/website/data/home-samples/sample.abap.txt +29 -0
- package/website/src/website/data/home-samples/sample.aes.txt +38 -0
- package/website/src/website/data/home-samples/sample.apex.txt +7 -0
- package/website/src/website/data/home-samples/sample.azcli.txt +5 -0
- package/website/src/website/data/home-samples/sample.bat.txt +13 -0
- package/website/src/website/data/home-samples/sample.bicep.txt +29 -0
- package/website/src/website/data/home-samples/sample.c.txt +3463 -0
- package/website/src/website/data/home-samples/sample.cameligo.txt +17 -0
- package/website/src/website/data/home-samples/sample.clojure.txt +54 -0
- package/website/src/website/data/home-samples/sample.coffeescript.txt +28 -0
- package/website/src/website/data/home-samples/sample.cpp.txt +246 -0
- package/website/src/website/data/home-samples/sample.csharp.txt +38 -0
- package/website/src/website/data/home-samples/sample.csp.txt +1 -0
- package/website/src/website/data/home-samples/sample.css.txt +828 -0
- package/website/src/website/data/home-samples/sample.cypher.txt +3 -0
- package/website/src/website/data/home-samples/sample.dart.txt +45 -0
- package/website/src/website/data/home-samples/sample.dockerfile.txt +32 -0
- package/website/src/website/data/home-samples/sample.ecl.txt +7 -0
- package/website/src/website/data/home-samples/sample.elixir.txt +80 -0
- package/website/src/website/data/home-samples/sample.flow9.txt +14 -0
- package/website/src/website/data/home-samples/sample.freemarker2.tag-angle.interpolation-bracket.txt +61 -0
- package/website/src/website/data/home-samples/sample.freemarker2.tag-angle.interpolation-dollar.txt +61 -0
- package/website/src/website/data/home-samples/sample.freemarker2.tag-auto.interpolation-bracket.txt +65 -0
- package/website/src/website/data/home-samples/sample.freemarker2.tag-auto.interpolation-dollar.txt +65 -0
- package/website/src/website/data/home-samples/sample.freemarker2.tag-bracket.interpolation-bracket.txt +61 -0
- package/website/src/website/data/home-samples/sample.freemarker2.tag-bracket.interpolation-dollar.txt +61 -0
- package/website/src/website/data/home-samples/sample.freemarker2.txt +61 -0
- package/website/src/website/data/home-samples/sample.fsharp.txt +8 -0
- package/website/src/website/data/home-samples/sample.go.txt +111 -0
- package/website/src/website/data/home-samples/sample.graphql.txt +263 -0
- package/website/src/website/data/home-samples/sample.handlebars.txt +31 -0
- package/website/src/website/data/home-samples/sample.hcl.txt +48 -0
- package/website/src/website/data/home-samples/sample.html.txt +100 -0
- package/website/src/website/data/home-samples/sample.ini.txt +15 -0
- package/website/src/website/data/home-samples/sample.java.txt +54 -0
- package/website/src/website/data/home-samples/sample.javascript.txt +214 -0
- package/website/src/website/data/home-samples/sample.json.txt +68 -0
- package/website/src/website/data/home-samples/sample.julia.txt +23 -0
- package/website/src/website/data/home-samples/sample.kotlin.txt +28 -0
- package/website/src/website/data/home-samples/sample.less.txt +46 -0
- package/website/src/website/data/home-samples/sample.lex.txt +21 -0
- package/website/src/website/data/home-samples/sample.lexon.txt +17 -0
- package/website/src/website/data/home-samples/sample.liquid.txt +16 -0
- package/website/src/website/data/home-samples/sample.lua.txt +12 -0
- package/website/src/website/data/home-samples/sample.m3.txt +5 -0
- package/website/src/website/data/home-samples/sample.markdown.txt +104 -0
- package/website/src/website/data/home-samples/sample.mdx.txt +91 -0
- package/website/src/website/data/home-samples/sample.mips.txt +13 -0
- package/website/src/website/data/home-samples/sample.msdax.txt +1 -0
- package/website/src/website/data/home-samples/sample.mysql.txt +8 -0
- package/website/src/website/data/home-samples/sample.objective-c.txt +52 -0
- package/website/src/website/data/home-samples/sample.pascal.txt +28 -0
- package/website/src/website/data/home-samples/sample.pascaligo.txt +20 -0
- package/website/src/website/data/home-samples/sample.pebble.txt +54 -0
- package/website/src/website/data/home-samples/sample.perl.txt +18 -0
- package/website/src/website/data/home-samples/sample.pgsql.txt +8 -0
- package/website/src/website/data/home-samples/sample.php.txt +82 -0
- package/website/src/website/data/home-samples/sample.pla.txt +4 -0
- package/website/src/website/data/home-samples/sample.plaintext.txt +9 -0
- package/website/src/website/data/home-samples/sample.postiats.txt +64 -0
- package/website/src/website/data/home-samples/sample.powerquery.txt +12 -0
- package/website/src/website/data/home-samples/sample.powershell.txt +30 -0
- package/website/src/website/data/home-samples/sample.proto.txt +11 -0
- package/website/src/website/data/home-samples/sample.pug.txt +18 -0
- package/website/src/website/data/home-samples/sample.python.txt +13 -0
- package/website/src/website/data/home-samples/sample.qsharp.txt +45 -0
- package/website/src/website/data/home-samples/sample.r.txt +41 -0
- package/website/src/website/data/home-samples/sample.razor.txt +46 -0
- package/website/src/website/data/home-samples/sample.redis.txt +4 -0
- package/website/src/website/data/home-samples/sample.redshift.txt +9 -0
- package/website/src/website/data/home-samples/sample.restructuredtext.txt +26 -0
- package/website/src/website/data/home-samples/sample.ruby.txt +21 -0
- package/website/src/website/data/home-samples/sample.rust.txt +29 -0
- package/website/src/website/data/home-samples/sample.sb.txt +10 -0
- package/website/src/website/data/home-samples/sample.scala.txt +53 -0
- package/website/src/website/data/home-samples/sample.scheme.txt +105 -0
- package/website/src/website/data/home-samples/sample.scss.txt +37 -0
- package/website/src/website/data/home-samples/sample.shell.txt +42 -0
- package/website/src/website/data/home-samples/sample.sol.txt +139 -0
- package/website/src/website/data/home-samples/sample.sparql.txt +7 -0
- package/website/src/website/data/home-samples/sample.sql.txt +52 -0
- package/website/src/website/data/home-samples/sample.st.txt +34 -0
- package/website/src/website/data/home-samples/sample.swift.txt +50 -0
- package/website/src/website/data/home-samples/sample.systemverilog.txt +28 -0
- package/website/src/website/data/home-samples/sample.tcl.txt +18 -0
- package/website/src/website/data/home-samples/sample.twig.txt +12 -0
- package/website/src/website/data/home-samples/sample.typescript.txt +124 -0
- package/website/src/website/data/home-samples/sample.typespec.txt +71 -0
- package/website/src/website/data/home-samples/sample.vb.txt +59 -0
- package/website/src/website/data/home-samples/sample.verilog.txt +35 -0
- package/website/src/website/data/home-samples/sample.wgsl.txt +48 -0
- package/website/src/website/data/home-samples/sample.xml.txt +14 -0
- package/website/src/website/data/home-samples/sample.yaml.txt +14 -0
- package/website/src/website/data/playground-samples/all.js +196 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/chapter.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.html +1 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.js +20 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.js +23 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.js +20 -0
- package/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-editor/chapter.json +4 -0
- package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.html +1 -0
- package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.js +19 -0
- package/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.html +1 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.js +13 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.html +1 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js +10 -0
- package/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.json +4 -0
- package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.html +35 -0
- package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.js +4 -0
- package/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.json +3 -0
- package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.css +0 -0
- package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.html +8 -0
- package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js +35 -0
- package/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.json +4 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/chapter.json +3 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.css +0 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.html +1 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.js +150 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.json +3 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.css +13 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.html +1 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.js +32 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.json +3 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.css +0 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.html +1 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.js +40 -0
- package/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/chapter.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.js +39 -0
- package/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js +71 -0
- package/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.js +69 -0
- package/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.js +46 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.js +42 -0
- package/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.js +137 -0
- package/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.js +74 -0
- package/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.js +62 -0
- package/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.js +47 -0
- package/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.js +50 -0
- package/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.js +168 -0
- package/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.css +0 -0
- package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.html +1 -0
- package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.js +480 -0
- package/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.css +0 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.js +43 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.css +0 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.js +49 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.css +0 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.js +52 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/chapter.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.css +0 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.js +37 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.css +13 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.js +30 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.css +0 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.js +11 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.css +6 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.html +5 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.js +114 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css +7 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.js +30 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.json +3 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.css +0 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.html +1 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.js +41 -0
- package/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.json +3 -0
- package/website/src/website/index.tsx +10 -0
- package/website/src/website/monaco-loader-chunk.ts +15 -0
- package/website/src/website/monacoEditorVersion.ts +8 -0
- package/website/src/website/pages/App.tsx +21 -0
- package/website/src/website/pages/DocsPage.tsx +103 -0
- package/website/src/website/pages/MonarchPage.tsx +16 -0
- package/website/src/website/pages/home/Home.tsx +249 -0
- package/website/src/website/pages/playground/BisectModel.ts +161 -0
- package/website/src/website/pages/playground/LocationModel.ts +216 -0
- package/website/src/website/pages/playground/PlaygroundModel.ts +355 -0
- package/website/src/website/pages/playground/PlaygroundPage.tsx +31 -0
- package/website/src/website/pages/playground/PlaygroundPageContent.tsx +587 -0
- package/website/src/website/pages/playground/Preview.tsx +129 -0
- package/website/src/website/pages/playground/SettingsDialog.tsx +412 -0
- package/website/src/website/pages/playground/SettingsModel.ts +198 -0
- package/website/src/website/pages/playground/Source.ts +107 -0
- package/website/src/website/pages/playground/getNpmVersionsSync.ts +450 -0
- package/website/src/website/pages/playground/playgroundExamples.tsx +88 -0
- package/website/src/website/pages/playground/utils.ts +28 -0
- package/website/src/website/pages/routes.ts +28 -0
- package/website/src/website/style.scss +96 -0
- package/website/src/website/utils/Debouncer.ts +28 -0
- package/website/src/website/utils/ObservableHistory.ts +89 -0
- package/website/src/website/utils/ObservablePromise.ts +49 -0
- package/website/src/website/utils/hotComponent.tsx +49 -0
- package/website/src/website/utils/lzmaCompressor.ts +39 -0
- package/website/src/website/utils/ref.ts +39 -0
- package/website/src/website/utils/types.d.ts +28 -0
- package/website/src/website/utils/utils.ts +58 -0
- package/website/static/monarch/monarch-34px.png +0 -0
- package/website/static/monarch/monarch.css +297 -0
- package/website/static/monarch/monarch.js +178 -0
- package/website/static/monarch-static.html +5345 -0
- package/website/tsconfig.json +16 -0
- package/website/tslint.json +6 -0
- package/website/typedoc/tsconfig.json +8 -0
- package/website/typedoc/typedoc.json +11 -0
- package/website/vscode-web-editors.tgz +0 -0
- package/website/webpack.config.ts +151 -0
- package/website/yarn.lock +3612 -0
|
@@ -0,0 +1,656 @@
|
|
|
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
|
+
import type { languages } from '../../fillers/monaco-editor-core';
|
|
7
|
+
|
|
8
|
+
export const conf: languages.LanguageConfiguration = {
|
|
9
|
+
comments: {
|
|
10
|
+
lineComment: '#'
|
|
11
|
+
},
|
|
12
|
+
brackets: [
|
|
13
|
+
['{', '}'],
|
|
14
|
+
['[', ']'],
|
|
15
|
+
['(', ')']
|
|
16
|
+
],
|
|
17
|
+
surroundingPairs: [
|
|
18
|
+
{ open: '{', close: '}' },
|
|
19
|
+
{ open: '[', close: ']' },
|
|
20
|
+
{ open: '(', close: ')' },
|
|
21
|
+
{ open: "'", close: "'" },
|
|
22
|
+
{ open: '"', close: '"' }
|
|
23
|
+
],
|
|
24
|
+
autoClosingPairs: [
|
|
25
|
+
{ open: "'", close: "'", notIn: ['string', 'comment'] },
|
|
26
|
+
{ open: '"', close: '"', notIn: ['comment'] },
|
|
27
|
+
{ open: '"""', close: '"""' },
|
|
28
|
+
{ open: '`', close: '`', notIn: ['string', 'comment'] },
|
|
29
|
+
{ open: '(', close: ')' },
|
|
30
|
+
{ open: '{', close: '}' },
|
|
31
|
+
{ open: '[', close: ']' },
|
|
32
|
+
{ open: '<<', close: '>>' }
|
|
33
|
+
],
|
|
34
|
+
indentationRules: {
|
|
35
|
+
increaseIndentPattern: /^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,
|
|
36
|
+
decreaseIndentPattern: /^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A Monarch lexer for the Elixir language.
|
|
42
|
+
*
|
|
43
|
+
* References:
|
|
44
|
+
*
|
|
45
|
+
* * Monarch documentation - https://microsoft.github.io/monaco-editor/monarch.html
|
|
46
|
+
* * Elixir lexer - https://github.com/elixir-makeup/makeup_elixir/blob/master/lib/makeup/lexers/elixir_lexer.ex
|
|
47
|
+
* * TextMate lexer (elixir-tmbundle) - https://github.com/elixir-editors/elixir-tmbundle/blob/master/Syntaxes/Elixir.tmLanguage
|
|
48
|
+
* * TextMate lexer (vscode-elixir-ls) - https://github.com/elixir-lsp/vscode-elixir-ls/blob/master/syntaxes/elixir.json
|
|
49
|
+
*/
|
|
50
|
+
export const language = <languages.IMonarchLanguage>{
|
|
51
|
+
defaultToken: 'source',
|
|
52
|
+
tokenPostfix: '.elixir',
|
|
53
|
+
|
|
54
|
+
brackets: [
|
|
55
|
+
{ open: '[', close: ']', token: 'delimiter.square' },
|
|
56
|
+
{ open: '(', close: ')', token: 'delimiter.parenthesis' },
|
|
57
|
+
{ open: '{', close: '}', token: 'delimiter.curly' },
|
|
58
|
+
{ open: '<<', close: '>>', token: 'delimiter.angle.special' }
|
|
59
|
+
],
|
|
60
|
+
|
|
61
|
+
// Below are lists/regexps to which we reference later.
|
|
62
|
+
|
|
63
|
+
declarationKeywords: [
|
|
64
|
+
'def',
|
|
65
|
+
'defp',
|
|
66
|
+
'defn',
|
|
67
|
+
'defnp',
|
|
68
|
+
'defguard',
|
|
69
|
+
'defguardp',
|
|
70
|
+
'defmacro',
|
|
71
|
+
'defmacrop',
|
|
72
|
+
'defdelegate',
|
|
73
|
+
'defcallback',
|
|
74
|
+
'defmacrocallback',
|
|
75
|
+
'defmodule',
|
|
76
|
+
'defprotocol',
|
|
77
|
+
'defexception',
|
|
78
|
+
'defimpl',
|
|
79
|
+
'defstruct'
|
|
80
|
+
],
|
|
81
|
+
operatorKeywords: ['and', 'in', 'not', 'or', 'when'],
|
|
82
|
+
namespaceKeywords: ['alias', 'import', 'require', 'use'],
|
|
83
|
+
otherKeywords: [
|
|
84
|
+
'after',
|
|
85
|
+
'case',
|
|
86
|
+
'catch',
|
|
87
|
+
'cond',
|
|
88
|
+
'do',
|
|
89
|
+
'else',
|
|
90
|
+
'end',
|
|
91
|
+
'fn',
|
|
92
|
+
'for',
|
|
93
|
+
'if',
|
|
94
|
+
'quote',
|
|
95
|
+
'raise',
|
|
96
|
+
'receive',
|
|
97
|
+
'rescue',
|
|
98
|
+
'super',
|
|
99
|
+
'throw',
|
|
100
|
+
'try',
|
|
101
|
+
'unless',
|
|
102
|
+
'unquote_splicing',
|
|
103
|
+
'unquote',
|
|
104
|
+
'with'
|
|
105
|
+
],
|
|
106
|
+
constants: ['true', 'false', 'nil'],
|
|
107
|
+
nameBuiltin: ['__MODULE__', '__DIR__', '__ENV__', '__CALLER__', '__STACKTRACE__'],
|
|
108
|
+
|
|
109
|
+
// Matches any of the operator names:
|
|
110
|
+
// <<< >>> ||| &&& ^^^ ~~~ === !== ~>> <~> |~> <|> == != <= >= && || \\ <> ++ -- |> =~ -> <- ~> <~ :: .. = < > + - * / | . ^ & !
|
|
111
|
+
operator:
|
|
112
|
+
/-[->]?|!={0,2}|\*{1,2}|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,
|
|
113
|
+
|
|
114
|
+
// See https://hexdocs.pm/elixir/syntax-reference.html#variables
|
|
115
|
+
variableName: /[a-z_][a-zA-Z0-9_]*[?!]?/,
|
|
116
|
+
|
|
117
|
+
// See https://hexdocs.pm/elixir/syntax-reference.html#atoms
|
|
118
|
+
atomName: /[a-zA-Z_][a-zA-Z0-9_@]*[?!]?|@specialAtomName|@operator/,
|
|
119
|
+
specialAtomName: /\.\.\.|<<>>|%\{\}|%|\{\}/,
|
|
120
|
+
|
|
121
|
+
aliasPart: /[A-Z][a-zA-Z0-9_]*/,
|
|
122
|
+
moduleName: /@aliasPart(?:\.@aliasPart)*/,
|
|
123
|
+
|
|
124
|
+
// Sigil pairs are: """ """, ''' ''', " ", ' ', / /, | |, < >, { }, [ ], ( )
|
|
125
|
+
sigilSymmetricDelimiter: /"""|'''|"|'|\/|\|/,
|
|
126
|
+
sigilStartDelimiter: /@sigilSymmetricDelimiter|<|\{|\[|\(/,
|
|
127
|
+
sigilEndDelimiter: /@sigilSymmetricDelimiter|>|\}|\]|\)/,
|
|
128
|
+
sigilModifiers: /[a-zA-Z0-9]*/,
|
|
129
|
+
|
|
130
|
+
decimal: /\d(?:_?\d)*/,
|
|
131
|
+
hex: /[0-9a-fA-F](_?[0-9a-fA-F])*/,
|
|
132
|
+
octal: /[0-7](_?[0-7])*/,
|
|
133
|
+
binary: /[01](_?[01])*/,
|
|
134
|
+
|
|
135
|
+
// See https://hexdocs.pm/elixir/master/String.html#module-escape-characters
|
|
136
|
+
escape: /\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}|\\./,
|
|
137
|
+
|
|
138
|
+
// The keys below correspond to tokenizer states.
|
|
139
|
+
// We start from the root state and match against its rules
|
|
140
|
+
// until we explicitly transition into another state.
|
|
141
|
+
// The `include` simply brings in all operations from the given state
|
|
142
|
+
// and is useful for improving readability.
|
|
143
|
+
tokenizer: {
|
|
144
|
+
root: [
|
|
145
|
+
{ include: '@whitespace' },
|
|
146
|
+
{ include: '@comments' },
|
|
147
|
+
// Keywords start as either an identifier or a string,
|
|
148
|
+
// but end with a : so it's important to match this first.
|
|
149
|
+
{ include: '@keywordsShorthand' },
|
|
150
|
+
{ include: '@numbers' },
|
|
151
|
+
{ include: '@identifiers' },
|
|
152
|
+
{ include: '@strings' },
|
|
153
|
+
{ include: '@atoms' },
|
|
154
|
+
{ include: '@sigils' },
|
|
155
|
+
{ include: '@attributes' },
|
|
156
|
+
{ include: '@symbols' }
|
|
157
|
+
],
|
|
158
|
+
|
|
159
|
+
// Whitespace
|
|
160
|
+
|
|
161
|
+
whitespace: [[/\s+/, 'white']],
|
|
162
|
+
|
|
163
|
+
// Comments
|
|
164
|
+
|
|
165
|
+
comments: [[/(#)(.*)/, ['comment.punctuation', 'comment']]],
|
|
166
|
+
|
|
167
|
+
// Keyword list shorthand
|
|
168
|
+
|
|
169
|
+
keywordsShorthand: [
|
|
170
|
+
[/(@atomName)(:)(\s+)/, ['constant', 'constant.punctuation', 'white']],
|
|
171
|
+
// Use positive look-ahead to ensure the string is followed by :
|
|
172
|
+
// and should be considered a keyword.
|
|
173
|
+
[
|
|
174
|
+
/"(?=([^"]|#\{.*?\}|\\")*":)/,
|
|
175
|
+
{ token: 'constant.delimiter', next: '@doubleQuotedStringKeyword' }
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
/'(?=([^']|#\{.*?\}|\\')*':)/,
|
|
179
|
+
{ token: 'constant.delimiter', next: '@singleQuotedStringKeyword' }
|
|
180
|
+
]
|
|
181
|
+
],
|
|
182
|
+
|
|
183
|
+
doubleQuotedStringKeyword: [
|
|
184
|
+
[/":/, { token: 'constant.delimiter', next: '@pop' }],
|
|
185
|
+
{ include: '@stringConstantContentInterpol' }
|
|
186
|
+
],
|
|
187
|
+
|
|
188
|
+
singleQuotedStringKeyword: [
|
|
189
|
+
[/':/, { token: 'constant.delimiter', next: '@pop' }],
|
|
190
|
+
{ include: '@stringConstantContentInterpol' }
|
|
191
|
+
],
|
|
192
|
+
|
|
193
|
+
// Numbers
|
|
194
|
+
|
|
195
|
+
numbers: [
|
|
196
|
+
[/0b@binary/, 'number.binary'],
|
|
197
|
+
[/0o@octal/, 'number.octal'],
|
|
198
|
+
[/0x@hex/, 'number.hex'],
|
|
199
|
+
[/@decimal\.@decimal([eE]-?@decimal)?/, 'number.float'],
|
|
200
|
+
[/@decimal/, 'number']
|
|
201
|
+
],
|
|
202
|
+
|
|
203
|
+
// Identifiers
|
|
204
|
+
|
|
205
|
+
identifiers: [
|
|
206
|
+
// Tokenize identifier name in function-like definitions.
|
|
207
|
+
// Note: given `def a + b, do: nil`, `a` is not a function name,
|
|
208
|
+
// so we use negative look-ahead to ensure there's no operator.
|
|
209
|
+
[
|
|
210
|
+
/\b(defp?|defnp?|defmacrop?|defguardp?|defdelegate)(\s+)(@variableName)(?!\s+@operator)/,
|
|
211
|
+
[
|
|
212
|
+
'keyword.declaration',
|
|
213
|
+
'white',
|
|
214
|
+
{
|
|
215
|
+
cases: {
|
|
216
|
+
unquote: 'keyword',
|
|
217
|
+
'@default': 'function'
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
],
|
|
222
|
+
// Tokenize function calls
|
|
223
|
+
[
|
|
224
|
+
// In-scope call - an identifier followed by ( or .(
|
|
225
|
+
/(@variableName)(?=\s*\.?\s*\()/,
|
|
226
|
+
{
|
|
227
|
+
cases: {
|
|
228
|
+
// Tokenize as keyword in cases like `if(..., do: ..., else: ...)`
|
|
229
|
+
'@declarationKeywords': 'keyword.declaration',
|
|
230
|
+
'@namespaceKeywords': 'keyword',
|
|
231
|
+
'@otherKeywords': 'keyword',
|
|
232
|
+
'@default': 'function.call'
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
// Referencing function in a module
|
|
238
|
+
/(@moduleName)(\s*)(\.)(\s*)(@variableName)/,
|
|
239
|
+
['type.identifier', 'white', 'operator', 'white', 'function.call']
|
|
240
|
+
],
|
|
241
|
+
[
|
|
242
|
+
// Referencing function in an Erlang module
|
|
243
|
+
/(:)(@atomName)(\s*)(\.)(\s*)(@variableName)/,
|
|
244
|
+
['constant.punctuation', 'constant', 'white', 'operator', 'white', 'function.call']
|
|
245
|
+
],
|
|
246
|
+
[
|
|
247
|
+
// Piping into a function (tokenized separately as it may not have parentheses)
|
|
248
|
+
/(\|>)(\s*)(@variableName)/,
|
|
249
|
+
[
|
|
250
|
+
'operator',
|
|
251
|
+
'white',
|
|
252
|
+
{
|
|
253
|
+
cases: {
|
|
254
|
+
'@otherKeywords': 'keyword',
|
|
255
|
+
'@default': 'function.call'
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
// Function reference passed to another function
|
|
262
|
+
/(&)(\s*)(@variableName)/,
|
|
263
|
+
['operator', 'white', 'function.call']
|
|
264
|
+
],
|
|
265
|
+
// Language keywords, builtins, constants and variables
|
|
266
|
+
[
|
|
267
|
+
/@variableName/,
|
|
268
|
+
{
|
|
269
|
+
cases: {
|
|
270
|
+
'@declarationKeywords': 'keyword.declaration',
|
|
271
|
+
'@operatorKeywords': 'keyword.operator',
|
|
272
|
+
'@namespaceKeywords': 'keyword',
|
|
273
|
+
'@otherKeywords': 'keyword',
|
|
274
|
+
'@constants': 'constant.language',
|
|
275
|
+
'@nameBuiltin': 'variable.language',
|
|
276
|
+
'_.*': 'comment.unused',
|
|
277
|
+
'@default': 'identifier'
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
// Module names
|
|
282
|
+
[/@moduleName/, 'type.identifier']
|
|
283
|
+
],
|
|
284
|
+
|
|
285
|
+
// Strings
|
|
286
|
+
|
|
287
|
+
strings: [
|
|
288
|
+
[/"""/, { token: 'string.delimiter', next: '@doubleQuotedHeredoc' }],
|
|
289
|
+
[/'''/, { token: 'string.delimiter', next: '@singleQuotedHeredoc' }],
|
|
290
|
+
[/"/, { token: 'string.delimiter', next: '@doubleQuotedString' }],
|
|
291
|
+
[/'/, { token: 'string.delimiter', next: '@singleQuotedString' }]
|
|
292
|
+
],
|
|
293
|
+
|
|
294
|
+
doubleQuotedHeredoc: [
|
|
295
|
+
[/"""/, { token: 'string.delimiter', next: '@pop' }],
|
|
296
|
+
{ include: '@stringContentInterpol' }
|
|
297
|
+
],
|
|
298
|
+
|
|
299
|
+
singleQuotedHeredoc: [
|
|
300
|
+
[/'''/, { token: 'string.delimiter', next: '@pop' }],
|
|
301
|
+
{ include: '@stringContentInterpol' }
|
|
302
|
+
],
|
|
303
|
+
|
|
304
|
+
doubleQuotedString: [
|
|
305
|
+
[/"/, { token: 'string.delimiter', next: '@pop' }],
|
|
306
|
+
{ include: '@stringContentInterpol' }
|
|
307
|
+
],
|
|
308
|
+
|
|
309
|
+
singleQuotedString: [
|
|
310
|
+
[/'/, { token: 'string.delimiter', next: '@pop' }],
|
|
311
|
+
{ include: '@stringContentInterpol' }
|
|
312
|
+
],
|
|
313
|
+
|
|
314
|
+
// Atoms
|
|
315
|
+
|
|
316
|
+
atoms: [
|
|
317
|
+
[/(:)(@atomName)/, ['constant.punctuation', 'constant']],
|
|
318
|
+
[/:"/, { token: 'constant.delimiter', next: '@doubleQuotedStringAtom' }],
|
|
319
|
+
[/:'/, { token: 'constant.delimiter', next: '@singleQuotedStringAtom' }]
|
|
320
|
+
],
|
|
321
|
+
|
|
322
|
+
doubleQuotedStringAtom: [
|
|
323
|
+
[/"/, { token: 'constant.delimiter', next: '@pop' }],
|
|
324
|
+
{ include: '@stringConstantContentInterpol' }
|
|
325
|
+
],
|
|
326
|
+
|
|
327
|
+
singleQuotedStringAtom: [
|
|
328
|
+
[/'/, { token: 'constant.delimiter', next: '@pop' }],
|
|
329
|
+
{ include: '@stringConstantContentInterpol' }
|
|
330
|
+
],
|
|
331
|
+
|
|
332
|
+
// Sigils
|
|
333
|
+
|
|
334
|
+
// See https://elixir-lang.org/getting-started/sigils.html
|
|
335
|
+
// Sigils allow for typing values using their textual representation.
|
|
336
|
+
// All sigils start with ~ followed by a letter or
|
|
337
|
+
// multi-letter uppercase starting at Elixir v1.15.0, indicating sigil type
|
|
338
|
+
// and then a delimiter pair enclosing the textual representation.
|
|
339
|
+
// Optional modifiers are allowed after the closing delimiter.
|
|
340
|
+
// For instance a regular expressions can be written as:
|
|
341
|
+
// ~r/foo|bar/ ~r{foo|bar} ~r/foo|bar/g
|
|
342
|
+
//
|
|
343
|
+
// In general lowercase sigils allow for interpolation
|
|
344
|
+
// and escaped characters, whereas uppercase sigils don't
|
|
345
|
+
//
|
|
346
|
+
// During tokenization we want to distinguish some
|
|
347
|
+
// specific sigil types, namely string and regexp,
|
|
348
|
+
// so that they cen be themed separately.
|
|
349
|
+
//
|
|
350
|
+
// To reasonably handle all those combinations we leverage
|
|
351
|
+
// dot-separated states, so if we transition to @sigilStart.interpol.s.{.}
|
|
352
|
+
// then "sigilStart.interpol.s" state will match and also all
|
|
353
|
+
// the individual dot-separated parameters can be accessed.
|
|
354
|
+
|
|
355
|
+
sigils: [
|
|
356
|
+
[/~[a-z]@sigilStartDelimiter/, { token: '@rematch', next: '@sigil.interpol' }],
|
|
357
|
+
[/~([A-Z]+)@sigilStartDelimiter/, { token: '@rematch', next: '@sigil.noInterpol' }]
|
|
358
|
+
],
|
|
359
|
+
|
|
360
|
+
sigil: [
|
|
361
|
+
[/~([a-z]|[A-Z]+)\{/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.{.}' }],
|
|
362
|
+
[/~([a-z]|[A-Z]+)\[/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.[.]' }],
|
|
363
|
+
[/~([a-z]|[A-Z]+)\(/, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.(.)' }],
|
|
364
|
+
[/~([a-z]|[A-Z]+)\</, { token: '@rematch', switchTo: '@sigilStart.$S2.$1.<.>' }],
|
|
365
|
+
[
|
|
366
|
+
/~([a-z]|[A-Z]+)(@sigilSymmetricDelimiter)/,
|
|
367
|
+
{ token: '@rematch', switchTo: '@sigilStart.$S2.$1.$2.$2' }
|
|
368
|
+
]
|
|
369
|
+
],
|
|
370
|
+
|
|
371
|
+
// The definitions below expect states to be of the form:
|
|
372
|
+
//
|
|
373
|
+
// sigilStart.<interpol-or-noInterpol>.<sigil-letter>.<start-delimiter>.<end-delimiter>
|
|
374
|
+
// sigilContinue.<interpol-or-noInterpol>.<sigil-letter>.<start-delimiter>.<end-delimiter>
|
|
375
|
+
//
|
|
376
|
+
// The sigilStart state is used only to properly classify the token (as string/regex/sigil)
|
|
377
|
+
// and immediately switches to the sigilContinue sate, which handles the actual content
|
|
378
|
+
// and waits for the corresponding end delimiter.
|
|
379
|
+
|
|
380
|
+
'sigilStart.interpol.s': [
|
|
381
|
+
[
|
|
382
|
+
/~s@sigilStartDelimiter/,
|
|
383
|
+
{
|
|
384
|
+
token: 'string.delimiter',
|
|
385
|
+
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
],
|
|
389
|
+
|
|
390
|
+
'sigilContinue.interpol.s': [
|
|
391
|
+
[
|
|
392
|
+
/(@sigilEndDelimiter)@sigilModifiers/,
|
|
393
|
+
{
|
|
394
|
+
cases: {
|
|
395
|
+
'$1==$S5': { token: 'string.delimiter', next: '@pop' },
|
|
396
|
+
'@default': 'string'
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
{ include: '@stringContentInterpol' }
|
|
401
|
+
],
|
|
402
|
+
|
|
403
|
+
'sigilStart.noInterpol.S': [
|
|
404
|
+
[
|
|
405
|
+
/~S@sigilStartDelimiter/,
|
|
406
|
+
{
|
|
407
|
+
token: 'string.delimiter',
|
|
408
|
+
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
],
|
|
412
|
+
|
|
413
|
+
'sigilContinue.noInterpol.S': [
|
|
414
|
+
// Ignore escaped sigil end
|
|
415
|
+
[/(^|[^\\])\\@sigilEndDelimiter/, 'string'],
|
|
416
|
+
[
|
|
417
|
+
/(@sigilEndDelimiter)@sigilModifiers/,
|
|
418
|
+
{
|
|
419
|
+
cases: {
|
|
420
|
+
'$1==$S5': { token: 'string.delimiter', next: '@pop' },
|
|
421
|
+
'@default': 'string'
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
{ include: '@stringContent' }
|
|
426
|
+
],
|
|
427
|
+
|
|
428
|
+
'sigilStart.interpol.r': [
|
|
429
|
+
[
|
|
430
|
+
/~r@sigilStartDelimiter/,
|
|
431
|
+
{
|
|
432
|
+
token: 'regexp.delimiter',
|
|
433
|
+
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
|
|
434
|
+
}
|
|
435
|
+
]
|
|
436
|
+
],
|
|
437
|
+
|
|
438
|
+
'sigilContinue.interpol.r': [
|
|
439
|
+
[
|
|
440
|
+
/(@sigilEndDelimiter)@sigilModifiers/,
|
|
441
|
+
{
|
|
442
|
+
cases: {
|
|
443
|
+
'$1==$S5': { token: 'regexp.delimiter', next: '@pop' },
|
|
444
|
+
'@default': 'regexp'
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
{ include: '@regexpContentInterpol' }
|
|
449
|
+
],
|
|
450
|
+
|
|
451
|
+
'sigilStart.noInterpol.R': [
|
|
452
|
+
[
|
|
453
|
+
/~R@sigilStartDelimiter/,
|
|
454
|
+
{
|
|
455
|
+
token: 'regexp.delimiter',
|
|
456
|
+
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
|
|
457
|
+
}
|
|
458
|
+
]
|
|
459
|
+
],
|
|
460
|
+
|
|
461
|
+
'sigilContinue.noInterpol.R': [
|
|
462
|
+
// Ignore escaped sigil end
|
|
463
|
+
[/(^|[^\\])\\@sigilEndDelimiter/, 'regexp'],
|
|
464
|
+
[
|
|
465
|
+
/(@sigilEndDelimiter)@sigilModifiers/,
|
|
466
|
+
{
|
|
467
|
+
cases: {
|
|
468
|
+
'$1==$S5': { token: 'regexp.delimiter', next: '@pop' },
|
|
469
|
+
'@default': 'regexp'
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
],
|
|
473
|
+
{ include: '@regexpContent' }
|
|
474
|
+
],
|
|
475
|
+
|
|
476
|
+
// Fallback to the generic sigil by default
|
|
477
|
+
'sigilStart.interpol': [
|
|
478
|
+
[
|
|
479
|
+
/~([a-z]|[A-Z]+)@sigilStartDelimiter/,
|
|
480
|
+
{
|
|
481
|
+
token: 'sigil.delimiter',
|
|
482
|
+
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
|
|
483
|
+
}
|
|
484
|
+
]
|
|
485
|
+
],
|
|
486
|
+
|
|
487
|
+
'sigilContinue.interpol': [
|
|
488
|
+
[
|
|
489
|
+
/(@sigilEndDelimiter)@sigilModifiers/,
|
|
490
|
+
{
|
|
491
|
+
cases: {
|
|
492
|
+
'$1==$S5': { token: 'sigil.delimiter', next: '@pop' },
|
|
493
|
+
'@default': 'sigil'
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
],
|
|
497
|
+
{ include: '@sigilContentInterpol' }
|
|
498
|
+
],
|
|
499
|
+
|
|
500
|
+
'sigilStart.noInterpol': [
|
|
501
|
+
[
|
|
502
|
+
/~([a-z]|[A-Z]+)@sigilStartDelimiter/,
|
|
503
|
+
{
|
|
504
|
+
token: 'sigil.delimiter',
|
|
505
|
+
switchTo: '@sigilContinue.$S2.$S3.$S4.$S5'
|
|
506
|
+
}
|
|
507
|
+
]
|
|
508
|
+
],
|
|
509
|
+
|
|
510
|
+
'sigilContinue.noInterpol': [
|
|
511
|
+
// Ignore escaped sigil end
|
|
512
|
+
[/(^|[^\\])\\@sigilEndDelimiter/, 'sigil'],
|
|
513
|
+
[
|
|
514
|
+
/(@sigilEndDelimiter)@sigilModifiers/,
|
|
515
|
+
{
|
|
516
|
+
cases: {
|
|
517
|
+
'$1==$S5': { token: 'sigil.delimiter', next: '@pop' },
|
|
518
|
+
'@default': 'sigil'
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
{ include: '@sigilContent' }
|
|
523
|
+
],
|
|
524
|
+
|
|
525
|
+
// Attributes
|
|
526
|
+
|
|
527
|
+
attributes: [
|
|
528
|
+
// Module @doc* attributes - tokenized as comments
|
|
529
|
+
[
|
|
530
|
+
/\@(module|type)?doc (~[sS])?"""/,
|
|
531
|
+
{
|
|
532
|
+
token: 'comment.block.documentation',
|
|
533
|
+
next: '@doubleQuotedHeredocDocstring'
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
[
|
|
537
|
+
/\@(module|type)?doc (~[sS])?'''/,
|
|
538
|
+
{
|
|
539
|
+
token: 'comment.block.documentation',
|
|
540
|
+
next: '@singleQuotedHeredocDocstring'
|
|
541
|
+
}
|
|
542
|
+
],
|
|
543
|
+
[
|
|
544
|
+
/\@(module|type)?doc (~[sS])?"/,
|
|
545
|
+
{
|
|
546
|
+
token: 'comment.block.documentation',
|
|
547
|
+
next: '@doubleQuotedStringDocstring'
|
|
548
|
+
}
|
|
549
|
+
],
|
|
550
|
+
[
|
|
551
|
+
/\@(module|type)?doc (~[sS])?'/,
|
|
552
|
+
{
|
|
553
|
+
token: 'comment.block.documentation',
|
|
554
|
+
next: '@singleQuotedStringDocstring'
|
|
555
|
+
}
|
|
556
|
+
],
|
|
557
|
+
[/\@(module|type)?doc false/, 'comment.block.documentation'],
|
|
558
|
+
// Module attributes
|
|
559
|
+
[/\@(@variableName)/, 'variable']
|
|
560
|
+
],
|
|
561
|
+
|
|
562
|
+
doubleQuotedHeredocDocstring: [
|
|
563
|
+
[/"""/, { token: 'comment.block.documentation', next: '@pop' }],
|
|
564
|
+
{ include: '@docstringContent' }
|
|
565
|
+
],
|
|
566
|
+
|
|
567
|
+
singleQuotedHeredocDocstring: [
|
|
568
|
+
[/'''/, { token: 'comment.block.documentation', next: '@pop' }],
|
|
569
|
+
{ include: '@docstringContent' }
|
|
570
|
+
],
|
|
571
|
+
|
|
572
|
+
doubleQuotedStringDocstring: [
|
|
573
|
+
[/"/, { token: 'comment.block.documentation', next: '@pop' }],
|
|
574
|
+
{ include: '@docstringContent' }
|
|
575
|
+
],
|
|
576
|
+
|
|
577
|
+
singleQuotedStringDocstring: [
|
|
578
|
+
[/'/, { token: 'comment.block.documentation', next: '@pop' }],
|
|
579
|
+
{ include: '@docstringContent' }
|
|
580
|
+
],
|
|
581
|
+
|
|
582
|
+
// Operators, punctuation, brackets
|
|
583
|
+
|
|
584
|
+
symbols: [
|
|
585
|
+
// Code point operator (either with regular character ?a or an escaped one ?\n)
|
|
586
|
+
[/\?(\\.|[^\\\s])/, 'number.constant'],
|
|
587
|
+
// Anonymous function arguments
|
|
588
|
+
[/&\d+/, 'operator'],
|
|
589
|
+
// Bitshift operators (must go before delimiters, so that << >> don't match first)
|
|
590
|
+
[/<<<|>>>/, 'operator'],
|
|
591
|
+
// Delimiter pairs
|
|
592
|
+
[/[()\[\]\{\}]|<<|>>/, '@brackets'],
|
|
593
|
+
// Triple dot is a valid name (must go before operators, so that .. doesn't match instead)
|
|
594
|
+
[/\.\.\./, 'identifier'],
|
|
595
|
+
// Punctuation => (must go before operators, so it's not tokenized as = then >)
|
|
596
|
+
[/=>/, 'punctuation'],
|
|
597
|
+
// Operators
|
|
598
|
+
[/@operator/, 'operator'],
|
|
599
|
+
// Punctuation
|
|
600
|
+
[/[:;,.%]/, 'punctuation']
|
|
601
|
+
],
|
|
602
|
+
|
|
603
|
+
// Generic helpers
|
|
604
|
+
|
|
605
|
+
stringContentInterpol: [
|
|
606
|
+
{ include: '@interpolation' },
|
|
607
|
+
{ include: '@escapeChar' },
|
|
608
|
+
{ include: '@stringContent' }
|
|
609
|
+
],
|
|
610
|
+
|
|
611
|
+
stringContent: [[/./, 'string']],
|
|
612
|
+
|
|
613
|
+
stringConstantContentInterpol: [
|
|
614
|
+
{ include: '@interpolation' },
|
|
615
|
+
{ include: '@escapeChar' },
|
|
616
|
+
{ include: '@stringConstantContent' }
|
|
617
|
+
],
|
|
618
|
+
|
|
619
|
+
stringConstantContent: [[/./, 'constant']],
|
|
620
|
+
|
|
621
|
+
regexpContentInterpol: [
|
|
622
|
+
{ include: '@interpolation' },
|
|
623
|
+
{ include: '@escapeChar' },
|
|
624
|
+
{ include: '@regexpContent' }
|
|
625
|
+
],
|
|
626
|
+
|
|
627
|
+
regexpContent: [
|
|
628
|
+
// # may be a regular regexp char, so we use a heuristic
|
|
629
|
+
// assuming a # surrounded by whitespace is actually a comment.
|
|
630
|
+
[/(\s)(#)(\s.*)$/, ['white', 'comment.punctuation', 'comment']],
|
|
631
|
+
[/./, 'regexp']
|
|
632
|
+
],
|
|
633
|
+
|
|
634
|
+
sigilContentInterpol: [
|
|
635
|
+
{ include: '@interpolation' },
|
|
636
|
+
{ include: '@escapeChar' },
|
|
637
|
+
{ include: '@sigilContent' }
|
|
638
|
+
],
|
|
639
|
+
|
|
640
|
+
sigilContent: [[/./, 'sigil']],
|
|
641
|
+
|
|
642
|
+
docstringContent: [[/./, 'comment.block.documentation']],
|
|
643
|
+
|
|
644
|
+
escapeChar: [[/@escape/, 'constant.character.escape']],
|
|
645
|
+
|
|
646
|
+
interpolation: [[/#{/, { token: 'delimiter.bracket.embed', next: '@interpolationContinue' }]],
|
|
647
|
+
|
|
648
|
+
interpolationContinue: [
|
|
649
|
+
[/}/, { token: 'delimiter.bracket.embed', next: '@pop' }],
|
|
650
|
+
// Interpolation brackets may contain arbitrary code,
|
|
651
|
+
// so we simply match against all the root rules,
|
|
652
|
+
// until we reach interpolation end (the above matches).
|
|
653
|
+
{ include: '@root' }
|
|
654
|
+
]
|
|
655
|
+
}
|
|
656
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
import { registerLanguage } from '../_.contribution';
|
|
7
|
+
|
|
8
|
+
declare var AMD: any;
|
|
9
|
+
declare var require: any;
|
|
10
|
+
|
|
11
|
+
registerLanguage({
|
|
12
|
+
id: 'flow9',
|
|
13
|
+
extensions: ['.flow'],
|
|
14
|
+
aliases: ['Flow9', 'Flow', 'flow9', 'flow'],
|
|
15
|
+
loader: () => {
|
|
16
|
+
if (AMD) {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
require(['vs/basic-languages/flow9/flow9'], resolve, reject);
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
return import('./flow9');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|