@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,212 @@
|
|
|
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 glob from 'glob';
|
|
7
|
+
import { runTsc, massageAndCopyDts, buildESM, buildAMD } from './utils';
|
|
8
|
+
import { copyFile, removeDir } from './fs';
|
|
9
|
+
|
|
10
|
+
removeDir(`out/languages`);
|
|
11
|
+
|
|
12
|
+
runTsc(`src/tsconfig.json`);
|
|
13
|
+
|
|
14
|
+
//#region Type Defintion
|
|
15
|
+
|
|
16
|
+
massageAndCopyDts(
|
|
17
|
+
`out/languages/amd-tsc/language/css/monaco.contribution.d.ts`,
|
|
18
|
+
`out/languages/bundled/css.d.ts`,
|
|
19
|
+
'monaco.languages.css'
|
|
20
|
+
);
|
|
21
|
+
massageAndCopyDts(
|
|
22
|
+
`out/languages/amd-tsc/language/html/monaco.contribution.d.ts`,
|
|
23
|
+
`out/languages/bundled/html.d.ts`,
|
|
24
|
+
'monaco.languages.html'
|
|
25
|
+
);
|
|
26
|
+
massageAndCopyDts(
|
|
27
|
+
`out/languages/amd-tsc/language/json/monaco.contribution.d.ts`,
|
|
28
|
+
`out/languages/bundled/json.d.ts`,
|
|
29
|
+
'monaco.languages.json'
|
|
30
|
+
);
|
|
31
|
+
massageAndCopyDts(
|
|
32
|
+
`out/languages/amd-tsc/language/typescript/monaco.contribution.d.ts`,
|
|
33
|
+
`out/languages/bundled/typescript.d.ts`,
|
|
34
|
+
'monaco.languages.typescript'
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
|
|
39
|
+
//#region css
|
|
40
|
+
|
|
41
|
+
buildESM({
|
|
42
|
+
base: 'language/css',
|
|
43
|
+
entryPoints: [
|
|
44
|
+
'src/language/css/monaco.contribution.ts',
|
|
45
|
+
'src/language/css/cssMode.ts',
|
|
46
|
+
'src/language/css/css.worker.ts'
|
|
47
|
+
],
|
|
48
|
+
external: ['monaco-editor-core', '*/cssMode', '*/monaco.contribution']
|
|
49
|
+
});
|
|
50
|
+
buildAMD({
|
|
51
|
+
base: 'language/css',
|
|
52
|
+
entryPoint: 'src/language/css/monaco.contribution.ts',
|
|
53
|
+
amdModuleId: 'vs/language/css/monaco.contribution',
|
|
54
|
+
amdDependencies: ['vs/editor/editor.api']
|
|
55
|
+
});
|
|
56
|
+
buildAMD({
|
|
57
|
+
base: 'language/css',
|
|
58
|
+
entryPoint: 'src/language/css/cssMode.ts',
|
|
59
|
+
amdModuleId: 'vs/language/css/cssMode',
|
|
60
|
+
external: ['*/monaco.contribution']
|
|
61
|
+
});
|
|
62
|
+
buildAMD({
|
|
63
|
+
base: 'language/css',
|
|
64
|
+
entryPoint: 'src/language/css/cssWorker.ts',
|
|
65
|
+
amdModuleId: 'vs/language/css/cssWorker'
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
|
|
70
|
+
//#region html
|
|
71
|
+
|
|
72
|
+
buildESM({
|
|
73
|
+
base: 'language/html',
|
|
74
|
+
entryPoints: [
|
|
75
|
+
'src/language/html/monaco.contribution.ts',
|
|
76
|
+
'src/language/html/htmlMode.ts',
|
|
77
|
+
'src/language/html/html.worker.ts'
|
|
78
|
+
],
|
|
79
|
+
external: ['monaco-editor-core', '*/htmlMode', '*/monaco.contribution']
|
|
80
|
+
});
|
|
81
|
+
buildAMD({
|
|
82
|
+
base: 'language/html',
|
|
83
|
+
entryPoint: 'src/language/html/monaco.contribution.ts',
|
|
84
|
+
amdModuleId: 'vs/language/html/monaco.contribution',
|
|
85
|
+
amdDependencies: ['vs/editor/editor.api']
|
|
86
|
+
});
|
|
87
|
+
buildAMD({
|
|
88
|
+
base: 'language/html',
|
|
89
|
+
entryPoint: 'src/language/html/htmlMode.ts',
|
|
90
|
+
amdModuleId: 'vs/language/html/htmlMode',
|
|
91
|
+
external: ['*/monaco.contribution']
|
|
92
|
+
});
|
|
93
|
+
buildAMD({
|
|
94
|
+
base: 'language/html',
|
|
95
|
+
entryPoint: 'src/language/html/htmlWorker.ts',
|
|
96
|
+
amdModuleId: 'vs/language/html/htmlWorker'
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
|
|
101
|
+
//#region json
|
|
102
|
+
|
|
103
|
+
buildESM({
|
|
104
|
+
base: 'language/json',
|
|
105
|
+
entryPoints: [
|
|
106
|
+
'src/language/json/monaco.contribution.ts',
|
|
107
|
+
'src/language/json/jsonMode.ts',
|
|
108
|
+
'src/language/json/json.worker.ts'
|
|
109
|
+
],
|
|
110
|
+
external: ['monaco-editor-core', '*/jsonMode', '*/monaco.contribution']
|
|
111
|
+
});
|
|
112
|
+
buildAMD({
|
|
113
|
+
base: 'language/json',
|
|
114
|
+
entryPoint: 'src/language/json/monaco.contribution.ts',
|
|
115
|
+
amdModuleId: 'vs/language/json/monaco.contribution',
|
|
116
|
+
amdDependencies: ['vs/editor/editor.api']
|
|
117
|
+
});
|
|
118
|
+
buildAMD({
|
|
119
|
+
base: 'language/json',
|
|
120
|
+
entryPoint: 'src/language/json/jsonMode.ts',
|
|
121
|
+
amdModuleId: 'vs/language/json/jsonMode',
|
|
122
|
+
external: ['*/monaco.contribution']
|
|
123
|
+
});
|
|
124
|
+
buildAMD({
|
|
125
|
+
base: 'language/json',
|
|
126
|
+
entryPoint: 'src/language/json/jsonWorker.ts',
|
|
127
|
+
amdModuleId: 'vs/language/json/jsonWorker'
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
|
|
132
|
+
//#region typescript
|
|
133
|
+
|
|
134
|
+
buildESM({
|
|
135
|
+
base: 'language/typescript',
|
|
136
|
+
entryPoints: [
|
|
137
|
+
'src/language/typescript/monaco.contribution.ts',
|
|
138
|
+
'src/language/typescript/tsMode.ts',
|
|
139
|
+
'src/language/typescript/ts.worker.ts'
|
|
140
|
+
],
|
|
141
|
+
external: ['monaco-editor-core', '*/tsMode', '*/monaco.contribution']
|
|
142
|
+
});
|
|
143
|
+
buildAMD({
|
|
144
|
+
base: 'language/typescript',
|
|
145
|
+
entryPoint: 'src/language/typescript/monaco.contribution.ts',
|
|
146
|
+
amdModuleId: 'vs/language/typescript/monaco.contribution',
|
|
147
|
+
amdDependencies: ['vs/editor/editor.api']
|
|
148
|
+
});
|
|
149
|
+
buildAMD({
|
|
150
|
+
base: 'language/typescript',
|
|
151
|
+
entryPoint: 'src/language/typescript/tsMode.ts',
|
|
152
|
+
amdModuleId: 'vs/language/typescript/tsMode',
|
|
153
|
+
external: ['*/monaco.contribution']
|
|
154
|
+
});
|
|
155
|
+
buildAMD({
|
|
156
|
+
base: 'language/typescript',
|
|
157
|
+
entryPoint: 'src/language/typescript/tsWorker.ts',
|
|
158
|
+
amdModuleId: 'vs/language/typescript/tsWorker'
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
//#endregion
|
|
162
|
+
|
|
163
|
+
//#region basic-languages
|
|
164
|
+
|
|
165
|
+
glob('../src/basic-languages/*/*.contribution.ts', { cwd: __dirname }, function (err, files) {
|
|
166
|
+
if (err) {
|
|
167
|
+
console.error(err);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const languages = files.map((file) => file.split('/')[3]);
|
|
172
|
+
|
|
173
|
+
// ESM
|
|
174
|
+
{
|
|
175
|
+
/** @type {string[]} */
|
|
176
|
+
const entryPoints = [
|
|
177
|
+
'src/basic-languages/monaco.contribution.ts',
|
|
178
|
+
'src/basic-languages/_.contribution.ts'
|
|
179
|
+
];
|
|
180
|
+
const external = ['monaco-editor-core', '*/_.contribution'];
|
|
181
|
+
for (const language of languages) {
|
|
182
|
+
entryPoints.push(`src/basic-languages/${language}/${language}.contribution.ts`);
|
|
183
|
+
entryPoints.push(`src/basic-languages/${language}/${language}.ts`);
|
|
184
|
+
external.push(`*/${language}.contribution`);
|
|
185
|
+
external.push(`*/${language}`);
|
|
186
|
+
}
|
|
187
|
+
buildESM({
|
|
188
|
+
base: 'basic-languages',
|
|
189
|
+
entryPoints,
|
|
190
|
+
external
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// AMD
|
|
195
|
+
{
|
|
196
|
+
buildAMD({
|
|
197
|
+
base: 'basic-languages',
|
|
198
|
+
entryPoint: 'src/basic-languages/monaco.contribution.ts',
|
|
199
|
+
amdModuleId: 'vs/basic-languages/monaco.contribution',
|
|
200
|
+
amdDependencies: ['vs/editor/editor.api']
|
|
201
|
+
});
|
|
202
|
+
for (const language of languages) {
|
|
203
|
+
buildAMD({
|
|
204
|
+
base: 'basic-languages',
|
|
205
|
+
entryPoint: `src/basic-languages/${language}/${language}.ts`,
|
|
206
|
+
amdModuleId: `vs/basic-languages/${language}/${language}`
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
//#endregion
|
|
@@ -0,0 +1,463 @@
|
|
|
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 path = require('path');
|
|
7
|
+
import fs = require('fs');
|
|
8
|
+
import { REPO_ROOT, readFiles, writeFiles, IFile, readFile } from '../build/utils';
|
|
9
|
+
import { removeDir } from '../build/fs';
|
|
10
|
+
import ts = require('typescript');
|
|
11
|
+
import { generateMetadata } from './releaseMetadata';
|
|
12
|
+
|
|
13
|
+
removeDir(`out/monaco-editor`);
|
|
14
|
+
|
|
15
|
+
// dev folder
|
|
16
|
+
AMD_releaseOne('dev');
|
|
17
|
+
|
|
18
|
+
// min folder
|
|
19
|
+
AMD_releaseOne('min');
|
|
20
|
+
|
|
21
|
+
// esm folder
|
|
22
|
+
ESM_release();
|
|
23
|
+
|
|
24
|
+
// monaco.d.ts, editor.api.d.ts
|
|
25
|
+
releaseDTS();
|
|
26
|
+
|
|
27
|
+
// ThirdPartyNotices.txt
|
|
28
|
+
releaseThirdPartyNotices();
|
|
29
|
+
|
|
30
|
+
// esm/metadata.d.ts, esm/metadata.js
|
|
31
|
+
generateMetadata();
|
|
32
|
+
|
|
33
|
+
// package.json
|
|
34
|
+
(() => {
|
|
35
|
+
const packageJSON = readFiles('package.json', { base: '' })[0];
|
|
36
|
+
const json = JSON.parse(packageJSON.contents.toString());
|
|
37
|
+
|
|
38
|
+
json.private = false;
|
|
39
|
+
delete json.scripts['postinstall'];
|
|
40
|
+
|
|
41
|
+
packageJSON.contents = Buffer.from(JSON.stringify(json, null, ' '));
|
|
42
|
+
writeFiles([packageJSON], `out/monaco-editor`);
|
|
43
|
+
})();
|
|
44
|
+
|
|
45
|
+
(() => {
|
|
46
|
+
/** @type {IFile[]} */
|
|
47
|
+
let otherFiles = [];
|
|
48
|
+
|
|
49
|
+
otherFiles = otherFiles.concat(readFiles('README.md', { base: '' }));
|
|
50
|
+
otherFiles = otherFiles.concat(readFiles('CHANGELOG.md', { base: '' }));
|
|
51
|
+
otherFiles = otherFiles.concat(
|
|
52
|
+
readFiles('node_modules/monaco-editor-core/min-maps/**/*', {
|
|
53
|
+
base: 'node_modules/monaco-editor-core/'
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
otherFiles = otherFiles.concat(
|
|
57
|
+
readFiles('node_modules/monaco-editor-core/LICENSE', {
|
|
58
|
+
base: 'node_modules/monaco-editor-core/'
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
writeFiles(otherFiles, `out/monaco-editor`);
|
|
63
|
+
})();
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Release to `dev` or `min`.
|
|
67
|
+
*/
|
|
68
|
+
function AMD_releaseOne(type: 'dev' | 'min') {
|
|
69
|
+
let coreFiles = readFiles(`node_modules/monaco-editor-core/${type}/**/*`, {
|
|
70
|
+
base: `node_modules/monaco-editor-core/${type}`
|
|
71
|
+
});
|
|
72
|
+
coreFiles = fixNlsFiles(coreFiles);
|
|
73
|
+
AMD_addPluginContribs(type, coreFiles);
|
|
74
|
+
writeFiles(coreFiles, `out/monaco-editor/${type}`);
|
|
75
|
+
|
|
76
|
+
const pluginFiles = readFiles(`out/languages/bundled/amd-${type}/**/*`, {
|
|
77
|
+
base: `out/languages/bundled/amd-${type}`,
|
|
78
|
+
ignore: ['**/monaco.contribution.js']
|
|
79
|
+
});
|
|
80
|
+
writeFiles(pluginFiles, `out/monaco-editor/${type}`);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function fixNlsFiles(files: IFile[]): IFile[] {
|
|
84
|
+
return files.map((f) => {
|
|
85
|
+
if (!f.path.match(/nls\.messages\.[a-z\-]+\.js/)) {
|
|
86
|
+
return f;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const dirName = path.dirname(f.path);
|
|
90
|
+
const fileName = path.basename(f.path);
|
|
91
|
+
|
|
92
|
+
const newPath = path.join(dirName, 'vs', fileName);
|
|
93
|
+
let contentStr = f.contents.toString('utf-8');
|
|
94
|
+
|
|
95
|
+
contentStr = `
|
|
96
|
+
define([], function () {
|
|
97
|
+
${contentStr}
|
|
98
|
+
});
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
const newContents = Buffer.from(contentStr, 'utf-8');
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
path: newPath,
|
|
105
|
+
contents: newContents
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Edit editor.main.js:
|
|
112
|
+
* - rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
|
113
|
+
* - append monaco.contribution modules from plugins
|
|
114
|
+
* - append new AMD module 'vs/editor/editor.main' that stiches things together
|
|
115
|
+
*/
|
|
116
|
+
function AMD_addPluginContribs(type: 'dev' | 'min', files: IFile[]) {
|
|
117
|
+
for (const file of files) {
|
|
118
|
+
if (!/editor\.main\.js$/.test(file.path)) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
let contents = file.contents.toString();
|
|
123
|
+
|
|
124
|
+
// Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
|
125
|
+
contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"');
|
|
126
|
+
|
|
127
|
+
// This ensures that old nls-plugin configurations are still respected by the new localization solution.
|
|
128
|
+
const contentPrefixSource = readFile('src/nls-fix.js')
|
|
129
|
+
.contents.toString('utf-8')
|
|
130
|
+
.replace(/\r\n|\n/g, ' ');
|
|
131
|
+
|
|
132
|
+
// TODO: Instead of adding this source to the header to maintain the source map indices, it should rewrite the sourcemap!
|
|
133
|
+
const searchValue = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt';
|
|
134
|
+
contents = contents.replace(searchValue, searchValue + ' */ ' + contentPrefixSource + ' /*');
|
|
135
|
+
|
|
136
|
+
const pluginFiles = readFiles(`out/languages/bundled/amd-${type}/**/monaco.contribution.js`, {
|
|
137
|
+
base: `out/languages/bundled/amd-${type}`
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const extraContent = pluginFiles.map((file) => {
|
|
141
|
+
return file.contents
|
|
142
|
+
.toString()
|
|
143
|
+
.replace(
|
|
144
|
+
/define\((['"][a-z\/\-]+\/fillers\/monaco-editor-core['"]),\[\],/,
|
|
145
|
+
"define($1,['vs/editor/editor.api'],"
|
|
146
|
+
);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const allPluginsModuleIds = pluginFiles.map((file) => {
|
|
150
|
+
return file.path.replace(/\.js$/, '');
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
extraContent.push(
|
|
154
|
+
`define("vs/editor/editor.main", ["vs/editor/edcore.main","${allPluginsModuleIds.join(
|
|
155
|
+
'","'
|
|
156
|
+
)}"], function(api) { return api; });`
|
|
157
|
+
);
|
|
158
|
+
let insertIndex = contents.lastIndexOf('//# sourceMappingURL=');
|
|
159
|
+
if (insertIndex === -1) {
|
|
160
|
+
insertIndex = contents.length;
|
|
161
|
+
}
|
|
162
|
+
contents =
|
|
163
|
+
contents.substring(0, insertIndex) +
|
|
164
|
+
'\n' +
|
|
165
|
+
extraContent.join('\n') +
|
|
166
|
+
'\n' +
|
|
167
|
+
contents.substring(insertIndex);
|
|
168
|
+
|
|
169
|
+
file.contents = Buffer.from(contents);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function ESM_release() {
|
|
174
|
+
const coreFiles = readFiles(`node_modules/monaco-editor-core/esm/**/*`, {
|
|
175
|
+
base: 'node_modules/monaco-editor-core/esm',
|
|
176
|
+
// we will create our own editor.api.d.ts which also contains the plugins API
|
|
177
|
+
ignore: ['node_modules/monaco-editor-core/esm/vs/editor/editor.api.d.ts']
|
|
178
|
+
});
|
|
179
|
+
ESM_addImportSuffix(coreFiles);
|
|
180
|
+
ESM_addPluginContribs(coreFiles);
|
|
181
|
+
writeFiles(coreFiles, `out/monaco-editor/esm`);
|
|
182
|
+
|
|
183
|
+
ESM_releasePlugins();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Release a plugin to `esm`.
|
|
188
|
+
* Adds a dependency to 'vs/editor/editor.api' in contrib files in order for `monaco` to be defined.
|
|
189
|
+
* Rewrites imports for 'monaco-editor-core/**'
|
|
190
|
+
*/
|
|
191
|
+
function ESM_releasePlugins() {
|
|
192
|
+
const files = readFiles(`out/languages/bundled/esm/**/*`, { base: 'out/languages/bundled/esm/' });
|
|
193
|
+
|
|
194
|
+
for (const file of files) {
|
|
195
|
+
if (!/(\.js$)|(\.ts$)/.test(file.path)) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let contents = file.contents.toString();
|
|
200
|
+
|
|
201
|
+
const info = ts.preProcessFile(contents);
|
|
202
|
+
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
|
203
|
+
let importText = info.importedFiles[i].fileName;
|
|
204
|
+
const pos = info.importedFiles[i].pos;
|
|
205
|
+
const end = info.importedFiles[i].end;
|
|
206
|
+
|
|
207
|
+
if (!/(^\.\/)|(^\.\.\/)/.test(importText)) {
|
|
208
|
+
// non-relative import
|
|
209
|
+
if (!/^monaco-editor-core/.test(importText)) {
|
|
210
|
+
console.error(`Non-relative import for unknown module: ${importText} in ${file.path}`);
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (importText === 'monaco-editor-core') {
|
|
215
|
+
importText = 'monaco-editor-core/esm/vs/editor/editor.api';
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const importFilePath = importText.substring('monaco-editor-core/esm/'.length);
|
|
219
|
+
let relativePath = path
|
|
220
|
+
.relative(path.dirname(file.path), importFilePath)
|
|
221
|
+
.replace(/\\/g, '/');
|
|
222
|
+
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
|
223
|
+
relativePath = './' + relativePath;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
contents = contents.substring(0, pos + 1) + relativePath + contents.substring(end + 1);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
file.contents = Buffer.from(contents);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
for (const file of files) {
|
|
234
|
+
if (!/monaco\.contribution\.js$/.test(file.path)) {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const apiFilePath = 'vs/editor/editor.api';
|
|
239
|
+
let relativePath = path.relative(path.dirname(file.path), apiFilePath).replace(/\\/g, '/');
|
|
240
|
+
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
|
241
|
+
relativePath = './' + relativePath;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
let contents = file.contents.toString();
|
|
245
|
+
contents = `import '${relativePath}';\n` + contents;
|
|
246
|
+
file.contents = Buffer.from(contents);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
ESM_addImportSuffix(files);
|
|
250
|
+
writeFiles(files, `out/monaco-editor/esm`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Adds `.js` to all import statements.
|
|
255
|
+
*/
|
|
256
|
+
function ESM_addImportSuffix(files: IFile[]) {
|
|
257
|
+
for (const file of files) {
|
|
258
|
+
if (!/\.js$/.test(file.path)) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
let contents = file.contents.toString();
|
|
263
|
+
|
|
264
|
+
const info = ts.preProcessFile(contents);
|
|
265
|
+
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
|
266
|
+
const importText = info.importedFiles[i].fileName;
|
|
267
|
+
const pos = info.importedFiles[i].pos;
|
|
268
|
+
const end = info.importedFiles[i].end;
|
|
269
|
+
|
|
270
|
+
if (/(\.css)|(\.js)$/.test(importText)) {
|
|
271
|
+
// A CSS import or an import already using .js
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
contents = contents.substring(0, pos + 1) + importText + '.js' + contents.substring(end + 1);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
file.contents = Buffer.from(contents);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* - Rename esm/vs/editor/editor.main.js to esm/vs/editor/edcore.main.js
|
|
284
|
+
* - Create esm/vs/editor/editor.main.js that that stiches things together
|
|
285
|
+
*/
|
|
286
|
+
function ESM_addPluginContribs(files: IFile[]) {
|
|
287
|
+
for (const file of files) {
|
|
288
|
+
if (!/editor\.main\.js$/.test(file.path)) {
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
file.path = file.path.replace(/editor\.main/, 'edcore.main');
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const mainFileDestPath = 'vs/editor/editor.main.js';
|
|
295
|
+
|
|
296
|
+
const mainFileImports = readFiles(`out/languages/bundled/esm/**/monaco.contribution.js`, {
|
|
297
|
+
base: `out/languages/bundled/esm`
|
|
298
|
+
}).map((file) => {
|
|
299
|
+
let relativePath = path
|
|
300
|
+
.relative(path.dirname(mainFileDestPath), file.path)
|
|
301
|
+
.replace(/\\/g, '/')
|
|
302
|
+
.replace(/\.js$/, '');
|
|
303
|
+
|
|
304
|
+
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
|
305
|
+
relativePath = './' + relativePath;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return relativePath;
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
const mainFileContents =
|
|
312
|
+
mainFileImports.map((name) => `import '${name}';`).join('\n') +
|
|
313
|
+
`\n\nexport * from './edcore.main';`;
|
|
314
|
+
|
|
315
|
+
files.push({
|
|
316
|
+
path: mainFileDestPath,
|
|
317
|
+
contents: Buffer.from(mainFileContents)
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Edit monaco.d.ts:
|
|
323
|
+
* - append monaco.d.ts from plugins
|
|
324
|
+
*/
|
|
325
|
+
function releaseDTS() {
|
|
326
|
+
const monacodts = readFiles('node_modules/monaco-editor-core/monaco.d.ts', {
|
|
327
|
+
base: 'node_modules/monaco-editor-core'
|
|
328
|
+
})[0];
|
|
329
|
+
|
|
330
|
+
let contents = monacodts.contents.toString();
|
|
331
|
+
|
|
332
|
+
const extraContent = readFiles('out/languages/bundled/*.d.ts', {
|
|
333
|
+
base: 'out/languages/bundled/'
|
|
334
|
+
}).map((file) => {
|
|
335
|
+
return file.contents.toString().replace(/\/\/\/ <reference.*\n/m, '');
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
contents =
|
|
339
|
+
[
|
|
340
|
+
'/*!-----------------------------------------------------------',
|
|
341
|
+
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
|
342
|
+
' * Type definitions for monaco-editor',
|
|
343
|
+
' * Released under the MIT license',
|
|
344
|
+
'*-----------------------------------------------------------*/'
|
|
345
|
+
].join('\n') +
|
|
346
|
+
'\n' +
|
|
347
|
+
contents +
|
|
348
|
+
'\n' +
|
|
349
|
+
extraContent.join('\n');
|
|
350
|
+
|
|
351
|
+
// Ensure consistent indentation and line endings
|
|
352
|
+
contents = cleanFile(contents);
|
|
353
|
+
|
|
354
|
+
monacodts.contents = Buffer.from(contents);
|
|
355
|
+
|
|
356
|
+
const editorapidts = {
|
|
357
|
+
path: 'esm/vs/editor/editor.api.d.ts',
|
|
358
|
+
contents: Buffer.from(toExternalDTS(contents))
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
writeFiles([monacodts, editorapidts], `out/monaco-editor`);
|
|
362
|
+
|
|
363
|
+
// fs.writeFileSync('website/typedoc/monaco.d.ts', contents);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Transforms a .d.ts which uses internal modules (namespaces) to one which is usable with external modules
|
|
368
|
+
* This function is duplicated in the `vscode` repo.
|
|
369
|
+
*/
|
|
370
|
+
function toExternalDTS(contents: string): string {
|
|
371
|
+
let lines = contents.split(/\r\n|\r|\n/);
|
|
372
|
+
let killNextCloseCurlyBrace = false;
|
|
373
|
+
for (let i = 0; i < lines.length; i++) {
|
|
374
|
+
let line = lines[i];
|
|
375
|
+
|
|
376
|
+
if (killNextCloseCurlyBrace) {
|
|
377
|
+
if ('}' === line) {
|
|
378
|
+
lines[i] = '';
|
|
379
|
+
killNextCloseCurlyBrace = false;
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (line.indexOf(' ') === 0) {
|
|
384
|
+
lines[i] = line.substr(4);
|
|
385
|
+
} else if (line.charAt(0) === '\t') {
|
|
386
|
+
lines[i] = line.substr(1);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if ('declare namespace monaco {' === line) {
|
|
393
|
+
lines[i] = '';
|
|
394
|
+
killNextCloseCurlyBrace = true;
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (line.indexOf('declare namespace monaco.') === 0) {
|
|
399
|
+
lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (line.indexOf('declare let MonacoEnvironment') === 0) {
|
|
403
|
+
lines[i] = [
|
|
404
|
+
'declare global {',
|
|
405
|
+
' let MonacoEnvironment: Environment | undefined;',
|
|
406
|
+
'',
|
|
407
|
+
' interface Window {',
|
|
408
|
+
' MonacoEnvironment?: Environment | undefined;',
|
|
409
|
+
' }',
|
|
410
|
+
'}',
|
|
411
|
+
''
|
|
412
|
+
].join('\n');
|
|
413
|
+
}
|
|
414
|
+
if (line.indexOf(' MonacoEnvironment?') === 0) {
|
|
415
|
+
lines[i] = ` MonacoEnvironment?: Environment | undefined;`;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return lines.join('\n').replace(/\n\n\n+/g, '\n\n');
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Normalize line endings and ensure consistent 4 spaces indentation
|
|
423
|
+
*/
|
|
424
|
+
function cleanFile(contents: string): string {
|
|
425
|
+
return contents
|
|
426
|
+
.split(/\r\n|\r|\n/)
|
|
427
|
+
.map(function (line) {
|
|
428
|
+
const m = line.match(/^(\t+)/);
|
|
429
|
+
if (!m) {
|
|
430
|
+
return line;
|
|
431
|
+
}
|
|
432
|
+
const tabsCount = m[1].length;
|
|
433
|
+
let newIndent = '';
|
|
434
|
+
for (let i = 0; i < 4 * tabsCount; i++) {
|
|
435
|
+
newIndent += ' ';
|
|
436
|
+
}
|
|
437
|
+
return newIndent + line.substring(tabsCount);
|
|
438
|
+
})
|
|
439
|
+
.join('\n');
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Edit ThirdPartyNotices.txt:
|
|
444
|
+
* - append ThirdPartyNotices.txt from plugins
|
|
445
|
+
*/
|
|
446
|
+
function releaseThirdPartyNotices() {
|
|
447
|
+
const tpn = readFiles('node_modules/monaco-editor-core/ThirdPartyNotices.txt', {
|
|
448
|
+
base: 'node_modules/monaco-editor-core'
|
|
449
|
+
})[0];
|
|
450
|
+
|
|
451
|
+
let contents = tpn.contents.toString();
|
|
452
|
+
|
|
453
|
+
console.log('ADDING ThirdPartyNotices from ./ThirdPartyNotices.txt');
|
|
454
|
+
let thirdPartyNoticeContent = fs
|
|
455
|
+
.readFileSync(path.join(REPO_ROOT, 'ThirdPartyNotices.txt'))
|
|
456
|
+
.toString();
|
|
457
|
+
thirdPartyNoticeContent = thirdPartyNoticeContent.split('\n').slice(8).join('\n');
|
|
458
|
+
|
|
459
|
+
contents += '\n' + thirdPartyNoticeContent;
|
|
460
|
+
tpn.contents = Buffer.from(contents);
|
|
461
|
+
|
|
462
|
+
writeFiles([tpn], `out/monaco-editor`);
|
|
463
|
+
}
|