├── .gitattributes ├── .mocharc.json ├── samples ├── browser-esm-parcel │ ├── .gitignore │ ├── package.json │ ├── src │ │ ├── index.html │ │ └── index.js │ └── index.html ├── browser-esm-vite-react │ ├── .gitignore │ ├── src │ │ ├── vite-env.d.ts │ │ ├── components │ │ │ ├── Editor.module.css │ │ │ └── Editor.tsx │ │ ├── main.tsx │ │ └── userWorker.ts │ ├── vite.config.ts │ ├── tsconfig.json │ ├── index.html │ └── package.json ├── browser-esm-webpack │ ├── .gitignore │ ├── package.json │ ├── dist │ │ └── index.html │ ├── index.html │ ├── index.js │ └── webpack.config.js ├── electron-esm-webpack │ ├── .gitignore │ ├── package.json │ ├── index.js │ ├── main.js │ ├── webpack.config.js │ └── dist │ │ └── electron-index.html ├── browser-esm-webpack-small │ ├── .gitignore │ ├── package.json │ ├── dist │ │ └── index.html │ ├── index.html │ └── webpack.config.js ├── browser-esm-esbuild │ ├── .gitignore │ ├── package.json │ ├── dist │ │ └── index.html │ ├── index.html │ └── index.js ├── browser-esm-webpack-monaco-plugin │ ├── .gitignore │ ├── package.json │ ├── dist │ │ └── index.html │ ├── index.html │ ├── index.js │ └── webpack.config.js ├── browser-esm-webpack-typescript │ ├── .gitignore │ ├── src │ │ ├── index.css │ │ └── index.ts │ ├── package.json │ ├── tsconfig.json │ └── webpack.config.js ├── browser-esm-webpack-typescript-react │ ├── .gitignore │ ├── src │ │ ├── index.css │ │ ├── index.html │ │ └── index.tsx │ ├── tsconfig.json │ └── package.json ├── electron-amd │ ├── package.json │ ├── index.html │ └── main.js ├── electron-amd-nodeIntegration │ ├── package.json │ ├── index.html │ └── main.js ├── package.json ├── browser-amd-editor │ └── index.html ├── browser-amd-localized │ └── index.html ├── browser-amd-requirejs │ └── index.html ├── browser-amd-iframe │ └── inner.html ├── browser-amd-shared-model │ └── index.html └── browser-script-editor │ └── index.html ├── webpack-plugin ├── .npmignore ├── smoketest │ ├── index.js │ ├── webpack.config.js │ └── webpack-cross-origin.config.js ├── src │ ├── loader-utils.d.ts │ └── types.ts ├── tsconfig.json └── LICENSE ├── website ├── playground │ ├── new-samples │ │ ├── creating-the-editor │ │ │ ├── hello-world │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ │ ├── hard-wrapping │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── editor-basic-options │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ │ └── syntax-highlighting-for-html-elements │ │ │ │ ├── sample.css │ │ │ │ ├── sample.js │ │ │ │ └── sample.html │ │ ├── creating-the-diffeditor │ │ │ ├── hello-diff-world │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ │ ├── navigating-a-diff │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ │ ├── inline-diff-example │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ │ └── multi-line-example │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ ├── customizing-the-appearence │ │ │ ├── exposed-colors │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── tokens-and-colors │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ └── scrollbars │ │ │ │ ├── sample.html │ │ │ │ ├── sample.css │ │ │ │ └── sample.js │ │ ├── extending-language-services │ │ │ ├── custom-languages │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── color-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── configure-json-defaults │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── hover-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── codelens-provider-example │ │ │ │ ├── sample.css │ │ │ │ ├── sample.html │ │ │ │ └── sample.js │ │ │ ├── completion-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── folding-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── inlay-hints-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── symbols-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ ├── configure-javascript-defaults │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ │ └── semantic-tokens-provider-example │ │ │ │ ├── sample.css │ │ │ │ └── sample.html │ │ └── interacting-with-the-editor │ │ │ ├── listening-to-key-events │ │ │ ├── sample.css │ │ │ ├── sample.html │ │ │ └── sample.js │ │ │ ├── revealing-a-position │ │ │ ├── sample.css │ │ │ └── sample.html │ │ │ ├── customizing-the-line-numbers │ │ │ ├── sample.css │ │ │ ├── sample.html │ │ │ └── sample.js │ │ │ ├── adding-a-command-to-an-editor-instance │ │ │ ├── sample.css │ │ │ ├── sample.html │ │ │ └── sample.js │ │ │ ├── adding-an-action-to-an-editor-instance │ │ │ ├── sample.css │ │ │ └── sample.html │ │ │ ├── line-and-inline-decorations │ │ │ ├── sample.html │ │ │ ├── sample.css │ │ │ └── sample.js │ │ │ ├── rendering-glyphs-in-the-margin │ │ │ ├── sample.html │ │ │ ├── sample.css │ │ │ └── sample.js │ │ │ └── listening-to-mouse-events │ │ │ ├── sample.css │ │ │ └── sample.html │ └── run.png ├── .gitignore ├── fork.png ├── index │ └── samples │ │ ├── sample.msdax.txt │ │ ├── sample.redis.txt │ │ ├── sample.m3.txt │ │ ├── sample.csp.txt │ │ ├── sample.pla.txt │ │ ├── sample.sparql.txt │ │ ├── sample.ecl.txt │ │ ├── sample.fsharp.txt │ │ ├── sample.azcli.txt │ │ ├── sample.sb.txt │ │ ├── sample.pgsql.txt │ │ ├── sample.lua.txt │ │ ├── sample.flow9.txt │ │ ├── sample.python.txt │ │ ├── sample.ini.txt │ │ ├── sample.redshift.txt │ │ ├── sample.twig.txt │ │ ├── sample.yaml.txt │ │ ├── sample.apex.txt │ │ ├── sample.mysql.txt │ │ ├── sample.perl.txt │ │ ├── sample.proto.txt │ │ ├── sample.bat.txt │ │ ├── sample.systemverilog.txt │ │ ├── sample.coffeescript.txt │ │ ├── sample.mips.txt │ │ ├── sample.liquid.txt │ │ ├── sample.xml.txt │ │ ├── sample.pug.txt │ │ ├── sample.ruby.txt │ │ ├── sample.pascal.txt │ │ ├── sample.tcl.txt │ │ ├── sample.lexon.txt │ │ ├── sample.lex.txt │ │ ├── sample.cameligo.txt │ │ ├── sample.handlebars.txt │ │ ├── sample.powerquery.txt │ │ ├── sample.abap.txt │ │ ├── sample.pascaligo.txt │ │ ├── sample.csharp.txt │ │ ├── sample.julia.txt │ │ ├── sample.scss.txt │ │ ├── sample.restructuredtext.txt │ │ ├── sample.r.txt │ │ ├── sample.st.txt │ │ ├── sample.kotlin.txt │ │ ├── sample.less.txt │ │ ├── sample.bicep.txt │ │ └── sample.verilog.txt ├── monarch │ └── monarch-34px.png └── typedoc │ ├── tsconfig.json │ └── typedoc.json ├── .gitignore ├── .husky └── pre-commit ├── src ├── fillers │ ├── editor.api.d.ts │ ├── monaco-editor-core.ts │ └── monaco-editor-core-amd.ts ├── language │ ├── typescript │ │ ├── lib │ │ │ ├── typescriptServicesMetadata.ts │ │ │ └── editor.worker.d.ts │ │ └── ts.worker.ts │ ├── css │ │ └── css.worker.ts │ ├── html │ │ └── html.worker.ts │ └── json │ │ └── json.worker.ts ├── tsconfig.json └── basic-languages │ ├── csp │ ├── csp.test.ts │ └── csp.contribution.ts │ ├── ecl │ ├── ecl.test.ts │ └── ecl.contribution.ts │ ├── sas │ ├── sas.test.ts │ └── sas.contribution.ts │ ├── pla │ └── pla.contribution.ts │ ├── go │ └── go.contribution.ts │ ├── sql │ └── sql.contribution.ts │ ├── lua │ └── lua.contribution.ts │ ├── sb │ └── sb.contribution.ts │ ├── vb │ └── vb.contribution.ts │ ├── abap │ └── abap.contribution.ts │ ├── bicep │ └── bicep.contribution.ts │ ├── lexon │ └── lexon.contribution.ts │ ├── perl │ └── perl.contribution.ts │ ├── redis │ └── redis.contribution.ts │ ├── bat │ └── bat.contribution.ts │ ├── mysql │ ├── mysql.contribution.ts │ └── keywords.js │ ├── julia │ └── julia.contribution.ts │ ├── pug │ └── pug.contribution.ts │ ├── qsharp │ └── qsharp.contribution.ts │ ├── rust │ └── rust.contribution.ts │ ├── azcli │ └── azcli.contribution.ts │ ├── msdax │ └── msdax.contribution.ts │ ├── r │ └── r.contribution.ts │ ├── shell │ └── shell.contribution.ts │ ├── sparql │ └── sparql.contribution.ts │ ├── sophia │ └── sophia.contribution.ts │ ├── cameligo │ └── cameligo.contribution.ts │ ├── css │ └── css.contribution.ts │ ├── flow9 │ └── flow9.contribution.ts │ ├── redshift │ └── redshift.contribution.ts │ ├── csharp │ └── csharp.contribution.ts │ ├── elixir │ └── elixir.contribution.ts │ ├── hcl │ └── hcl.contribution.ts │ ├── pgsql │ ├── pgsql.contribution.ts │ └── keywords.js │ ├── tcl │ └── tcl.contribution.ts │ ├── m3 │ └── m3.contribution.ts │ ├── pascaligo │ └── pascaligo.contribution.ts │ ├── solidity │ └── solidity.contribution.ts │ ├── st │ └── st.contribution.ts │ ├── twig │ └── twig.contribution.ts │ ├── objective-c │ └── objective-c.contribution.ts │ ├── protobuf │ └── protobuf.contribution.ts │ ├── scheme │ └── scheme.contribution.ts │ ├── swift │ └── swift.contribution.ts │ ├── clojure │ └── clojure.contribution.ts │ ├── less │ └── less.contribution.ts │ ├── postiats │ └── postiats.contribution.ts │ ├── razor │ └── razor.contribution.ts │ ├── apex │ └── apex.contribution.ts │ ├── scss │ └── scss.contribution.ts │ ├── dart │ └── dart.contribution.ts │ ├── fsharp │ └── fsharp.contribution.ts │ ├── java │ └── java.contribution.ts │ ├── mips │ └── mips.contribution.ts │ ├── php │ └── php.contribution.ts │ ├── powerquery │ └── powerquery.contribution.ts │ ├── dockerfile │ └── dockerfile.contribution.ts │ ├── kotlin │ └── kotlin.contribution.ts │ ├── liquid │ └── liquid.contribution.ts │ ├── ruby │ └── ruby.contribution.ts │ ├── powershell │ └── powershell.contribution.ts │ ├── yaml │ └── yaml.contribution.ts │ ├── graphql │ └── graphql.contribution.ts │ ├── pascal │ └── pascal.contribution.ts │ ├── restructuredtext │ └── restructuredtext.contribution.ts │ ├── ini │ └── ini.contribution.ts │ ├── markdown │ └── markdown.contribution.ts │ ├── python │ └── python.contribution.ts │ ├── coffee │ └── coffee.contribution.ts │ ├── typescript │ └── typescript.contribution.ts │ ├── handlebars │ └── handlebars.contribution.ts │ ├── scala │ └── scala.contribution.ts │ ├── html │ └── html.contribution.ts │ ├── javascript │ └── javascript.contribution.ts │ ├── xml │ └── xml.contribution.ts │ └── cpp │ └── cpp.contribution.ts ├── .github ├── ISSUE_TEMPLATE │ ├── 3_other.md │ ├── config.yml │ └── 2_feature_request.yaml ├── publish-failure-issue-template.md └── workflows │ ├── publish-website.sh │ ├── publish │ ├── setVersion.js │ └── setDevDependencyVersion.js │ ├── locker.yml │ └── website.yml ├── .prettierrc ├── editor.code-workspace ├── gulpfile.js ├── test ├── smoke │ ├── esbuild │ │ ├── esbuild.html │ │ └── index.js │ ├── webpack │ │ └── webpack.html │ ├── common.js │ └── amd.html ├── manual │ ├── index.css │ ├── samples │ │ ├── run-editor-sample-cr-ps1.txt │ │ ├── run-editor-sample-html.txt │ │ ├── run-editor-intellisense-js.txt │ │ └── run-editor-korean.txt │ ├── diff.html │ ├── iframe.html │ ├── iframe-inner.html │ ├── transform.html │ ├── cross-origin.html │ └── mouse-fixed.html └── unit │ └── setup.js ├── .vscode └── settings.json ├── .prettierignore ├── docs └── integrate-amd.md └── LICENSE.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "delay": true, 3 | "ui": "tdd" 4 | } 5 | -------------------------------------------------------------------------------- /samples/browser-esm-parcel/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | .parcel-cache 3 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | src/**/*.js 3 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack/.gitignore: -------------------------------------------------------------------------------- 1 | dist/*.js 2 | dist/*.ttf 3 | -------------------------------------------------------------------------------- /webpack-plugin/.npmignore: -------------------------------------------------------------------------------- 1 | /scripts/ 2 | /src/ 3 | /smoketest/ 4 | -------------------------------------------------------------------------------- /samples/electron-esm-webpack/.gitignore: -------------------------------------------------------------------------------- 1 | /dist/*.js 2 | /dist/*.ttf 3 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/hello-world/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/hard-wrapping/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/hello-diff-world/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/navigating-a-diff/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/editor-basic-options/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/exposed-colors/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-small/.gitignore: -------------------------------------------------------------------------------- 1 | dist/*.js 2 | dist/*.ttf 3 | dist/*.txt 4 | -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/monaco-editor/dev 2 | node_modules/monaco-editor/esm 3 | -------------------------------------------------------------------------------- /website/fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sasjs/monaco-editor/main/website/fork.png -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/inline-diff-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/multi-line-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/tokens-and-colors/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/custom-languages/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/node_modules/ 2 | **/out/ 3 | **/release/ 4 | /test/manual/generated/** 5 | -------------------------------------------------------------------------------- /samples/browser-esm-esbuild/.gitignore: -------------------------------------------------------------------------------- 1 | dist/**/*.js 2 | dist/**/*.ttf 3 | dist/**/*.css 4 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/color-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/configure-json-defaults/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/hover-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/listening-to-key-events/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/revealing-a-position/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run pretty-quick 5 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-monaco-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | dist/*.js 2 | dist/*.ttf 3 | dist/*.txt 4 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/codelens-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/completion-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/folding-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/inlay-hints-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/symbols-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/configure-javascript-defaults/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/semantic-tokens-provider-example/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | lib 3 | logs 4 | *.log 5 | npm-debug.log* 6 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/playground/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sasjs/monaco-editor/main/website/playground/run.png -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript-react/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | lib 3 | logs 4 | *.log 5 | npm-debug.log* 6 | -------------------------------------------------------------------------------- /src/fillers/editor.api.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'vs/editor/editor.api' { 2 | const x: any; 3 | export = x; 4 | } 5 | -------------------------------------------------------------------------------- /website/index/samples/sample.msdax.txt: -------------------------------------------------------------------------------- 1 | = CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSQUARTER(Calendar[DateKey])) -------------------------------------------------------------------------------- /website/index/samples/sample.redis.txt: -------------------------------------------------------------------------------- 1 | EXISTS mykey 2 | APPEND mykey "Hello" 3 | APPEND mykey " World" 4 | GET mykey -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/src/components/Editor.module.css: -------------------------------------------------------------------------------- 1 | .Editor { 2 | width: 100vw; 3 | height: 100vh; 4 | } 5 | -------------------------------------------------------------------------------- /website/monarch/monarch-34px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sasjs/monaco-editor/main/website/monarch/monarch-34px.png -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/hard-wrapping/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/hello-world/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/scrollbars/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /samples/browser-esm-esbuild/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "helloworld", 3 | "scripts": { 4 | "build": "node ./build.js" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 800px; 3 | height: 600px; 4 | border: 1px solid #ccc; 5 | } 6 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/hello-diff-world/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/inline-diff-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/multi-line-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/navigating-a-diff/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/editor-basic-options/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/exposed-colors/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/tokens-and-colors/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/custom-languages/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/revealing-a-position/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript-react/src/index.css: -------------------------------------------------------------------------------- 1 | .Editor { 2 | width: 800px; 3 | height: 600px; 4 | border: 1px solid #ccc; 5 | } 6 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/codelens-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/color-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/configure-json-defaults/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/folding-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/hover-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/symbols-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/listening-to-key-events/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/completion-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/configure-javascript-defaults/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/inlay-hints-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/line-and-inline-decorations/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/index/samples/sample.m3.txt: -------------------------------------------------------------------------------- 1 | MODULE HelloWorld EXPORTS Main; 2 | FROM IO IMPORT Put; 3 | BEGIN 4 | Put("Hello World\n") 5 | END HelloWorld. 6 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/semantic-tokens-provider-example/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/3_other.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Other Request (For Maintainers Only) 3 | about: This issue template should only be used by maintainers. 4 | --- 5 | -------------------------------------------------------------------------------- /website/index/samples/sample.csp.txt: -------------------------------------------------------------------------------- 1 | Content-Security-Policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/typedoc/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJS" 4 | }, 5 | "include": ["monaco.d.ts"], 6 | "exclude": ["theme"] 7 | } 8 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "semi": true, 6 | "useTabs": true, 7 | "printWidth": 100 8 | } 9 | -------------------------------------------------------------------------------- /samples/electron-amd/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-amd", 3 | "scripts": { 4 | "execute": "node ../node_modules/electron/cli.js ." 5 | }, 6 | "main": "./main" 7 | } 8 | -------------------------------------------------------------------------------- /website/index/samples/sample.pla.txt: -------------------------------------------------------------------------------- 1 | .ob out1 out2 out3 2 | --1-- - wait 110000 3 | .ilb in1 in0 wait ack nack 4 | .symbolic state<3> state<2>;aaa bbb; # comment 5 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-esm-webpack", 3 | "scripts": { 4 | "build": "node ../node_modules/webpack/bin/webpack.js --progress" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.github/publish-failure-issue-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: NPM Publishing Failed 3 | assignees: [] 4 | labels: bug 5 | --- 6 | 7 | NPM publishing failed. Check the last GitHub Action log. 8 | -------------------------------------------------------------------------------- /webpack-plugin/smoketest/index.js: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; 2 | 3 | // expose the monaco API as a global for tests 4 | window.monacoAPI = monaco; 5 | -------------------------------------------------------------------------------- /editor.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "../vscode" 5 | }, 6 | { 7 | "path": "../vscode-loc" 8 | }, 9 | { 10 | "path": "." 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/listening-to-mouse-events/sample.css: -------------------------------------------------------------------------------- 1 | .myGlyphMarginClass { 2 | background: red; 3 | } 4 | .myContentClass { 5 | background: lightblue; 6 | } 7 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-monaco-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-esm-webpack-monaco-plugin", 3 | "scripts": { 4 | "build": "node ../node_modules/webpack/bin/webpack.js --progress" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /samples/electron-amd-nodeIntegration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-amd-node-integration", 3 | "scripts": { 4 | "execute": "node ../node_modules/electron/cli.js ." 5 | }, 6 | "main": "./main" 7 | } 8 | -------------------------------------------------------------------------------- /website/index/samples/sample.sparql.txt: -------------------------------------------------------------------------------- 1 | SELECT ?x ?name 2 | { 3 | ?x foaf:mbox . 4 | ?x foaf:knows ?a1 . 5 | ?a1 foaf:knows ?a2 . 6 | ?a2 foaf:name ?name . 7 | } 8 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.css: -------------------------------------------------------------------------------- 1 | .myGlyphMarginClass { 2 | background: red; 3 | } 4 | .myContentClass { 5 | background: lightblue; 6 | } 7 | -------------------------------------------------------------------------------- /src/language/typescript/lib/typescriptServicesMetadata.ts: -------------------------------------------------------------------------------- 1 | // 2 | // **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript` 3 | // 4 | 5 | export const typescriptVersion = "4.5.5"; 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Question 4 | url: https://stackoverflow.com/questions/tagged/monaco-editor 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /website/index/samples/sample.ecl.txt: -------------------------------------------------------------------------------- 1 | F0 := IMDB.File_actors; 2 | CountActors := RECORD 3 | F0.ActorName; 4 | UNSIGNED C := COUNT(GROUP); 5 | END; 6 | MoviesIn := TABLE(F0,CountActors,ActorName); 7 | OUTPUT(TOPN(MoviesIn,100,-C)); 8 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()] 7 | }); 8 | -------------------------------------------------------------------------------- /website/typedoc/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["monaco.d.ts"], 3 | "out": "../../../monaco-editor-website/api", 4 | "theme": "default", 5 | "name": "Monaco Editor API", 6 | "readme": "none", 7 | "hideGenerator": true 8 | } 9 | -------------------------------------------------------------------------------- /samples/browser-esm-parcel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "helloworld", 3 | "scripts": { 4 | "start": "parcel ./src/index.html" 5 | }, 6 | "devDependencies": { 7 | "monaco-editor": "^0.32.0", 8 | "parcel": "^2.2.1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-small/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-esm-webpack-small", 3 | "scripts": { 4 | "build": "node ../node_modules/webpack/bin/webpack.js --progress", 5 | "generate-imports": "node generate-imports.js" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /webpack-plugin/src/loader-utils.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'loader-utils' { 2 | export function interpolateName(loaderContext: any, name: string, options?: any): string; 3 | 4 | export function stringifyRequest(loaderContext: any, resource: string): string; 5 | } 6 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript-react/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Monaco Editor Sample 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /webpack-plugin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "outDir": "out", 5 | "target": "es6", 6 | "declaration": true, 7 | "strict": true 8 | }, 9 | "include": ["src"], 10 | "exclude": ["node_modules"] 11 | } 12 | -------------------------------------------------------------------------------- /samples/electron-esm-webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-esm-webpack", 3 | "main": "./main", 4 | "scripts": { 5 | "build": "node ../node_modules/webpack/bin/webpack.js --progress", 6 | "execute": "node ../node_modules/electron/cli.js ." 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /webpack-plugin/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface IWorkerDefinition { 2 | id: string; 3 | entry: string; 4 | } 5 | 6 | export interface IFeatureDefinition { 7 | label: string; 8 | entry: string | string[] | undefined; 9 | worker?: IWorkerDefinition; 10 | } 11 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-monaco-plugin/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monaco-esm-webpack-typescript", 3 | "scripts": { 4 | "start": "node ../node_modules/webpack-dev-server/bin/webpack-dev-server.js", 5 | "build": "node ../node_modules/webpack/bin/webpack.js --progress" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /website/index/samples/sample.fsharp.txt: -------------------------------------------------------------------------------- 1 | (* Sample F# application *) 2 | [] 3 | let main argv = 4 | printfn "%A" argv 5 | System.Console.WriteLine("Hello from F#") 6 | 0 // return an integer exit code 7 | 8 | //-------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "strict": true, 5 | "module": "ESNext", 6 | "jsx": "react-jsx", 7 | "moduleResolution": "node", 8 | "allowSyntheticDefaultImports": true 9 | }, 10 | "include": ["./src"] 11 | } 12 | -------------------------------------------------------------------------------- /website/index/samples/sample.azcli.txt: -------------------------------------------------------------------------------- 1 | # Create a resource group. 2 | az group create --name myResourceGroup --location westeurope 3 | 4 | # Create a new virtual machine, this creates SSH keys if not present. 5 | az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --generate-ssh-keys -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/listening-to-mouse-events/sample.html: -------------------------------------------------------------------------------- 1 |
2 | Last 3 events:
3 |
4 |
5 |
6 | -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "lib": ["dom", "es5", "es2015.collection", "es2015.promise", "es2015.iterable"], 5 | "module": "amd", 6 | "moduleResolution": "node", 7 | "outDir": "../out/amd", 8 | "strict": true, 9 | "target": "es5" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /website/index/samples/sample.sb.txt: -------------------------------------------------------------------------------- 1 | begin: 2 | TextWindow.Write("Enter a number: ") 3 | num = TextWindow.ReadNumber() 4 | remainder = Math.Remainder(num, 2) 5 | If (remainder = 0) Then 6 | TextWindow.WriteLine("The number is Even") 7 | Else 8 | TextWindow.WriteLine("The number is Odd") 9 | EndIf 10 | Goto begin -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import { Editor } from './components/Editor'; 4 | import './userWorker'; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById('root') 11 | ); 12 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.js: -------------------------------------------------------------------------------- 1 | // The colorizeElement-function will read the data-lang-attribute 2 | // from the element to select the correct language mode. In this 3 | // sample it is text/css. 4 | monaco.editor.colorizeElement(document.getElementById('code')); 5 | -------------------------------------------------------------------------------- /website/index/samples/sample.pgsql.txt: -------------------------------------------------------------------------------- 1 | BEGIN 2 | SELECT * INTO STRICT myrec FROM emp WHERE empname = myname; 3 | EXCEPTION 4 | WHEN NO_DATA_FOUND THEN 5 | RAISE EXCEPTION 'employee % not found', myname; 6 | WHEN TOO_MANY_ROWS THEN 7 | RAISE EXCEPTION 'employee % not unique', myname; 8 | END; -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const es = require('event-stream'); 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const rimraf = require('rimraf'); 6 | const cp = require('child_process'); 7 | const CleanCSS = require('clean-css'); 8 | const uncss = require('uncss'); 9 | const File = require('vinyl'); 10 | -------------------------------------------------------------------------------- /website/index/samples/sample.lua.txt: -------------------------------------------------------------------------------- 1 | -- defines a factorial function 2 | function fact (n) 3 | if n == 0 then 4 | return 1 5 | else 6 | return n * fact(n-1) 7 | end 8 | end 9 | 10 | print("enter a number:") 11 | a = io.read("*number") -- read a number 12 | print(fact(a)) -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript-react/src/index.tsx: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | 3 | import React from 'react'; 4 | import ReactDOM from 'react-dom'; 5 | import { Editor } from './components/Editor'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | -------------------------------------------------------------------------------- /website/index/samples/sample.flow9.txt: -------------------------------------------------------------------------------- 1 | import material/material; 2 | 3 | export { 4 | demoMakeHelloWorld(onClose : () -> void) -> Material; 5 | } 6 | 7 | demoMakeHelloWorld(onClose : () -> void) -> Material { 8 | MCenter( 9 | MLines2( 10 | MText("Hello, world!", []), 11 | MTextButton("CLOSE", onClose, [], []) 12 | ) 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/browser-esm-parcel/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-small/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/smoke/esbuild/esbuild.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/smoke/webpack/webpack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /website/index/samples/sample.python.txt: -------------------------------------------------------------------------------- 1 | import banana 2 | 3 | 4 | class Monkey: 5 | # Bananas the monkey can eat. 6 | capacity = 10 7 | def eat(self, n): 8 | """Make the monkey eat n bananas!""" 9 | self.capacity -= n * banana.size 10 | 11 | def feeding_frenzy(self): 12 | self.eat(9.25) 13 | return "Yum yum" 14 | -------------------------------------------------------------------------------- /website/index/samples/sample.ini.txt: -------------------------------------------------------------------------------- 1 | # Example of a .gitconfig file 2 | 3 | [core] 4 | repositoryformatversion = 0 5 | filemode = false 6 | bare = false 7 | logallrefupdates = true 8 | symlinks = false 9 | ignorecase = true 10 | hideDotFiles = dotGitOnly 11 | 12 | # Defines the master branch 13 | [branch "master"] 14 | remote = origin 15 | merge = refs/heads/master 16 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/line-and-inline-decorations/sample.css: -------------------------------------------------------------------------------- 1 | .myInlineDecoration { 2 | color: red !important; 3 | cursor: pointer; 4 | text-decoration: underline; 5 | font-weight: bold; 6 | font-style: oblique; 7 | } 8 | 9 | .myLineDecoration { 10 | background: lightblue; 11 | width: 5px !important; 12 | margin-left: 3px; 13 | } 14 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | browser-esm-vite-react 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /website/index/samples/sample.redshift.txt: -------------------------------------------------------------------------------- 1 | create view tables_vw as 2 | select distinct(id) table_id 3 | ,trim(datname) db_name 4 | ,trim(nspname) schema_name 5 | ,trim(relname) table_name 6 | from stv_tbl_perm 7 | join pg_class on pg_class.oid = stv_tbl_perm.id 8 | join pg_namespace on pg_namespace.oid = relnamespace 9 | join pg_database on pg_database.oid = stv_tbl_perm.db_id; 10 | -------------------------------------------------------------------------------- /website/index/samples/sample.twig.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block title %}Welcome!{% endblock %} 6 | {% block stylesheets %}{% endblock %} 7 | 8 | 9 | {% block body %}{% endblock %} 10 | {% block javascripts %}{% endblock %} 11 | 12 | 13 | -------------------------------------------------------------------------------- /website/index/samples/sample.yaml.txt: -------------------------------------------------------------------------------- 1 | %TAG ! tag:clarkevans.com,2002: 2 | --- !shape 3 | # Use the ! handle for presenting 4 | # tag:clarkevans.com,2002:circle 5 | - !circle 6 | center: &ORIGIN {x: 73, y: 129} 7 | radius: 7 8 | - !line 9 | start: *ORIGIN 10 | finish: { x: 89, y: 102 } 11 | - !label 12 | start: *ORIGIN 13 | color: 0xFFEEBB 14 | text: Pretty vector drawing. 15 | -------------------------------------------------------------------------------- /test/manual/index.css: -------------------------------------------------------------------------------- 1 | .monaco-editor .token.custom-info { 2 | color: grey !important; 3 | } 4 | .monaco-editor .token.custom-error { 5 | color: red !important; 6 | font-weight: bold !important; 7 | font-size: 1.2em !important; 8 | } 9 | .monaco-editor .token.custom-notice { 10 | color: orange !important; 11 | } 12 | .monaco-editor .token.custom-date { 13 | color: green !important; 14 | } 15 | -------------------------------------------------------------------------------- /test/smoke/common.js: -------------------------------------------------------------------------------- 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 | exports.PORT = 8563; 7 | -------------------------------------------------------------------------------- /samples/browser-esm-esbuild/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /website/index/samples/sample.apex.txt: -------------------------------------------------------------------------------- 1 | /* Using a single database query, find all the leads in 2 | the database that have the same email address as any 3 | of the leads being inserted or updated. */ 4 | for (Lead lead : [SELECT Email FROM Lead WHERE Email IN :leadMap.KeySet()]) { 5 | Lead newLead = leadMap.get(lead.Email); 6 | newLead.Email.addError('A lead with this email address already exists.'); 7 | } 8 | -------------------------------------------------------------------------------- /website/index/samples/sample.mysql.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE shop ( 2 | article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL, 3 | dealer CHAR(20) DEFAULT '' NOT NULL, 4 | price DOUBLE(16,2) DEFAULT '0.00' NOT NULL, 5 | PRIMARY KEY(article, dealer)); 6 | INSERT INTO shop VALUES 7 | (1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45), 8 | (3,'C',1.69),(3,'D',1.25),(4,'D',19.95); -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "editor.tabSize": 4, 4 | "editor.insertSpaces": false, 5 | "files.insertFinalNewline": true, 6 | "files.trimTrailingWhitespace": true, 7 | "search.exclude": { 8 | "**/node_modules": true, 9 | "**/release": true, 10 | "**/out": true 11 | }, 12 | "typescript.tsdk": "./node_modules/typescript/lib" 13 | } 14 | -------------------------------------------------------------------------------- /test/manual/samples/run-editor-sample-cr-ps1.txt: -------------------------------------------------------------------------------- 1 | 2 | # A line that ends only in CR(0x0D) and not LF (0x0A). foreach($parameterSet in $ObjInfoArray) 3 | { 4 | # This line also ends only in CR(0x0D) and not LF (0x0A). if ($parameterSet["class"] -eq "blank") 5 | { 6 | if ($XenCenterNodeSelected) 7 | { 8 | continue 9 | } 10 | $XenCenterNodeSelected = 1; $SelectedObjectNames += "XenCenter" 11 | } 12 | } -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/hello-diff-world/sample.js: -------------------------------------------------------------------------------- 1 | var originalModel = monaco.editor.createModel('heLLo world!', 'text/plain'); 2 | var modifiedModel = monaco.editor.createModel('hello orlando!', 'text/plain'); 3 | 4 | var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container')); 5 | diffEditor.setModel({ 6 | original: originalModel, 7 | modified: modifiedModel 8 | }); 9 | -------------------------------------------------------------------------------- /src/fillers/monaco-editor-core.ts: -------------------------------------------------------------------------------- 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 | export * from 'monaco-editor-core'; 7 | -------------------------------------------------------------------------------- /website/index/samples/sample.perl.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use strict; 3 | use warnings; 4 | 5 | use Path::Tiny; 6 | 7 | my $dir = path('foo','bar'); # foo/bar 8 | 9 | # Iterate over the content of foo/bar 10 | my $iter = $dir->iterator; 11 | while (my $file = $iter->()) { 12 | 13 | # See if it is a directory and skip 14 | next if $file->is_dir(); 15 | 16 | # Print out the file name and path 17 | print "$file\n"; 18 | } -------------------------------------------------------------------------------- /samples/browser-esm-esbuild/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor esbuild Bundler Sample

8 | 9 | To run this sample, you need to: 10 | 11 |
12 | $/browser-esm-esbuild> npm run build
13 | 
15 | 16 | Then, open the ./dist folder. 17 | 18 | 19 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/hello-world/sample.js: -------------------------------------------------------------------------------- 1 | // The Monaco Editor can be easily created, given an 2 | // empty container and an options literal. 3 | // Two members of the literal are "value" and "language". 4 | // The editor takes the full size of its container. 5 | 6 | monaco.editor.create(document.getElementById('container'), { 7 | value: "function hello() {\n\talert('Hello world!');\n}", 8 | language: 'javascript' 9 | }); 10 | -------------------------------------------------------------------------------- /website/index/samples/sample.proto.txt: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import public "other.proto"; 3 | 4 | /* SearchRequest represents a search query, with pagination options to 5 | * indicate which results to include in the response. */ 6 | 7 | message SearchRequest { 8 | required string query = 1; 9 | optional int32 page_number = 2; // Which page number do we want? 10 | optional int32 result_per_page = 3; // Number of results to return per page. 11 | } 12 | -------------------------------------------------------------------------------- /website/index/samples/sample.bat.txt: -------------------------------------------------------------------------------- 1 | rem *******Begin Comment************** 2 | rem This program starts the superapp batch program on the network, 3 | rem directs the output to a file, and displays the file 4 | rem in Notepad. 5 | rem *******End Comment************** 6 | @echo off 7 | if exist C:\output.txt goto EMPTYEXISTS 8 | setlocal 9 | path=g:\programs\superapp;%path% 10 | call superapp>C:\output.txt 11 | endlocal 12 | :EMPTYEXISTS 13 | start notepad c:\output.txt -------------------------------------------------------------------------------- /samples/electron-amd/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Electron Sample

8 | 9 | To run this sample, you need to 10 | download Electron 11 | and then execute: 12 | 13 |
14 | $/electron-amd> electron main.js
15 | 
17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/electron-amd-nodeIntegration/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Electron Sample

8 | 9 | To run this sample, you need to 10 | download Electron 11 | and then execute: 12 | 13 |
14 | $/electron-amd> electron main.js
15 | 
17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "target": "es5", 7 | "outDir": "./dist", 8 | "lib": ["dom", "es5", "es2015.collection", "es2015.promise"], 9 | "types": [], 10 | "baseUrl": "./node_modules", 11 | "jsx": "preserve", 12 | "typeRoots": ["node_modules/@types"] 13 | }, 14 | "include": ["./src/**/*"], 15 | "exclude": ["node_modules"] 16 | } 17 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Webpack Sample

8 | 9 | To run this sample, you need to: 10 | 11 |
12 | $/> npm install .
13 | $/> npm run simpleserver
14 | $/browser-esm-webpack> npm run build
15 | 
17 | 18 | Then, open the ./dist folder. 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/basic-languages/csp/csp.test.ts: -------------------------------------------------------------------------------- 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 { testTokenization } from '../test/testRunner'; 7 | 8 | testTokenization('csp', []); 9 | -------------------------------------------------------------------------------- /src/basic-languages/ecl/ecl.test.ts: -------------------------------------------------------------------------------- 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 { testTokenization } from '../test/testRunner'; 7 | 8 | testTokenization('ecl', []); 9 | -------------------------------------------------------------------------------- /samples/browser-esm-parcel/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Parcel Bundler Sample

8 | 9 | To run this sample, you need to: 10 | 11 |
12 | $/browser-esm-parcel> npm install .
13 | $/browser-esm-parcel> npm start
14 | 
16 | 17 | Then, open http://localhost:9999/. 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/manual/samples/run-editor-sample-html.txt: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | HTML Sample 8 | 15 | 18 | 19 | 20 |

Heading No.1

21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/listening-to-key-events/sample.js: -------------------------------------------------------------------------------- 1 | var editor = monaco.editor.create(document.getElementById('container'), { 2 | value: "function hello() {\n\talert('Hello world!');\n}", 3 | language: 'javascript' 4 | }); 5 | 6 | var myBinding = editor.addCommand(monaco.KeyCode.F9, function () { 7 | alert('F9 pressed!'); 8 | }); 9 | 10 | // You can't dispose `addCommand` 11 | // If you need to dispose it you might use `addAction` or `registerCommand` 12 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-monaco-plugin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Webpack Plugin Sample

8 | 9 | To run this sample, you need to: 10 | 11 |
12 | $/> npm install .
13 | $/> npm run simpleserver
14 | $/browser-esm-webpack-monaco-plugin> npm run build
15 | 
17 | 18 | Then, open the ./dist folder. 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/manual/diff.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
11 |
12 | 13 | 14 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.github/workflows/publish-website.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | COMMITTER_USER_NAME="$(git log --format='%an' -1)" 4 | COMMITTER_EMAIL="$(git log --format='%ae' -1)" 5 | 6 | cd ../monaco-editor-website 7 | git init 8 | git config user.name "${COMMITTER_USER_NAME}" 9 | git config user.email "${COMMITTER_EMAIL}" 10 | git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/microsoft/monaco-editor.git" 11 | git checkout -b gh-pages 12 | git add . 13 | git commit -m "Publish website" 14 | git push origin gh-pages --force 15 | -------------------------------------------------------------------------------- /test/unit/setup.js: -------------------------------------------------------------------------------- 1 | define('vs/css', [], { 2 | load: function (name, req, load) { 3 | load({}); 4 | } 5 | }); 6 | 7 | define('vs/nls', [], { 8 | create: function () { 9 | return { 10 | localize: function () { 11 | return 'NO_LOCALIZATION_FOR_YOU'; 12 | } 13 | }; 14 | }, 15 | localize: function () { 16 | return 'NO_LOCALIZATION_FOR_YOU'; 17 | }, 18 | load: function (name, req, load) { 19 | load({}); 20 | } 21 | }); 22 | 23 | define(['vs/editor/editor.main'], function (api) { 24 | global.monaco = api; 25 | }); 26 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript-react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "target": "ES6", 8 | "outDir": "./dist", 9 | "lib": ["dom", "es5", "es2015.collection", "es2015.promise"], 10 | "types": [], 11 | "baseUrl": "./node_modules", 12 | "jsx": "preserve", 13 | "esModuleInterop": true, 14 | "typeRoots": ["node_modules/@types"] 15 | }, 16 | "include": ["./src/**/*"], 17 | "exclude": ["node_modules"] 18 | } 19 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-monaco-plugin/index.js: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; 2 | 3 | (function () { 4 | // create div to avoid needing a HtmlWebpackPlugin template 5 | const div = document.createElement('div'); 6 | div.id = 'root'; 7 | div.style = 'width:800px; height:600px; border:1px solid #ccc;'; 8 | 9 | document.body.appendChild(div); 10 | })(); 11 | 12 | monaco.editor.create(document.getElementById('root'), { 13 | value: `const foo = () => 0;`, 14 | language: 'javascript', 15 | theme: 'vs-dark' 16 | }); 17 | -------------------------------------------------------------------------------- /src/language/typescript/lib/editor.worker.d.ts: -------------------------------------------------------------------------------- 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 | declare module 'monaco-editor-core/esm/vs/editor/editor.worker' { 7 | export function initialize(callback: (ctx: any, createData: any) => any): void; 8 | } 9 | -------------------------------------------------------------------------------- /website/index/samples/sample.systemverilog.txt: -------------------------------------------------------------------------------- 1 | // File : tb_top.sv 2 | module tb_top (); 3 | 4 | reg clk; 5 | reg resetn; 6 | reg d; 7 | wire q; 8 | 9 | // Instantiate the design 10 | d_ff d_ff0 ( .clk (clk), 11 | .resetn (resetn), 12 | .d (d), 13 | .q (q)); 14 | 15 | // Create a clock 16 | always #10 clk <= ~clk; 17 | 18 | initial begin 19 | resetn <= 0; 20 | d <= 0; 21 | 22 | #10 resetn <= 1; 23 | #5 d <= 1; 24 | #8 d <= 0; 25 | #2 d <= 1; 26 | #10 d <= 0; 27 | end 28 | endmodule 29 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/node_modules/ 2 | **/out/ 3 | **/release/ 4 | /samples/browser-esm-parcel/.parcel-cache/ 5 | /samples/browser-esm-parcel/dist/ 6 | /samples/browser-esm-vite-react/dist/**/*.js 7 | /samples/browser-esm-webpack/dist/*.js 8 | /samples/browser-esm-webpack-monaco-plugin/dist/*.js 9 | /samples/browser-esm-webpack-small/dist/*.js 10 | /samples/browser-esm-webpack-typescript/dist/*.js 11 | /samples/browser-esm-webpack-typescript-react/dist/*.js 12 | /src/language/typescript/lib/ 13 | /test/manual/generated/ 14 | /website/lib/ 15 | /website/typedoc/monaco.d.ts 16 | -------------------------------------------------------------------------------- /src/fillers/monaco-editor-core-amd.ts: -------------------------------------------------------------------------------- 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 | // Resolves with the global monaco API 7 | 8 | /// 9 | import * as api from 'vs/editor/editor.api'; 10 | 11 | export = api; 12 | -------------------------------------------------------------------------------- /test/manual/iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor in iframe

8 | 9 | 10 | 11 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/smoke/amd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /website/index/samples/sample.coffeescript.txt: -------------------------------------------------------------------------------- 1 | """ 2 | A CoffeeScript sample. 3 | """ 4 | 5 | class Vehicle 6 | constructor: (@name) => 7 | 8 | drive: () => 9 | alert "Conducting #{@name}" 10 | 11 | class Car extends Vehicle 12 | drive: () => 13 | alert "Driving #{@name}" 14 | 15 | c = new Car "Brandie" 16 | 17 | while notAtDestination() 18 | c.drive() 19 | 20 | raceVehicles = (new Car for i in [1..100]) 21 | 22 | startRace = (vehicles) -> [vehicle.drive() for vehicle in vehicles] 23 | 24 | fancyRegExp = /// 25 | (\d+) # numbers 26 | (\w*) # letters 27 | $ # the end 28 | /// 29 | -------------------------------------------------------------------------------- /website/index/samples/sample.mips.txt: -------------------------------------------------------------------------------- 1 | # A[i] = A[i/2] + 1; 2 | lw $t0, 0($gp) # fetch i 3 | srl $t1, $t0, 1 # i/2 4 | sll $t1, $t1, 2 # turn i/2 into a byte offset (*4) 5 | add $t1, $gp, $t1 # &A[i/2] - 28 6 | lw $t1, 28($t1) # fetch A[i/2] 7 | addi $t1, $t1, 1 # A[i/2] + 1 8 | sll $t2, $t0, 2 # turn i into a byte offset 9 | add $t2, $t2, $gp # &A[i] - 28 10 | sw $t1, 28($t2) # A[i] = ... 11 | # A[i+1] = -1; 12 | addi $t1, $zero, -1 # -1 13 | sw $t1, 32($t2) # A[i+1] = -1 14 | -------------------------------------------------------------------------------- /website/index/samples/sample.liquid.txt: -------------------------------------------------------------------------------- 1 | class Random < Liquid::Block 2 | def initialize(tag_name, markup, tokens) 3 | super 4 | @rand = markup.to_i 5 | end 6 | 7 | def render(context) 8 | value = rand(@rand) 9 | super.sub('^^^', value.to_s) # calling `super` returns the content of the block 10 | end 11 | end 12 | 13 | Liquid::Template.register_tag('random', Random) 14 | text = " {% random 5 %} you have drawn number ^^^, lucky you! {% endrandom %} " 15 | @template = Liquid::Template.parse(text) 16 | @template.render # will return "you have drawn number 1, lucky you!" in 20% of cases 17 | -------------------------------------------------------------------------------- /website/index/samples/sample.xml.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "browser-esm-vite-react", 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "tsc && vite build", 6 | "serve": "vite preview", 7 | "simpleserver": "node ../node_modules/yaserver/bin/yaserver --root ./dist --port 9999" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "monaco-editor": "^0.32.0", 12 | "react": "^17.0.2", 13 | "react-dom": "^17.0.2", 14 | "@types/react": "^17.0.39", 15 | "@types/react-dom": "^17.0.11", 16 | "@vitejs/plugin-react": "^1.1.4", 17 | "typescript": "^4.5.5", 18 | "vite": "^2.7.13" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /website/index/samples/sample.pug.txt: -------------------------------------------------------------------------------- 1 | doctype 5 2 | html(lang="en") 3 | head 4 | title= pageTitle 5 | script(type='text/javascript') 6 | if (foo) { 7 | bar() 8 | } 9 | body 10 | // Disclaimer: You will need to turn insertSpaces to true in order for the 11 | syntax highlighting to kick in properly (especially for comments) 12 | Enjoy :) 13 | h1 Pug - node template engine 14 | #container 15 | if youAreUsingPug 16 | p You are amazing 17 | else 18 | p Get on it! -------------------------------------------------------------------------------- /website/index/samples/sample.ruby.txt: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------- 2 | # Copyright (c) Microsoft. All rights reserved. 3 | #-------------------------------------------------------------------------- 4 | 5 | module Azure 6 | module Blob 7 | class Blob 8 | 9 | def initialize 10 | @properties = {} 11 | @metadata = {} 12 | yield self if block_given? 13 | end 14 | 15 | attr_accessor :name 16 | attr_accessor :snapshot 17 | attr_accessor :properties 18 | attr_accessor :metadata 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /src/basic-languages/sas/sas.test.ts: -------------------------------------------------------------------------------- 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 { testTokenization } from '../test/testRunner'; 7 | 8 | testTokenization('sas', [ 9 | [ 10 | { 11 | line: '/* comment */', 12 | tokens: [{ startIndex: 0, type: 'comment.sas' }] 13 | } 14 | ] 15 | ]); 16 | -------------------------------------------------------------------------------- /website/index/samples/sample.pascal.txt: -------------------------------------------------------------------------------- 1 | program GreetingsNumberOfTimes; 2 | 3 | {$APPTYPE CONSOLE} 4 | 5 | {$R *.res} 6 | 7 | uses 8 | System.SysUtils; 9 | 10 | var 11 | greetingsMessage: string; 12 | numberOfTimes, i: integer; 13 | 14 | begin 15 | try 16 | { TODO -oUser -cConsole Main : Insert code here } 17 | greetingsMessage := 'Hello World!'; 18 | numberOfTimes := 10; 19 | 20 | for i := 1 to numberOfTimes do 21 | begin 22 | Writeln(greetingsMessage); 23 | end; 24 | except 25 | on E: Exception do 26 | Writeln(E.ClassName, ': ', E.Message); 27 | end; 28 | end. 29 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/scrollbars/sample.css: -------------------------------------------------------------------------------- 1 | /* Make horizontal scrollbar, decorations overview ruler and vertical scrollbar arrows opaque */ 2 | .monaco-editor .monaco-scrollable-element .scrollbar.horizontal, 3 | .monaco-editor .decorationsOverviewRuler, 4 | .monaco-editor .monaco-scrollable-element .scrollbar.vertical .arrow-background { 5 | background: rgba(230, 230, 230, 255); 6 | } 7 | /* Make vertical scrollbar transparent to allow decorations overview ruler to be visible */ 8 | .monaco-editor .monaco-scrollable-element .scrollbar.vertical { 9 | background: rgba(0, 0, 0, 0); 10 | } 11 | -------------------------------------------------------------------------------- /website/index/samples/sample.tcl.txt: -------------------------------------------------------------------------------- 1 | proc find {{basedir .} {filterScript {}}} { 2 | set oldwd [pwd] 3 | cd $basedir 4 | set cwd [pwd] 5 | set filenames [glob -nocomplain * .*] 6 | set files {} 7 | set filt [string length $filterScript] 8 | foreach filename $filenames { 9 | if {!$filt || [eval $filterScript [list $filename]]} { 10 | lappend files [file join $cwd $filename] 11 | } 12 | if {[file isdirectory $filename]} { 13 | set files [concat $files [find $filename $filterScript]] 14 | } 15 | } 16 | cd $oldwd 17 | return $files 18 | } 19 | -------------------------------------------------------------------------------- /test/manual/samples/run-editor-intellisense-js.txt: -------------------------------------------------------------------------------- 1 | 2 | "use strict"; 3 | function Person(age) { 4 | if (age) { 5 | this.age = age; 6 | } 7 | } 8 | Person.prototype.getAge = function () { 9 | return this.age; 10 | }; 11 | 12 | function Student(age, grade) { 13 | Person.call(this, age); 14 | this.grade = grade; 15 | } 16 | Student.prototype = new Person(); 17 | Student.prototype.getGrade = function () { 18 | return this.grade; 19 | }; 20 | 21 | var s = new Student(24, 5.75); 22 | //var age = s. 23 | 24 | //delete s.age; 25 | //s.getAge = function() { return {foo:"bar"}; }; 26 | //s. 27 | //s.getAge(). 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /website/index/samples/sample.lexon.txt: -------------------------------------------------------------------------------- 1 | LEX Paid Escrow. 2 | LEXON: 0.2.12 3 | COMMENT: 3.f - an escrow that is controlled by a third party for a fee. 4 | “Payer” is a person. 5 | “Payee” is a person. 6 | “Arbiter” is a person. 7 | “Fee” is an amount. 8 | The Payer pays an Amount into escrow, 9 | appoints the Payee, 10 | appoints the Arbiter, 11 | and also fixes the Fee. 12 | CLAUSE: Pay Out. 13 | The Arbiter may pay from escrow the Fee to themselves, 14 | and afterwards pay the remainder of the escrow to the Payee. 15 | CLAUSE: Pay Back. 16 | The Arbiter may pay from escrow the Fee to themselves, 17 | and afterwards return the remainder of the escrow to the Payer. 18 | -------------------------------------------------------------------------------- /website/index/samples/sample.lex.txt: -------------------------------------------------------------------------------- 1 | LEX Paid Escrow. 2 | LEXON: 0.2.20 3 | COMMENT: 3.f - an escrow that is controlled by a third party for a fee. 4 | 5 | “Payer” is a person. 6 | “Payee” is a person. 7 | “Arbiter” is a person. 8 | “Fee” is an amount. 9 | 10 | The Payer pays an Amount into escrow, 11 | appoints the Payee, 12 | appoints the Arbiter, 13 | and also fixes the Fee. 14 | 15 | CLAUSE: Pay Out. 16 | The Arbiter may pay from escrow the Fee to themselves, 17 | and afterwards pay the remainder of the escrow to the Payee. 18 | 19 | CLAUSE: Pay Back. 20 | The Arbiter may pay from escrow the Fee to themselves, 21 | and afterwards return the remainder of the escrow to the Payer. 22 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/multi-line-example/sample.js: -------------------------------------------------------------------------------- 1 | var originalModel = monaco.editor.createModel( 2 | 'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text', 3 | 'text/plain' 4 | ); 5 | var modifiedModel = monaco.editor.createModel( 6 | 'just some text\nabcz\nzzzzefgh\nSome more text.\nThis line is removed on the left.', 7 | 'text/plain' 8 | ); 9 | 10 | var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), { 11 | // You can optionally disable the resizing 12 | enableSplitViewResizing: false 13 | }); 14 | diffEditor.setModel({ 15 | original: originalModel, 16 | modified: modifiedModel 17 | }); 18 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-monaco-plugin/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); 3 | 4 | module.exports = { 5 | mode: process.env.NODE_ENV, 6 | entry: './index.js', 7 | output: { 8 | path: path.resolve(__dirname, 'dist'), 9 | filename: '[name].bundle.js' 10 | }, 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.css$/, 15 | use: ['style-loader', 'css-loader'] 16 | }, 17 | { 18 | test: /\.ttf$/, 19 | use: ['file-loader'] 20 | } 21 | ] 22 | }, 23 | plugins: [ 24 | new MonacoWebpackPlugin({ 25 | languages: ['typescript', 'javascript', 'css'] 26 | }) 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /src/language/css/css.worker.ts: -------------------------------------------------------------------------------- 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 * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker'; 7 | import { CSSWorker } from './cssWorker'; 8 | 9 | self.onmessage = () => { 10 | // ignore the first message 11 | worker.initialize((ctx, createData) => { 12 | return new CSSWorker(ctx, createData); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /website/index/samples/sample.cameligo.txt: -------------------------------------------------------------------------------- 1 | type storage = int 2 | type parameter = 3 | Increment of int 4 | | Decrement of int 5 | | Reset 6 | type return = operation list * storage 7 | // Two entrypoints 8 | let add (store, delta : storage * int) : storage = store + delta 9 | let sub (store, delta : storage * int) : storage = store - delta 10 | (* Main access point that dispatches to the entrypoints according to 11 | the smart contract parameter. *) 12 | let main (action, store : parameter * storage) : return = 13 | ([] : operation list), // No operations 14 | (match action with 15 | Increment (n) -> add (store, n) 16 | | Decrement (n) -> sub (store, n) 17 | | Reset -> 0) 18 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-small/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Webpack Sample

8 | 9 | This sample shows how to load a small subset of the editor: 10 |
    11 |
  • Only the core editor and the find widget
  • 12 |
  • Only the python language coloring
  • 13 |
14 | 15 | To run this sample, you need to: 16 | 17 |
18 | $/> npm install .
19 | $/> npm run simpleserver
20 | $/browser-esm-webpack-small> npm run build
21 | 
23 | 24 | Then, open the ./dist folder. 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/language/html/html.worker.ts: -------------------------------------------------------------------------------- 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 * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker'; 7 | import { HTMLWorker } from './htmlWorker'; 8 | 9 | self.onmessage = () => { 10 | // ignore the first message 11 | worker.initialize((ctx, createData) => { 12 | return new HTMLWorker(ctx, createData); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /src/language/json/json.worker.ts: -------------------------------------------------------------------------------- 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 * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker'; 7 | import { JSONWorker } from './jsonWorker'; 8 | 9 | self.onmessage = () => { 10 | // ignore the first message 11 | worker.initialize((ctx, createData) => { 12 | return new JSONWorker(ctx, createData); 13 | }); 14 | }; 15 | -------------------------------------------------------------------------------- /website/index/samples/sample.handlebars.txt: -------------------------------------------------------------------------------- 1 | 2 |
3 |

{{title}}

4 | {{#if author}} 5 |

{{author.firstName}} {{author.lastName}}

6 | {{else}} 7 |

Unknown Author

8 | {{/if}} 9 | {{contentBody}} 10 |
11 | 12 | {{#unless license}} 13 |

WARNING: This entry does not have a license!

14 | {{/unless}} 15 | 16 |
17 |
    18 | {{#each footnotes}} 19 |
  • {{this}}
  • 20 | {{/each}} 21 |
22 |
23 | 24 |

Comments

25 | 26 |
27 | {{#each comments}} 28 |

{{title}}

29 |
{{body}}
30 | {{/each}} 31 |
32 | -------------------------------------------------------------------------------- /test/manual/iframe-inner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
18 | 19 | 20 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.html: -------------------------------------------------------------------------------- 1 |
 2 | /* Some example CSS */
 3 | 
 4 | @import url("something.css");
 5 | 
 6 | body {
 7 |   margin: 0;
 8 |   padding: 3em 6em;
 9 |   font-family: tahoma, arial, sans-serif;
10 |   color: #000;
11 | }
12 | 
13 | #navigation a {
14 |   font-weight: bold;
15 |   text-decoration: none !important;
16 | }
17 | 
18 | h1 {
19 |   font-size: 2.5em;
20 | }
21 | 
22 | h2 {
23 |   font-size: 1.7em;
24 | }
25 | 
26 | h1:before, h2:before {
27 |   content: "some contents";
28 | }
29 | 
30 | code {
31 |   font-family: courier, monospace;
32 |   font-size: 80%;
33 |   color: #418A8A;
34 | }
35 | 
36 | -------------------------------------------------------------------------------- /website/index/samples/sample.powerquery.txt: -------------------------------------------------------------------------------- 1 | let 2 | Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], 3 | SplitColumnDelimiter = Table.SplitColumn(Source,"Input",Splitter.SplitTextByDelimiter(","),13), 4 | Unpivot = Table.Unpivot(SplitColumnDelimiter,{"Input.1", "Input.2", "Input.3", "Input.4", 5 | "Input.5", "Input.6", "Input.7", "Input.8", "Input.9", "Input.10", "Input.11", "Input.12" 6 | , "Input.13"},"Attribute","Value"), 7 | RemovedColumns = Table.RemoveColumns(Unpivot,{"Attribute"}), 8 | DuplicatesRemoved = Table.Distinct(RemovedColumns), 9 | GroupedRows = Table.Group(DuplicatesRemoved, {"RowID"}, {{"Count of Distinct Values" 10 | , each Table.RowCount(_), type number}}) 11 | in 12 | GroupedRows -------------------------------------------------------------------------------- /test/manual/transform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 17 |
18 | 19 | 20 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /website/index/samples/sample.abap.txt: -------------------------------------------------------------------------------- 1 | REPORT zrosetta_base64_encode_data. 2 | 3 | DATA: li_client TYPE REF TO if_http_client, 4 | lv_encoded TYPE string, 5 | lv_data TYPE xstring. 6 | 7 | 8 | cl_http_client=>create_by_url( 9 | EXPORTING 10 | url = 'http://rosettacode.org/favicon.ico' 11 | IMPORTING 12 | client = li_client ). 13 | 14 | li_client->send( ). 15 | li_client->receive( ). 16 | 17 | lv_data = li_client->response->get_data( ). 18 | 19 | CALL FUNCTION 'SSFC_BASE64_ENCODE' 20 | EXPORTING 21 | bindata = lv_data 22 | IMPORTING 23 | b64data = lv_encoded. 24 | 25 | WHILE strlen( lv_encoded ) > 100. 26 | WRITE: / lv_encoded(100). 27 | lv_encoded = lv_encoded+100. 28 | ENDWHILE. 29 | WRITE: / lv_encoded. 30 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/inline-diff-example/sample.js: -------------------------------------------------------------------------------- 1 | var originalModel = monaco.editor.createModel( 2 | 'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text', 3 | 'text/plain' 4 | ); 5 | var modifiedModel = monaco.editor.createModel( 6 | 'just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.', 7 | 'text/plain' 8 | ); 9 | 10 | var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), { 11 | // You can optionally disable the resizing 12 | enableSplitViewResizing: false, 13 | 14 | // Render the diff inline 15 | renderSideBySide: false 16 | }); 17 | diffEditor.setModel({ 18 | original: originalModel, 19 | modified: modifiedModel 20 | }); 21 | -------------------------------------------------------------------------------- /test/manual/cross-origin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor wrong cross origin

8 | 9 |
10 |
14 |
15 | 16 | 17 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/manual/mouse-fixed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor in fixed element

8 | 9 |
20 | 21 | 22 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/smoke/esbuild/index.js: -------------------------------------------------------------------------------- 1 | import * as monaco from '../../../release/esm/vs/editor/editor.main.js'; 2 | 3 | self.MonacoEnvironment = { 4 | getWorkerUrl: function (moduleId, label) { 5 | if (label === 'json') { 6 | return './out/vs/language/json/json.worker.js'; 7 | } 8 | if (label === 'css' || label === 'scss' || label === 'less') { 9 | return './out/vs/language/css/css.worker.js'; 10 | } 11 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 12 | return './out/vs/language/html/html.worker.js'; 13 | } 14 | if (label === 'typescript' || label === 'javascript') { 15 | return './out/vs/language/typescript/ts.worker.js'; 16 | } 17 | return './out/vs/editor/editor.worker.js'; 18 | } 19 | }; 20 | 21 | window.monacoAPI = monaco; 22 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monaco-esm-webpack-typescript", 3 | "scripts": { 4 | "start": "node ../node_modules/webpack-dev-server/bin/webpack-dev-server.js", 5 | "build": "NODE_ENV='production' node ../node_modules/webpack/bin/webpack.js --progress" 6 | }, 7 | "dependencies": {}, 8 | "devDependencies": { 9 | "@babel/core": "^7.17.0", 10 | "@babel/preset-env": "^7.16.11", 11 | "@babel/preset-react": "^7.16.7", 12 | "@babel/preset-typescript": "^7.16.7", 13 | "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", 14 | "@types/react": "^17.0.39", 15 | "@types/react-dom": "^17.0.11", 16 | "babel-loader": "^8.2.3", 17 | "react": "^17.0.2", 18 | "react-dom": "^17.0.2", 19 | "react-refresh": "^0.11.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /website/index/samples/sample.pascaligo.txt: -------------------------------------------------------------------------------- 1 | type storage is int 2 | type parameter is 3 | Increment of int 4 | | Decrement of int 5 | | Reset 6 | type return is list (operation) * storage 7 | // Two entrypoints 8 | function add (const store : storage; const delta : int) : storage is 9 | store + delta 10 | function sub (const store : storage; const delta : int) : storage is 11 | store - delta 12 | (* Main access point that dispatches to the entrypoints according to 13 | the smart contract parameter. *) 14 | function main (const action : parameter; const store : storage) : return is 15 | ((nil : list (operation)), // No operations 16 | case action of 17 | Increment (n) -> add (store, n) 18 | | Decrement (n) -> sub (store, n) 19 | | Reset -> 0 20 | end) 21 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.js: -------------------------------------------------------------------------------- 1 | function lineNumbersFunc(originalLineNumber) { 2 | var map = ['O', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X']; 3 | if (originalLineNumber < map.length) { 4 | return map[originalLineNumber]; 5 | } 6 | return originalLineNumber; 7 | } 8 | 9 | var jsCode = [ 10 | '"use strict";', 11 | 'function Person(age) {', 12 | ' if (age) {', 13 | ' this.age = age;', 14 | ' }', 15 | '}', 16 | 'Person.prototype.getAge = function () {', 17 | ' return this.age;', 18 | '};' 19 | ].join('\n'); 20 | 21 | var editor = monaco.editor.create(document.getElementById('container'), { 22 | value: jsCode, 23 | language: 'javascript', 24 | lineNumbers: lineNumbersFunc 25 | }); 26 | -------------------------------------------------------------------------------- /website/index/samples/sample.csharp.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * C# Program to Display All the Prime Numbers Between 1 to 100 3 | */ 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace VS 11 | { 12 | class Program 13 | { 14 | static void Main(string[] args) 15 | { 16 | bool isPrime = true; 17 | Console.WriteLine("Prime Numbers : "); 18 | for (int i = 2; i <= 100; i++) 19 | { 20 | for (int j = 2; j <= 100; j++) 21 | { 22 | if (i != j && i % j == 0) 23 | { 24 | isPrime = false; 25 | break; 26 | } 27 | } 28 | 29 | if (isPrime) 30 | { 31 | Console.Write("\t" +i); 32 | } 33 | isPrime = true; 34 | } 35 | Console.ReadKey(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-editor/editor-basic-options/sample.js: -------------------------------------------------------------------------------- 1 | // Through the options literal, the behaviour of the editor can be easily customized. 2 | // Here are a few examples of config options that can be passed to the editor. 3 | // You can also call editor.updateOptions at any time to change the options. 4 | 5 | var editor = monaco.editor.create(document.getElementById('container'), { 6 | value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line", 7 | language: 'javascript', 8 | 9 | lineNumbers: 'off', 10 | roundedSelection: false, 11 | scrollBeyondLastLine: false, 12 | readOnly: false, 13 | theme: 'vs-dark' 14 | }); 15 | setTimeout(function () { 16 | editor.updateOptions({ 17 | lineNumbers: 'on' 18 | }); 19 | }, 2000); 20 | -------------------------------------------------------------------------------- /.github/workflows/publish/setVersion.js: -------------------------------------------------------------------------------- 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 | //@ts-check 7 | 8 | const fs = require('fs'); 9 | 10 | if (process.argv.length !== 4) { 11 | console.error(`usage: node setVersion.js `); 12 | process.exit(1); 13 | } 14 | 15 | const packagejson = JSON.parse(fs.readFileSync(process.argv[2]).toString()); 16 | packagejson.version = process.argv[3]; 17 | fs.writeFileSync(process.argv[2], JSON.stringify(packagejson, null, '\t') + '\n'); 18 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/src/components/Editor.tsx: -------------------------------------------------------------------------------- 1 | import { VFC, useRef, useState, useEffect } from 'react'; 2 | import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; 3 | import styles from './Editor.module.css'; 4 | 5 | export const Editor: VFC = () => { 6 | const [editor, setEditor] = useState(null); 7 | const monacoEl = useRef(null); 8 | 9 | useEffect(() => { 10 | if (monacoEl && !editor) { 11 | setEditor( 12 | monaco.editor.create(monacoEl.current!, { 13 | value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), 14 | language: 'typescript' 15 | }) 16 | ); 17 | } 18 | 19 | return () => editor?.dispose(); 20 | }, [monacoEl.current]); 21 | 22 | return
; 23 | }; 24 | -------------------------------------------------------------------------------- /samples/electron-amd/main.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron'); 2 | const app = electron.app; 3 | const BrowserWindow = electron.BrowserWindow; 4 | 5 | let mainWindow; 6 | 7 | function createWindow() { 8 | mainWindow = new BrowserWindow({ 9 | width: 800, 10 | height: 600, 11 | webPreferences: { worldSafeExecuteJavaScript: true } 12 | }); 13 | mainWindow.loadURL(`file://${__dirname}/electron-index.html`); 14 | mainWindow.webContents.openDevTools(); 15 | mainWindow.on('closed', function () { 16 | mainWindow = null; 17 | }); 18 | } 19 | 20 | app.on('ready', createWindow); 21 | 22 | app.on('window-all-closed', function () { 23 | if (process.platform !== 'darwin') { 24 | app.quit(); 25 | } 26 | }); 27 | 28 | app.on('activate', function () { 29 | if (mainWindow === null) { 30 | createWindow(); 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /src/basic-languages/pla/pla.contribution.ts: -------------------------------------------------------------------------------- 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: 'pla', 13 | extensions: ['.pla'], 14 | loader: () => { 15 | if (AMD) { 16 | return new Promise((resolve, reject) => { 17 | require(['vs/basic-languages/pla/pla'], resolve, reject); 18 | }); 19 | } else { 20 | return import('./pla'); 21 | } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /website/index/samples/sample.julia.txt: -------------------------------------------------------------------------------- 1 | # good style 2 | function fixedpointmap(f; iv, tolerance=1E-7, maxiter=1000) 3 | # setup the algorithm 4 | x_old = iv 5 | normdiff = Inf 6 | iter = 1 7 | while normdiff > tolerance && iter <= maxiter 8 | x_new = f(x_old) # use the passed in map 9 | normdiff = norm(x_new - x_old) 10 | x_old = x_new 11 | iter = iter + 1 12 | end 13 | return (value = x_old, normdiff=normdiff, iter=iter) # A named tuple 14 | end 15 | 16 | # define a map and parameters 17 | p = 1.0 18 | β = 0.9 19 | f(v) = p + β * v # note that p and β are used in the function! 20 | 21 | sol = fixedpointmap(f, iv=0.8, tolerance=1.0E-8) # don't need to pass 22 | println("Fixed point = $(sol.value), and |f(x) - x| = $(sol.normdiff) in $(sol.iter)"* 23 | " iterations") 24 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack/index.js: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor'; 2 | 3 | self.MonacoEnvironment = { 4 | getWorkerUrl: function (moduleId, label) { 5 | if (label === 'json') { 6 | return './json.worker.bundle.js'; 7 | } 8 | if (label === 'css' || label === 'scss' || label === 'less') { 9 | return './css.worker.bundle.js'; 10 | } 11 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 12 | return './html.worker.bundle.js'; 13 | } 14 | if (label === 'typescript' || label === 'javascript') { 15 | return './ts.worker.bundle.js'; 16 | } 17 | return './editor.worker.bundle.js'; 18 | } 19 | }; 20 | 21 | monaco.editor.create(document.getElementById('container'), { 22 | value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), 23 | language: 'javascript' 24 | }); 25 | -------------------------------------------------------------------------------- /samples/electron-esm-webpack/index.js: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor'; 2 | 3 | self.MonacoEnvironment = { 4 | getWorkerUrl: function (moduleId, label) { 5 | if (label === 'json') { 6 | return './json.worker.bundle.js'; 7 | } 8 | if (label === 'css' || label === 'scss' || label === 'less') { 9 | return './css.worker.bundle.js'; 10 | } 11 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 12 | return './html.worker.bundle.js'; 13 | } 14 | if (label === 'typescript' || label === 'javascript') { 15 | return './ts.worker.bundle.js'; 16 | } 17 | return './editor.worker.bundle.js'; 18 | } 19 | }; 20 | 21 | monaco.editor.create(document.getElementById('container'), { 22 | value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), 23 | language: 'javascript' 24 | }); 25 | -------------------------------------------------------------------------------- /.github/workflows/locker.yml: -------------------------------------------------------------------------------- 1 | name: Locker 2 | on: 3 | schedule: 4 | - cron: 21 23 * * * # 5:20pm Redmond 5 | repository_dispatch: 6 | types: [trigger-locker] 7 | workflow_dispatch: 8 | 9 | jobs: 10 | main: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout Actions 14 | uses: actions/checkout@v2 15 | with: 16 | repository: 'microsoft/vscode-github-triage-actions' 17 | path: ./actions 18 | ref: stable 19 | - name: Install Actions 20 | run: npm install --production --prefix ./actions 21 | - name: Run Locker 22 | uses: ./actions/locker 23 | with: 24 | daysSinceClose: 45 25 | appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} 26 | daysSinceUpdate: 3 27 | ignoredLabel: '*out-of-scope' 28 | -------------------------------------------------------------------------------- /samples/electron-esm-webpack/main.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron'); 2 | const app = electron.app; 3 | const BrowserWindow = electron.BrowserWindow; 4 | 5 | let mainWindow; 6 | 7 | function createWindow() { 8 | mainWindow = new BrowserWindow({ 9 | width: 800, 10 | height: 600, 11 | webPreferences: { worldSafeExecuteJavaScript: true } 12 | }); 13 | mainWindow.loadURL(`file://${__dirname}/dist/electron-index.html`); 14 | mainWindow.webContents.openDevTools(); 15 | mainWindow.on('closed', function () { 16 | mainWindow = null; 17 | }); 18 | } 19 | 20 | app.on('ready', createWindow); 21 | 22 | app.on('window-all-closed', function () { 23 | if (process.platform !== 'darwin') { 24 | app.quit(); 25 | } 26 | }); 27 | 28 | app.on('activate', function () { 29 | if (mainWindow === null) { 30 | createWindow(); 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /website/index/samples/sample.scss.txt: -------------------------------------------------------------------------------- 1 | $baseFontSizeInPixels: 14; 2 | 3 | @function px2em ($font_size, $base_font_size: $baseFontSizeInPixels) { 4 | @return ($font_size / $base_font_size) + em; 5 | } 6 | 7 | h1 { 8 | font-size: px2em(36, $baseFontSizeInPixels); 9 | } 10 | h2 { 11 | font-size: px2em(28, $baseFontSizeInPixels); 12 | } 13 | .class { 14 | font-size: px2em(14, $baseFontSizeInPixels); 15 | } 16 | 17 | nav { 18 | ul { 19 | margin: 0; 20 | padding: 0; 21 | list-style: none; 22 | } 23 | 24 | li { display: inline-block; } 25 | 26 | a { 27 | display: block; 28 | padding: 6px 12px; 29 | text-decoration: none; 30 | } 31 | 32 | @each $animal in puma, sea-slug, egret, salamander { 33 | .#{$animal}-icon { 34 | background-image: url('/images/#{$animal}.png'); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/language/typescript/ts.worker.ts: -------------------------------------------------------------------------------- 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 * as edworker from 'monaco-editor-core/esm/vs/editor/editor.worker'; 7 | import { ICreateData, create } from './tsWorker'; 8 | import { worker } from '../../fillers/monaco-editor-core'; 9 | 10 | self.onmessage = () => { 11 | // ignore the first message 12 | edworker.initialize((ctx: worker.IWorkerContext, createData: ICreateData) => { 13 | return create(ctx, createData); 14 | }); 15 | }; 16 | 17 | export { create } from './tsWorker'; 18 | -------------------------------------------------------------------------------- /samples/electron-esm-webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: { 5 | app: './index.js', 6 | 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 7 | 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 8 | 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker', 9 | 'html.worker': 'monaco-editor/esm/vs/language/html/html.worker', 10 | 'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker' 11 | }, 12 | output: { 13 | globalObject: 'self', 14 | filename: '[name].bundle.js', 15 | path: path.resolve(__dirname, 'dist') 16 | }, 17 | module: { 18 | rules: [ 19 | { 20 | test: /\.css$/, 21 | use: ['style-loader', 'css-loader'] 22 | }, 23 | { 24 | test: /\.ttf$/, 25 | use: ['file-loader'] 26 | } 27 | ] 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /src/basic-languages/go/go.contribution.ts: -------------------------------------------------------------------------------- 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: 'go', 13 | extensions: ['.go'], 14 | aliases: ['Go'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/go/go'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./go'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/line-and-inline-decorations/sample.js: -------------------------------------------------------------------------------- 1 | var jsCode = [ 2 | '"use strict";', 3 | 'function Person(age) {', 4 | ' if (age) {', 5 | ' this.age = age;', 6 | ' }', 7 | '}', 8 | 'Person.prototype.getAge = function () {', 9 | ' return this.age;', 10 | '};' 11 | ].join('\n'); 12 | 13 | var editor = monaco.editor.create(document.getElementById('container'), { 14 | value: jsCode, 15 | language: 'javascript' 16 | }); 17 | 18 | var decorations = editor.deltaDecorations( 19 | [], 20 | [ 21 | { 22 | range: new monaco.Range(3, 1, 5, 1), 23 | options: { 24 | isWholeLine: true, 25 | linesDecorationsClassName: 'myLineDecoration' 26 | } 27 | }, 28 | { 29 | range: new monaco.Range(7, 1, 7, 24), 30 | options: { inlineClassName: 'myInlineDecoration' } 31 | } 32 | ] 33 | ); 34 | -------------------------------------------------------------------------------- /src/basic-languages/csp/csp.contribution.ts: -------------------------------------------------------------------------------- 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: 'csp', 13 | extensions: [], 14 | aliases: ['CSP', 'csp'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/csp/csp'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./csp'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/sql/sql.contribution.ts: -------------------------------------------------------------------------------- 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: 'sql', 13 | extensions: ['.sql'], 14 | aliases: ['SQL'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/sql/sql'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./sql'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /webpack-plugin/smoketest/webpack.config.js: -------------------------------------------------------------------------------- 1 | const MonacoWebpackPlugin = require('../out/index.js'); 2 | const path = require('path'); 3 | 4 | const REPO_ROOT = path.join(__dirname, '../../'); 5 | 6 | module.exports = { 7 | mode: 'development', 8 | entry: './index.js', 9 | context: __dirname, 10 | output: { 11 | path: path.resolve(REPO_ROOT, 'test/smoke/webpack/out'), 12 | filename: 'app.js' 13 | }, 14 | resolve: { 15 | alias: { 16 | 'monaco-editor': path.resolve(REPO_ROOT, 'release') 17 | } 18 | }, 19 | module: { 20 | rules: [ 21 | { 22 | test: /\.css$/, 23 | use: ['style-loader', 'css-loader'] 24 | }, 25 | { 26 | test: /\.ttf$/, 27 | use: ['file-loader'] 28 | } 29 | ] 30 | }, 31 | plugins: [ 32 | new MonacoWebpackPlugin({ 33 | monacoEditorPath: path.resolve(REPO_ROOT, 'release') 34 | }) 35 | ] 36 | }; 37 | -------------------------------------------------------------------------------- /src/basic-languages/lua/lua.contribution.ts: -------------------------------------------------------------------------------- 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: 'lua', 13 | extensions: ['.lua'], 14 | aliases: ['Lua', 'lua'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/lua/lua'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./lua'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/sas/sas.contribution.ts: -------------------------------------------------------------------------------- 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: 'sas', 13 | extensions: ['.sas'], 14 | aliases: ['SAS', 'sas'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/sas/sas'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./sas'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/sb/sb.contribution.ts: -------------------------------------------------------------------------------- 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: 'sb', 13 | extensions: ['.sb'], 14 | aliases: ['Small Basic', 'sb'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/sb/sb'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./sb'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/vb/vb.contribution.ts: -------------------------------------------------------------------------------- 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: 'vb', 13 | extensions: ['.vb'], 14 | aliases: ['Visual Basic', 'vb'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/vb/vb'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./vb'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.js: -------------------------------------------------------------------------------- 1 | var jsCode = [ 2 | '"use strict";', 3 | 'function Person(age) {', 4 | ' if (age) {', 5 | ' this.age = age;', 6 | ' }', 7 | '}', 8 | 'Person.prototype.getAge = function () {', 9 | ' return this.age;', 10 | '};' 11 | ].join('\n'); 12 | 13 | var editor = monaco.editor.create(document.getElementById('container'), { 14 | value: jsCode, 15 | language: 'javascript', 16 | glyphMargin: true 17 | }); 18 | 19 | var decorations = editor.deltaDecorations( 20 | [], 21 | [ 22 | { 23 | range: new monaco.Range(3, 1, 3, 1), 24 | options: { 25 | isWholeLine: true, 26 | className: 'myContentClass', 27 | glyphMarginClassName: 'myGlyphMarginClass' 28 | } 29 | } 30 | ] 31 | ); 32 | 33 | // You can now use `decorations` to change or remove the decoration 34 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript/src/index.ts: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor'; 2 | import './index.css'; 3 | 4 | // @ts-ignore 5 | self.MonacoEnvironment = { 6 | getWorkerUrl: function (moduleId, label) { 7 | if (label === 'json') { 8 | return './json.worker.bundle.js'; 9 | } 10 | if (label === 'css' || label === 'scss' || label === 'less') { 11 | return './css.worker.bundle.js'; 12 | } 13 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 14 | return './html.worker.bundle.js'; 15 | } 16 | if (label === 'typescript' || label === 'javascript') { 17 | return './ts.worker.bundle.js'; 18 | } 19 | return './editor.worker.bundle.js'; 20 | } 21 | }; 22 | 23 | monaco.editor.create(document.body, { 24 | value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), 25 | language: 'typescript' 26 | }); 27 | -------------------------------------------------------------------------------- /samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monaco-editor-samples", 3 | "version": "0.0.1", 4 | "private": true, 5 | "description": "Samples for using the Monaco Editor", 6 | "main": "index.js", 7 | "scripts": { 8 | "simpleserver": "yaserver --root ./ --port 8888" 9 | }, 10 | "author": "Microsoft Corporation", 11 | "license": "MIT", 12 | "devDependencies": { 13 | "css-loader": "^6.6.0", 14 | "electron": "^17.0.0", 15 | "file-loader": "^6.2.0", 16 | "glob": "^7.2.0", 17 | "html-webpack-plugin": "^5.5.0", 18 | "monaco-editor-webpack-plugin": "^7.0.1", 19 | "monaco-editor": "^0.32.1", 20 | "style-loader": "^3.3.1", 21 | "terser-webpack-plugin": "^5.3.1", 22 | "ts-loader": "^9.2.6", 23 | "typescript": "^4.5.5", 24 | "webpack-cli": "^4.9.2", 25 | "webpack-dev-server": "^4.7.4", 26 | "webpack": "^5.68.0", 27 | "yaserver": "^0.4.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/basic-languages/abap/abap.contribution.ts: -------------------------------------------------------------------------------- 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: 'abap', 13 | extensions: ['.abap'], 14 | aliases: ['abap', 'ABAP'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/abap/abap'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./abap'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/bicep/bicep.contribution.ts: -------------------------------------------------------------------------------- 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: 'bicep', 13 | extensions: ['.bicep'], 14 | aliases: ['Bicep'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/bicep/bicep'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./bicep'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/ecl/ecl.contribution.ts: -------------------------------------------------------------------------------- 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: 'ecl', 13 | extensions: ['.ecl'], 14 | aliases: ['ECL', 'Ecl', 'ecl'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/ecl/ecl'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./ecl'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/lexon/lexon.contribution.ts: -------------------------------------------------------------------------------- 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: 'lexon', 13 | extensions: ['.lex'], 14 | aliases: ['Lexon'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/lexon/lexon'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./lexon'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/perl/perl.contribution.ts: -------------------------------------------------------------------------------- 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: 'perl', 13 | extensions: ['.pl'], 14 | aliases: ['Perl', 'pl'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/perl/perl'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./perl'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/redis/redis.contribution.ts: -------------------------------------------------------------------------------- 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: 'redis', 13 | extensions: ['.redis'], 14 | aliases: ['redis'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/redis/redis'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./redis'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /website/index/samples/sample.restructuredtext.txt: -------------------------------------------------------------------------------- 1 | ================= 2 | My Project Readme 3 | ================= 4 | ------------------------- 5 | Clever subtitle goes here 6 | ------------------------- 7 | 8 | Introduction 9 | ============ 10 | 11 | This is an example reStructuredText document that starts at the very top 12 | with a title and a sub-title. There is one primary header, Introduction. 13 | There is one example subheading below. 14 | The document is just plain text so it is easily readable even before 15 | being converted to HTML, man page, PDF or other formats. 16 | 17 | Subheading 18 | ---------- 19 | 20 | The basic syntax is not that different from Markdown, but it also 21 | has many more powerful features that Markdown doesn't have. We aren't 22 | taking advantage of those yet though. 23 | 24 | - Bullet points 25 | - Are intuitive 26 | - And simple too 27 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | mode: 'development', 5 | entry: { 6 | app: './index.js', 7 | 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 8 | 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 9 | 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker', 10 | 'html.worker': 'monaco-editor/esm/vs/language/html/html.worker', 11 | 'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker' 12 | }, 13 | output: { 14 | globalObject: 'self', 15 | filename: '[name].bundle.js', 16 | path: path.resolve(__dirname, 'dist') 17 | }, 18 | module: { 19 | rules: [ 20 | { 21 | test: /\.css$/, 22 | use: ['style-loader', 'css-loader'] 23 | }, 24 | { 25 | test: /\.ttf$/, 26 | use: ['file-loader'] 27 | } 28 | ] 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /src/basic-languages/bat/bat.contribution.ts: -------------------------------------------------------------------------------- 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: 'bat', 13 | extensions: ['.bat', '.cmd'], 14 | aliases: ['Batch', 'bat'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/bat/bat'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./bat'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/mysql/mysql.contribution.ts: -------------------------------------------------------------------------------- 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: 'mysql', 13 | extensions: [], 14 | aliases: ['MySQL', 'mysql'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/mysql/mysql'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./mysql'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /website/index/samples/sample.r.txt: -------------------------------------------------------------------------------- 1 | # © Microsoft. All rights reserved. 2 | 3 | #' Add together two numbers. 4 | #' 5 | #' @param x A number. 6 | #' @param y A number. 7 | #' @return The sum of \code{x} and \code{y}. 8 | #' @examples 9 | #' add(1, 1) 10 | #' add(10, 1) 11 | add <- function(x, y) { 12 | x + y 13 | } 14 | 15 | add(1, 2) 16 | add(1.0, 2.0) 17 | add(-1, -2) 18 | add(-1.0, -2.0) 19 | add(1.0e10, 2.0e10) 20 | 21 | 22 | #' Concatenate together two strings. 23 | #' 24 | #' @param x A string. 25 | #' @param y A string. 26 | #' @return The concatenated string built of \code{x} and \code{y}. 27 | #' @examples 28 | #' strcat("one", "two") 29 | strcat <- function(x, y) { 30 | paste(x, y) 31 | } 32 | 33 | paste("one", "two") 34 | paste('one', 'two') 35 | paste(NULL, NULL) 36 | paste(NA, NA) 37 | 38 | paste("multi- 39 | line", 40 | 'multi- 41 | line') 42 | -------------------------------------------------------------------------------- /src/basic-languages/julia/julia.contribution.ts: -------------------------------------------------------------------------------- 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: 'julia', 13 | extensions: ['.jl'], 14 | aliases: ['julia', 'Julia'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/julia/julia'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./julia'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/pug/pug.contribution.ts: -------------------------------------------------------------------------------- 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: 'pug', 13 | extensions: ['.jade', '.pug'], 14 | aliases: ['Pug', 'Jade', 'jade'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/pug/pug'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./pug'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/qsharp/qsharp.contribution.ts: -------------------------------------------------------------------------------- 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: 'qsharp', 13 | extensions: ['.qs'], 14 | aliases: ['Q#', 'qsharp'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/qsharp/qsharp'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./qsharp'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/rust/rust.contribution.ts: -------------------------------------------------------------------------------- 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: 'rust', 13 | extensions: ['.rs', '.rlib'], 14 | aliases: ['Rust', 'rust'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/rust/rust'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./rust'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/azcli/azcli.contribution.ts: -------------------------------------------------------------------------------- 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: 'azcli', 13 | extensions: ['.azcli'], 14 | aliases: ['Azure CLI', 'azcli'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/azcli/azcli'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./azcli'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/msdax/msdax.contribution.ts: -------------------------------------------------------------------------------- 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: 'msdax', 13 | extensions: ['.dax', '.msdax'], 14 | aliases: ['DAX', 'MSDAX'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/msdax/msdax'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./msdax'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/r/r.contribution.ts: -------------------------------------------------------------------------------- 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: 'r', 13 | extensions: ['.r', '.rhistory', '.rmd', '.rprofile', '.rt'], 14 | aliases: ['R', 'r'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/r/r'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./r'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/shell/shell.contribution.ts: -------------------------------------------------------------------------------- 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: 'shell', 13 | extensions: ['.sh', '.bash'], 14 | aliases: ['Shell', 'sh'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/shell/shell'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./shell'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/sparql/sparql.contribution.ts: -------------------------------------------------------------------------------- 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: 'sparql', 13 | extensions: ['.rq'], 14 | aliases: ['sparql', 'SPARQL'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/sparql/sparql'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./sparql'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /samples/electron-amd-nodeIntegration/main.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron'); 2 | const app = electron.app; 3 | const BrowserWindow = electron.BrowserWindow; 4 | 5 | let mainWindow; 6 | 7 | function createWindow() { 8 | mainWindow = new BrowserWindow({ 9 | width: 800, 10 | height: 600, 11 | webPreferences: { 12 | nodeIntegration: true, 13 | worldSafeExecuteJavaScript: true 14 | } 15 | }); 16 | mainWindow.loadURL(`file://${__dirname}/electron-index.html`); 17 | mainWindow.webContents.openDevTools(); 18 | mainWindow.on('closed', function () { 19 | mainWindow = null; 20 | }); 21 | } 22 | 23 | app.on('ready', createWindow); 24 | 25 | app.on('window-all-closed', function () { 26 | if (process.platform !== 'darwin') { 27 | app.quit(); 28 | } 29 | }); 30 | 31 | app.on('activate', function () { 32 | if (mainWindow === null) { 33 | createWindow(); 34 | } 35 | }); 36 | -------------------------------------------------------------------------------- /src/basic-languages/sophia/sophia.contribution.ts: -------------------------------------------------------------------------------- 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: 'aes', 13 | extensions: ['.aes'], 14 | aliases: ['aes', 'sophia', 'Sophia'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/sophia/sophia'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./sophia'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/cameligo/cameligo.contribution.ts: -------------------------------------------------------------------------------- 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: 'cameligo', 13 | extensions: ['.mligo'], 14 | aliases: ['Cameligo'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/cameligo/cameligo'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./cameligo'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/css/css.contribution.ts: -------------------------------------------------------------------------------- 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: 'css', 13 | extensions: ['.css'], 14 | aliases: ['CSS', 'css'], 15 | mimetypes: ['text/css'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/css/css'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./css'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/flow9/flow9.contribution.ts: -------------------------------------------------------------------------------- 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 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/redshift/redshift.contribution.ts: -------------------------------------------------------------------------------- 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: 'redshift', 13 | extensions: [], 14 | aliases: ['Redshift', 'redshift'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/redshift/redshift'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./redshift'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /.github/workflows/publish/setDevDependencyVersion.js: -------------------------------------------------------------------------------- 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 | //@ts-check 7 | 8 | const fs = require('fs'); 9 | 10 | if (process.argv.length !== 5) { 11 | console.error( 12 | `usage: node setDevDependencyVersion.js ` 13 | ); 14 | process.exit(1); 15 | } 16 | 17 | const packagejson = JSON.parse(fs.readFileSync(process.argv[2]).toString()); 18 | packagejson['devDependencies'][process.argv[3]] = process.argv[4]; 19 | fs.writeFileSync(process.argv[2], JSON.stringify(packagejson, null, '\t') + '\n'); 20 | -------------------------------------------------------------------------------- /src/basic-languages/csharp/csharp.contribution.ts: -------------------------------------------------------------------------------- 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: 'csharp', 13 | extensions: ['.cs', '.csx', '.cake'], 14 | aliases: ['C#', 'csharp'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/csharp/csharp'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./csharp'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/elixir/elixir.contribution.ts: -------------------------------------------------------------------------------- 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: 'elixir', 13 | extensions: ['.ex', '.exs'], 14 | aliases: ['Elixir', 'elixir', 'ex'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/elixir/elixir'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./elixir'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/hcl/hcl.contribution.ts: -------------------------------------------------------------------------------- 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: 'hcl', 13 | extensions: ['.tf', '.tfvars', '.hcl'], 14 | aliases: ['Terraform', 'tf', 'HCL', 'hcl'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/hcl/hcl'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./hcl'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/pgsql/pgsql.contribution.ts: -------------------------------------------------------------------------------- 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: 'pgsql', 13 | extensions: [], 14 | aliases: ['PostgreSQL', 'postgres', 'pg', 'postgre'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/pgsql/pgsql'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./pgsql'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/tcl/tcl.contribution.ts: -------------------------------------------------------------------------------- 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: 'tcl', 13 | extensions: ['.tcl'], 14 | aliases: ['tcl', 'Tcl', 'tcltk', 'TclTk', 'tcl/tk', 'Tcl/Tk'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/tcl/tcl'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./tcl'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/m3/m3.contribution.ts: -------------------------------------------------------------------------------- 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: 'm3', 13 | extensions: ['.m3', '.i3', '.mg', '.ig'], 14 | aliases: ['Modula-3', 'Modula3', 'modula3', 'm3'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/m3/m3'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./m3'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/pascaligo/pascaligo.contribution.ts: -------------------------------------------------------------------------------- 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: 'pascaligo', 13 | extensions: ['.ligo'], 14 | aliases: ['Pascaligo', 'ligo'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/pascaligo/pascaligo'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./pascaligo'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/solidity/solidity.contribution.ts: -------------------------------------------------------------------------------- 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: 'sol', 13 | extensions: ['.sol'], 14 | aliases: ['sol', 'solidity', 'Solidity'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/solidity/solidity'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./solidity'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/st/st.contribution.ts: -------------------------------------------------------------------------------- 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: 'st', 13 | extensions: ['.st', '.iecst', '.iecplc', '.lc3lib'], 14 | aliases: ['StructuredText', 'scl', 'stl'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/st/st'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./st'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/twig/twig.contribution.ts: -------------------------------------------------------------------------------- 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: 'twig', 13 | extensions: ['.twig'], 14 | aliases: ['Twig', 'twig'], 15 | mimetypes: ['text/x-twig'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/twig/twig'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./twig'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /samples/browser-amd-editor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | browser-amd-editor 5 | 6 | 7 | 8 |

Monaco Editor Sample

9 |
10 | 11 | 12 | 13 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/browser-esm-esbuild/index.js: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; 2 | 3 | self.MonacoEnvironment = { 4 | getWorkerUrl: function (moduleId, label) { 5 | if (label === 'json') { 6 | return './vs/language/json/json.worker.js'; 7 | } 8 | if (label === 'css' || label === 'scss' || label === 'less') { 9 | return './vs/language/css/css.worker.js'; 10 | } 11 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 12 | return './vs/language/html/html.worker.js'; 13 | } 14 | if (label === 'typescript' || label === 'javascript') { 15 | return './vs/language/typescript/ts.worker.js'; 16 | } 17 | return './vs/editor/editor.worker.js'; 18 | } 19 | }; 20 | 21 | monaco.editor.create(document.getElementById('container'), { 22 | value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), 23 | language: 'javascript' 24 | }); 25 | -------------------------------------------------------------------------------- /samples/electron-esm-webpack/dist/electron-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | Monaco Editor! 10 | 17 | 18 | 19 | 20 |

Monaco Editor in Electron (without nodeIntegration)!

21 | Note: Since Electron without nodeIntegration is very similar to a browser, you can have a look 22 | at all the other `browser-` samples, as they should work just fine.

23 |
24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/basic-languages/objective-c/objective-c.contribution.ts: -------------------------------------------------------------------------------- 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: 'objective-c', 13 | extensions: ['.m'], 14 | aliases: ['Objective-C'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/objective-c/objective-c'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./objective-c'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/protobuf/protobuf.contribution.ts: -------------------------------------------------------------------------------- 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: 'proto', 13 | extensions: ['.proto'], 14 | aliases: ['protobuf', 'Protocol Buffers'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/protobuf/protobuf'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./protobuf'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/scheme/scheme.contribution.ts: -------------------------------------------------------------------------------- 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: 'scheme', 13 | extensions: ['.scm', '.ss', '.sch', '.rkt'], 14 | aliases: ['scheme', 'Scheme'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/scheme/scheme'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./scheme'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/swift/swift.contribution.ts: -------------------------------------------------------------------------------- 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: 'swift', 13 | aliases: ['Swift', 'swift'], 14 | extensions: ['.swift'], 15 | mimetypes: ['text/swift'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/swift/swift'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./swift'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /website/index/samples/sample.st.txt: -------------------------------------------------------------------------------- 1 | CONFIGURATION DefaultCfg 2 | VAR_GLOBAL 3 | Start_Stop AT %IX0.0: BOOL; (* This is a comment *) 4 | END_VAR 5 | TASK NewTask (INTERVAL := T#20ms); 6 | PROGRAM Main WITH NewTask : PLC_PRG; 7 | END_CONFIGURATION 8 | 9 | PROGRAM demo 10 | VAR_EXTERNAL 11 | Start_Stop: BOOL; 12 | END_VAR 13 | VAR 14 | a : REAL; // Another comment 15 | todTest: TIME_OF_DAY := TOD#12:55; 16 | END_VAR 17 | a := csq(12.5); 18 | TON1(IN := TRUE, PT := T#2s); 19 | 16#FAC0 2#1001_0110 20 | IF TON1.Q AND a > REAL#100 THEN 21 | Start_Stop := TRUE; 22 | END_IF 23 | END_PROGRAM; 24 | 25 | /* Get a square of the circle */ 26 | FUNCTION csq : REAL 27 | VAR_INPUT 28 | r: REAL; 29 | END_VAR 30 | VAR CONSTANT 31 | c_pi: REAL := 3.14; 32 | END_VAR 33 | csq := ABS(c_pi * (r * 2)); 34 | END_FUNCTION -------------------------------------------------------------------------------- /src/basic-languages/clojure/clojure.contribution.ts: -------------------------------------------------------------------------------- 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: 'clojure', 13 | extensions: ['.clj', '.cljs', '.cljc', '.edn'], 14 | aliases: ['clojure', 'Clojure'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/clojure/clojure'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./clojure'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/less/less.contribution.ts: -------------------------------------------------------------------------------- 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: 'less', 13 | extensions: ['.less'], 14 | aliases: ['Less', 'less'], 15 | mimetypes: ['text/x-less', 'text/less'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/less/less'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./less'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/postiats/postiats.contribution.ts: -------------------------------------------------------------------------------- 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: 'postiats', 13 | extensions: ['.dats', '.sats', '.hats'], 14 | aliases: ['ATS', 'ATS/Postiats'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/postiats/postiats'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./postiats'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/razor/razor.contribution.ts: -------------------------------------------------------------------------------- 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: 'razor', 13 | extensions: ['.cshtml'], 14 | aliases: ['Razor', 'razor'], 15 | mimetypes: ['text/x-cshtml'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/razor/razor'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./razor'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/apex/apex.contribution.ts: -------------------------------------------------------------------------------- 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: 'apex', 13 | extensions: ['.cls'], 14 | aliases: ['Apex', 'apex'], 15 | mimetypes: ['text/x-apex-source', 'text/x-apex'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/apex/apex'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./apex'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/scss/scss.contribution.ts: -------------------------------------------------------------------------------- 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: 'scss', 13 | extensions: ['.scss'], 14 | aliases: ['Sass', 'sass', 'scss'], 15 | mimetypes: ['text/x-scss', 'text/scss'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/scss/scss'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./scss'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/dart/dart.contribution.ts: -------------------------------------------------------------------------------- 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: 'dart', 13 | extensions: ['.dart'], 14 | aliases: ['Dart', 'dart'], 15 | mimetypes: ['text/x-dart-source', 'text/x-dart'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/dart/dart'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./dart'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /website/index/samples/sample.kotlin.txt: -------------------------------------------------------------------------------- 1 | const val POINTS_X_PASS: Int = 15 2 | val EZPassAccounts: MutableMap = mutableMapOf(1 to 100, 2 to 100, 3 to 100) 3 | val EZPassReport: Map = EZPassAccounts 4 | 5 | // update points credit 6 | fun updatePointsCredit(accountId: Int) { 7 | if (EZPassAccounts.containsKey(accountId)) { 8 | println("Updating $accountId...") 9 | EZPassAccounts[accountId] = EZPassAccounts.getValue(accountId) + POINTS_X_PASS 10 | } else { 11 | println("Error: Trying to update a non-existing account (id: $accountId)") 12 | } 13 | } 14 | 15 | fun accountsReport() { 16 | println("EZ-Pass report:") 17 | EZPassReport.forEach{ 18 | k, v -> println("ID $k: credit $v") 19 | } 20 | } 21 | 22 | fun main() { 23 | accountsReport() 24 | updatePointsCredit(1) 25 | updatePointsCredit(1) 26 | updatePointsCredit(5) 27 | accountsReport() 28 | } -------------------------------------------------------------------------------- /src/basic-languages/fsharp/fsharp.contribution.ts: -------------------------------------------------------------------------------- 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: 'fsharp', 13 | extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'], 14 | aliases: ['F#', 'FSharp', 'fsharp'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/fsharp/fsharp'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./fsharp'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/java/java.contribution.ts: -------------------------------------------------------------------------------- 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: 'java', 13 | extensions: ['.java', '.jav'], 14 | aliases: ['Java', 'java'], 15 | mimetypes: ['text/x-java-source', 'text/x-java'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/java/java'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./java'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/mips/mips.contribution.ts: -------------------------------------------------------------------------------- 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: 'mips', 13 | extensions: ['.s'], 14 | aliases: ['MIPS', 'MIPS-V'], 15 | mimetypes: ['text/x-mips', 'text/mips', 'text/plaintext'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/mips/mips'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./mips'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/php/php.contribution.ts: -------------------------------------------------------------------------------- 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: 'php', 13 | extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'], 14 | aliases: ['PHP', 'php'], 15 | mimetypes: ['application/x-php'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/php/php'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./php'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/powerquery/powerquery.contribution.ts: -------------------------------------------------------------------------------- 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: 'powerquery', 13 | extensions: ['.pq', '.pqm'], 14 | aliases: ['PQ', 'M', 'Power Query', 'Power Query M'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/powerquery/powerquery'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./powerquery'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/dockerfile/dockerfile.contribution.ts: -------------------------------------------------------------------------------- 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: 'dockerfile', 13 | extensions: ['.dockerfile'], 14 | filenames: ['Dockerfile'], 15 | aliases: ['Dockerfile'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/dockerfile/dockerfile'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./dockerfile'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/kotlin/kotlin.contribution.ts: -------------------------------------------------------------------------------- 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: 'kotlin', 13 | extensions: ['.kt'], 14 | aliases: ['Kotlin', 'kotlin'], 15 | mimetypes: ['text/x-kotlin-source', 'text/x-kotlin'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/kotlin/kotlin'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./kotlin'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/liquid/liquid.contribution.ts: -------------------------------------------------------------------------------- 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: 'liquid', 13 | extensions: ['.liquid', '.html.liquid'], 14 | aliases: ['Liquid', 'liquid'], 15 | mimetypes: ['application/liquid'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/liquid/liquid'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./liquid'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/ruby/ruby.contribution.ts: -------------------------------------------------------------------------------- 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: 'ruby', 13 | extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.pp'], 14 | filenames: ['rakefile', 'Gemfile'], 15 | aliases: ['Ruby', 'rb'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/ruby/ruby'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./ruby'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/powershell/powershell.contribution.ts: -------------------------------------------------------------------------------- 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: 'powershell', 13 | extensions: ['.ps1', '.psm1', '.psd1'], 14 | aliases: ['PowerShell', 'powershell', 'ps', 'ps1'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/powershell/powershell'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./powershell'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/yaml/yaml.contribution.ts: -------------------------------------------------------------------------------- 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: 'yaml', 13 | extensions: ['.yaml', '.yml'], 14 | aliases: ['YAML', 'yaml', 'YML', 'yml'], 15 | mimetypes: ['application/x-yaml', 'text/x-yaml'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/yaml/yaml'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./yaml'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/graphql/graphql.contribution.ts: -------------------------------------------------------------------------------- 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: 'graphql', 13 | extensions: ['.graphql', '.gql'], 14 | aliases: ['GraphQL', 'graphql', 'gql'], 15 | mimetypes: ['application/graphql'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/graphql/graphql'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./graphql'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/pascal/pascal.contribution.ts: -------------------------------------------------------------------------------- 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: 'pascal', 13 | extensions: ['.pas', '.p', '.pp'], 14 | aliases: ['Pascal', 'pas'], 15 | mimetypes: ['text/x-pascal-source', 'text/x-pascal'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/pascal/pascal'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./pascal'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /website/index/samples/sample.less.txt: -------------------------------------------------------------------------------- 1 | @base: #f938ab; 2 | 3 | .box-shadow(@style, @c) when (iscolor(@c)) { 4 | border-radius: @style @c; 5 | } 6 | 7 | .box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) { 8 | .box-shadow(@style, rgba(0, 0, 0, @alpha)); 9 | } 10 | 11 | .box { 12 | color: saturate(@base, 5%); 13 | border-color: lighten(@base, 30%); 14 | 15 | div { 16 | .box-shadow((0 0 5px), 30%); 17 | } 18 | } 19 | 20 | #header { 21 | h1 { 22 | font-size: 26px; 23 | font-weight: bold; 24 | } 25 | 26 | p { font-size: 12px; 27 | a { text-decoration: none; 28 | &:hover { border-width: 1px } 29 | } 30 | } 31 | } 32 | 33 | @the-border: 1px; 34 | @base-color: #111; 35 | @red: #842210; 36 | 37 | #header { 38 | color: (@base-color * 3); 39 | border-left: @the-border; 40 | border-right: (@the-border * 2); 41 | } 42 | 43 | #footer { 44 | color: (@base-color + #003300); 45 | border-color: desaturate(@red, 10%); 46 | } 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2_feature_request.yaml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Suggest an idea for this project 3 | title: '[Feature Request] ' 4 | labels: 5 | - 'feature-request' 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | To help us efficiently reviewing your feature request, please fill out this form. 11 | - type: checkboxes 12 | id: not 13 | attributes: 14 | label: Context 15 | options: 16 | - label: This issue is not a bug report. *(please use a different template for reporting a bug)* 17 | required: true 18 | - label: This issue is not a duplicate of an existing issue. *(please use the [search](https://github.com/microsoft/monaco-editor/issues) to find existing issues)* 19 | required: true 20 | 21 | - type: textarea 22 | id: description 23 | attributes: 24 | label: Description 25 | description: Please describe your feature request. 26 | -------------------------------------------------------------------------------- /samples/browser-amd-localized/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Localization Sample

8 |
9 | 10 | 11 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/integrate-amd.md: -------------------------------------------------------------------------------- 1 | ## Integrating the AMD version of the Monaco Editor 2 | 3 | Here is the most basic HTML page that embeds the editor using AMD. 4 | 5 | More self-contained samples are available in the [samples folder](../samples/). 6 | 7 | ```html 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 26 | 27 | 28 | ``` 29 | -------------------------------------------------------------------------------- /src/basic-languages/restructuredtext/restructuredtext.contribution.ts: -------------------------------------------------------------------------------- 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: 'restructuredtext', 13 | extensions: ['.rst'], 14 | aliases: ['reStructuredText', 'restructuredtext'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/restructuredtext/restructuredtext'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./restructuredtext'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/ini/ini.contribution.ts: -------------------------------------------------------------------------------- 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: 'ini', 13 | extensions: ['.ini', '.properties', '.gitconfig'], 14 | filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'], 15 | aliases: ['Ini', 'ini'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/ini/ini'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./ini'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/markdown/markdown.contribution.ts: -------------------------------------------------------------------------------- 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: 'markdown', 13 | extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'], 14 | aliases: ['Markdown', 'markdown'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/markdown/markdown'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./markdown'); 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /src/basic-languages/python/python.contribution.ts: -------------------------------------------------------------------------------- 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: 'python', 13 | extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'], 14 | aliases: ['Python', 'py'], 15 | firstLine: '^#!/.*\\bpython[0-9.-]*\\b', 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/python/python'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./python'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /samples/browser-amd-requirejs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Sample - Loading with requirejs

8 |
9 | 10 | 15 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/manual/samples/run-editor-korean.txt: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 전문 4 | 유구한 역사와 전통에 빛나는 우리 대한 국민은 3·1 운동으로 건립된 대한민국 임시 정부의 법통과 불의에 항거한 4·19 민주 이념을 계승하고, 조국의 민주 개혁과 평화적 통일의 사명에 입각하여 정의·인도와 동포애로써 민족의 단결을 공고히 하고, 모든 사회적 폐습과 불의를 타파하며, 자율과 조화를 바탕으로 자유 민주적 기본 질서를 더욱 확고히 하여 정치·경제·사회·문화의 모든 영역에 있어서 각인의 기회를 균등히 하고, 능력을 최고도로 발휘하게 하며, 자유와 권리에 따르는 책임과 의무를 완수하게 하여, 안으로는 국민 생활의 균등한 향상을 기하고 밖으로는 항구적인 세계 평화와 인류 공영에 이바지함으로써 우리들과 우리들의 자손의 안전과 자유와 행복을 영원히 확보할 것을 다짐하면서 1948년 7월 12일에 제정되고 8차에 걸쳐 개정된 헌법을 이제 국회의 의결을 거쳐 국민 투표에 의하여 개정한다. 5 | 1987년 10월 29일 6 | 前文 7 | 悠久한 歷史와 傳統에 빛나는 우리 大韓國民은 3·1 運動으로 建立된 大韓民國臨時政府의 法統과 不義에 抗拒한 4·19 民主理念을 繼承하고, 祖國의 民主改革과 平和的統一의 使命에 立脚하여 正義·人道와 同胞愛로써 民族의 團結을 鞏固히 하고, 모든 社會的弊習과 不義를 打破하며, 自律과 調和를 바탕으로 自由民主的基本秩序를 더욱 確固히 하여 政治·經濟·社會·文化의 모든 領域에 있어서 各人의 機會를 均等히 하고, 能力을 最高度로 發揮하게 하며, 自由와 權利에 따르는 責任과 義務를 完遂하게 하여, 안으로는 國民生活의 均等한 向上을 基하고 밖으로는 恒久的인 世界平和와 人類共榮에 이바지함으로써 우리들과 우리들의 子孫의 安全과 自由와 幸福을 永遠히 確保할 것을 다짐하면서 1948年 7月 12日에 制定되고 8次에 걸쳐 改正된 憲法을 이제 國會의 議決을 거쳐 國民投票에 依하여 改正한다. 8 | 1987年 10月 29日 9 | 10 | */ -------------------------------------------------------------------------------- /src/basic-languages/coffee/coffee.contribution.ts: -------------------------------------------------------------------------------- 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: 'coffeescript', 13 | extensions: ['.coffee'], 14 | aliases: ['CoffeeScript', 'coffeescript', 'coffee'], 15 | mimetypes: ['text/x-coffeescript', 'text/coffeescript'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/coffee/coffee'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./coffee'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/typescript/typescript.contribution.ts: -------------------------------------------------------------------------------- 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: 'typescript', 13 | extensions: ['.ts', '.tsx'], 14 | aliases: ['TypeScript', 'ts', 'typescript'], 15 | mimetypes: ['text/typescript'], 16 | loader: (): Promise => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/typescript/typescript'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./typescript'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/handlebars/handlebars.contribution.ts: -------------------------------------------------------------------------------- 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: 'handlebars', 13 | extensions: ['.handlebars', '.hbs'], 14 | aliases: ['Handlebars', 'handlebars', 'hbs'], 15 | mimetypes: ['text/x-handlebars-template'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/handlebars/handlebars'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./handlebars'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /webpack-plugin/smoketest/webpack-cross-origin.config.js: -------------------------------------------------------------------------------- 1 | const MonacoWebpackPlugin = require('../out/index.js'); 2 | const path = require('path'); 3 | 4 | const ASSET_PATH = 'http://localhost:8088/monaco-editor/test/smoke/webpack/out/'; 5 | 6 | const REPO_ROOT = path.join(__dirname, '../../'); 7 | 8 | module.exports = { 9 | mode: 'development', 10 | entry: './index.js', 11 | context: __dirname, 12 | output: { 13 | path: path.resolve(REPO_ROOT, 'test/smoke/webpack/out'), 14 | filename: 'app.js', 15 | publicPath: ASSET_PATH 16 | }, 17 | resolve: { 18 | alias: { 19 | 'monaco-editor': path.resolve(REPO_ROOT, 'release') 20 | } 21 | }, 22 | module: { 23 | rules: [ 24 | { 25 | test: /\.css$/, 26 | use: ['style-loader', 'css-loader'] 27 | }, 28 | { 29 | test: /\.ttf$/, 30 | use: ['file-loader'] 31 | } 32 | ] 33 | }, 34 | plugins: [ 35 | new MonacoWebpackPlugin({ 36 | monacoEditorPath: path.resolve(REPO_ROOT, 'release') 37 | }) 38 | ] 39 | }; 40 | -------------------------------------------------------------------------------- /website/playground/new-samples/extending-language-services/codelens-provider-example/sample.js: -------------------------------------------------------------------------------- 1 | var editor = monaco.editor.create(document.getElementById('container'), { 2 | value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n', 3 | language: 'json' 4 | }); 5 | 6 | var commandId = editor.addCommand( 7 | 0, 8 | function () { 9 | // services available in `ctx` 10 | alert('my command is executing!'); 11 | }, 12 | '' 13 | ); 14 | 15 | monaco.languages.registerCodeLensProvider('json', { 16 | provideCodeLenses: function (model, token) { 17 | return { 18 | lenses: [ 19 | { 20 | range: { 21 | startLineNumber: 1, 22 | startColumn: 1, 23 | endLineNumber: 2, 24 | endColumn: 1 25 | }, 26 | id: 'First Line', 27 | command: { 28 | id: commandId, 29 | title: 'First Line' 30 | } 31 | } 32 | ], 33 | dispose: () => {} 34 | }; 35 | }, 36 | resolveCodeLens: function (model, codeLens, token) { 37 | return codeLens; 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /samples/browser-amd-iframe/inner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 17 |
18 | 19 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/basic-languages/scala/scala.contribution.ts: -------------------------------------------------------------------------------- 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: 'scala', 13 | extensions: ['.scala', '.sc', '.sbt'], 14 | aliases: ['Scala', 'scala', 'SBT', 'Sbt', 'sbt', 'Dotty', 'dotty'], 15 | mimetypes: ['text/x-scala-source', 'text/x-scala', 'text/x-sbt', 'text/x-dotty'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/scala/scala'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./scala'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /website/index/samples/sample.bicep.txt: -------------------------------------------------------------------------------- 1 | targetScope = 'subscription' 2 | 3 | param deployStorage bool = true 4 | 5 | @description('The object ID of the principal that will get the role assignment') 6 | param aadPrincipalId string 7 | 8 | module stg './storage.bicep' = if(deployStorage) { 9 | name: 'storageDeploy' 10 | scope: resourceGroup('another-rg') // this will target another resource group in the same subscription 11 | params: { 12 | storageAccountName: '' 13 | } 14 | } 15 | 16 | var contributor = 'b24988ac-6180-42a0-ab88-20f7382dd24c' 17 | resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = { 18 | name: contributor 19 | } 20 | 21 | resource rbac 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = { 22 | name: guid(subscription().id, aadPrincipalId, contributor) 23 | properties: { 24 | roleDefinitionId: roleDef.id 25 | principalId: aadPrincipalId 26 | } 27 | } 28 | 29 | output storageName array = stg.outputs.containerProps 30 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-small/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const TerserPlugin = require('terser-webpack-plugin'); 3 | 4 | module.exports = { 5 | mode: 'production', 6 | entry: { 7 | app: './index.js', 8 | 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js' 9 | // "json.worker": 'monaco-editor/esm/vs/language/json/json.worker', 10 | // "css.worker": 'monaco-editor/esm/vs/language/css/css.worker', 11 | // "html.worker": 'monaco-editor/esm/vs/language/html/html.worker', 12 | // "ts.worker": 'monaco-editor/esm/vs/language/typescript/ts.worker', 13 | }, 14 | output: { 15 | globalObject: 'self', 16 | filename: '[name].bundle.js', 17 | path: path.resolve(__dirname, 'dist') 18 | }, 19 | module: { 20 | rules: [ 21 | { 22 | test: /\.css$/, 23 | use: ['style-loader', 'css-loader'] 24 | }, 25 | { 26 | test: /\.ttf$/, 27 | use: ['file-loader'] 28 | } 29 | ] 30 | }, 31 | optimization: { 32 | minimize: true, 33 | minimizer: [new TerserPlugin()] 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/basic-languages/html/html.contribution.ts: -------------------------------------------------------------------------------- 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: 'html', 13 | extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'], 14 | aliases: ['HTML', 'htm', 'html', 'xhtml'], 15 | mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'], 16 | loader: () => { 17 | if (AMD) { 18 | return new Promise((resolve, reject) => { 19 | require(['vs/basic-languages/html/html'], resolve, reject); 20 | }); 21 | } else { 22 | return import('./html'); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /src/basic-languages/javascript/javascript.contribution.ts: -------------------------------------------------------------------------------- 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: 'javascript', 13 | extensions: ['.js', '.es6', '.jsx', '.mjs', '.cjs'], 14 | firstLine: '^#!.*\\bnode', 15 | filenames: ['jakefile'], 16 | aliases: ['JavaScript', 'javascript', 'js'], 17 | mimetypes: ['text/javascript'], 18 | loader: () => { 19 | if (AMD) { 20 | return new Promise((resolve, reject) => { 21 | require(['vs/basic-languages/javascript/javascript'], resolve, reject); 22 | }); 23 | } else { 24 | return import('./javascript'); 25 | } 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /website/index/samples/sample.verilog.txt: -------------------------------------------------------------------------------- 1 | `include "first_counter.v" 2 | module first_counter_tb(); 3 | // Declare inputs as regs and outputs as wires 4 | reg clock, reset, enable; 5 | wire [3:0] counter_out; 6 | 7 | // Initialize all variables 8 | initial begin 9 | $display ("time\t clk reset enable counter"); 10 | $monitor ("%g\t %b %b %b %b", 11 | $time, clock, reset, enable, counter_out); 12 | clock = 1; // initial value of clock 13 | reset = 0; // initial value of reset 14 | enable = 0; // initial value of enable 15 | #5 reset = 1; // Assert the reset 16 | #10 reset = 0; // De-assert the reset 17 | #10 enable = 1; // Assert enable 18 | #100 enable = 0; // De-assert enable 19 | #5 $finish; // Terminate simulation 20 | end 21 | 22 | // Clock generator 23 | always begin 24 | #5 clock = ~clock; // Toggle clock every 5 ticks 25 | end 26 | 27 | // Connect DUT to test bench 28 | first_counter U_counter ( 29 | clock, 30 | reset, 31 | enable, 32 | counter_out 33 | ); 34 | 35 | endmodule 36 | -------------------------------------------------------------------------------- /website/playground/new-samples/creating-the-diffeditor/navigating-a-diff/sample.js: -------------------------------------------------------------------------------- 1 | // The diff editor offers a navigator to jump between changes. Once the diff is computed the next() and previous() method allow navigation. By default setting the selection in the editor manually resets the navigation state. 2 | var originalModel = monaco.editor.createModel( 3 | 'just some text\n\nHello World\n\nSome more text', 4 | 'text/plain' 5 | ); 6 | var modifiedModel = monaco.editor.createModel( 7 | 'just some Text\n\nHello World\n\nSome more changes', 8 | 'text/plain' 9 | ); 10 | 11 | var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container')); 12 | diffEditor.setModel({ 13 | original: originalModel, 14 | modified: modifiedModel 15 | }); 16 | 17 | var navi = monaco.editor.createDiffNavigator(diffEditor, { 18 | followsCaret: true, // resets the navigator state when the user selects something in the editor 19 | ignoreCharChanges: true // jump from line to line 20 | }); 21 | 22 | window.setInterval(function () { 23 | navi.next(); 24 | }, 2000); 25 | -------------------------------------------------------------------------------- /samples/browser-amd-shared-model/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Monaco Editor Shared Models Sample

8 |
9 |
10 | 11 | 12 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /samples/browser-esm-vite-react/src/userWorker.ts: -------------------------------------------------------------------------------- 1 | import * as monaco from 'monaco-editor'; 2 | import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'; 3 | import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'; 4 | import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'; 5 | import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'; 6 | import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'; 7 | 8 | // @ts-ignore 9 | self.MonacoEnvironment = { 10 | getWorker(_: any, label: string) { 11 | if (label === 'json') { 12 | return new jsonWorker(); 13 | } 14 | if (label === 'css' || label === 'scss' || label === 'less') { 15 | return new cssWorker(); 16 | } 17 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 18 | return new htmlWorker(); 19 | } 20 | if (label === 'typescript' || label === 'javascript') { 21 | return new tsWorker(); 22 | } 23 | return new editorWorker(); 24 | } 25 | }; 26 | 27 | monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true); 28 | -------------------------------------------------------------------------------- /src/basic-languages/pgsql/keywords.js: -------------------------------------------------------------------------------- 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 | const fs = require('fs'); 7 | const path = require('path'); 8 | 9 | const keywords = getPostgreSQLKeywords(); 10 | keywords.sort(); 11 | console.log(`'${keywords.join("',\n'")}'`); 12 | 13 | function getPostgreSQLKeywords() { 14 | // https://www.postgresql.org/docs/current/sql-keywords-appendix.html 15 | const lines = fs 16 | .readFileSync(path.join(__dirname, 'keywords.postgresql.txt')) 17 | .toString() 18 | .split(/\r\n|\r|\n/); 19 | const tokens = []; 20 | for (let line of lines) { 21 | const pieces = line.split(/\t/); 22 | if (/non-reserved/.test(pieces[1])) { 23 | continue; 24 | } 25 | if (/reserved/.test(pieces[1])) { 26 | tokens.push(pieces[0]); 27 | } 28 | } 29 | return tokens; 30 | } 31 | -------------------------------------------------------------------------------- /samples/browser-script-editor/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 |

Monaco Editor Sync Loading Sample

13 |
14 | 15 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /website/playground/new-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.js: -------------------------------------------------------------------------------- 1 | var jsCode = [ 2 | '"use strict";', 3 | 'function Person(age) {', 4 | ' if (age) {', 5 | ' this.age = age;', 6 | ' }', 7 | '}', 8 | 'Person.prototype.getAge = function () {', 9 | ' return this.age;', 10 | '};' 11 | ].join('\n'); 12 | 13 | var editor = monaco.editor.create(document.getElementById('container'), { 14 | value: jsCode, 15 | language: 'javascript' 16 | }); 17 | 18 | var myCondition1 = editor.createContextKey(/*key name*/ 'myCondition1', /*default value*/ false); 19 | var myCondition2 = editor.createContextKey(/*key name*/ 'myCondition2', /*default value*/ false); 20 | 21 | editor.addCommand( 22 | monaco.KeyCode.Tab, 23 | function () { 24 | // services available in `ctx` 25 | alert('my command is executing!'); 26 | }, 27 | 'myCondition1 && myCondition2' 28 | ); 29 | 30 | myCondition1.set(true); 31 | 32 | setTimeout(function () { 33 | alert('now enabling also myCondition2, try pressing Tab!'); 34 | myCondition2.set(true); 35 | // you can use myCondition2.reset() to go back to the default 36 | }, 2000); 37 | -------------------------------------------------------------------------------- /.github/workflows/website.yml: -------------------------------------------------------------------------------- 1 | name: Publish Website 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | # enable users to manually trigger with workflow_dispatch 8 | workflow_dispatch: {} 9 | 10 | jobs: 11 | publish-website: 12 | name: Publish Website 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - uses: actions/setup-node@v2 18 | with: 19 | node-version: 16 20 | 21 | - name: Cache node modules 22 | id: cacheNodeModules 23 | uses: actions/cache@v2 24 | with: 25 | path: '**/node_modules' 26 | key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('**/package-lock.json') }} 27 | restore-keys: ${{ runner.os }}-cacheNodeModules- 28 | 29 | - name: Install node modules (1) 30 | if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} 31 | run: npm ci 32 | 33 | - name: Build website 34 | run: npm run build-website 35 | 36 | - name: Deploy to GitHub Pages 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | run: ./.github/workflows/publish-website.sh 40 | -------------------------------------------------------------------------------- /src/basic-languages/mysql/keywords.js: -------------------------------------------------------------------------------- 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 | const fs = require('fs'); 7 | const path = require('path'); 8 | 9 | const keywords = getMySQLKeywords(); 10 | keywords.sort(); 11 | console.log(`'${keywords.join("',\n'")}'`); 12 | 13 | function getMySQLKeywords() { 14 | // https://dev.mysql.com/doc/refman/8.0/en/keywords.html 15 | const lines = fs 16 | .readFileSync(path.join(__dirname, 'keywords.mysql.txt')) 17 | .toString() 18 | .split(/\r\n|\r|\n/); 19 | const tokens = []; 20 | for (let line of lines) { 21 | // Treat ; as a comment marker 22 | line = line.replace(/;.*$/, ''); 23 | line = line.trim(); 24 | // Only consider reserved keywords 25 | if (!/ \(R\)$/.test(line)) { 26 | continue; 27 | } 28 | line = line.replace(/ \(R\)$/, ''); 29 | tokens.push(line); 30 | } 31 | return tokens; 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 - present Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /samples/browser-esm-parcel/src/index.js: -------------------------------------------------------------------------------- 1 | import JSONWorker from 'url:monaco-editor/esm/vs/language/json/json.worker.js'; 2 | import CSSWorker from 'url:monaco-editor/esm/vs/language/css/css.worker.js'; 3 | import HTMLWorker from 'url:monaco-editor/esm/vs/language/html/html.worker.js'; 4 | import TSWorker from 'url:monaco-editor/esm/vs/language/typescript/ts.worker.js'; 5 | import EditorWorker from 'url:monaco-editor/esm/vs/editor/editor.worker.js'; 6 | import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; 7 | 8 | self.MonacoEnvironment = { 9 | getWorkerUrl: function (moduleId, label) { 10 | if (label === 'json') { 11 | return JSONWorker; 12 | } 13 | if (label === 'css' || label === 'scss' || label === 'less') { 14 | return CSSWorker; 15 | } 16 | if (label === 'html' || label === 'handlebars' || label === 'razor') { 17 | return HTMLWorker; 18 | } 19 | if (label === 'typescript' || label === 'javascript') { 20 | return TSWorker; 21 | } 22 | return EditorWorker; 23 | } 24 | }; 25 | 26 | monaco.editor.create(document.getElementById('container'), { 27 | value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'), 28 | language: 'javascript' 29 | }); 30 | -------------------------------------------------------------------------------- /samples/browser-esm-webpack-typescript/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const HtmlWebPackPlugin = require('html-webpack-plugin'); 3 | 4 | module.exports = { 5 | mode: 'development', 6 | entry: { 7 | app: './src/index.ts', 8 | 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 9 | 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 10 | 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker', 11 | 'html.worker': 'monaco-editor/esm/vs/language/html/html.worker', 12 | 'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker' 13 | }, 14 | resolve: { 15 | extensions: ['.ts', '.js'] 16 | }, 17 | output: { 18 | globalObject: 'self', 19 | filename: '[name].bundle.js', 20 | path: path.resolve(__dirname, 'dist') 21 | }, 22 | module: { 23 | rules: [ 24 | { 25 | test: /\.ts?$/, 26 | use: 'ts-loader', 27 | exclude: /node_modules/ 28 | }, 29 | { 30 | test: /\.css$/, 31 | use: ['style-loader', 'css-loader'] 32 | }, 33 | { 34 | test: /\.ttf$/, 35 | use: ['file-loader'] 36 | } 37 | ] 38 | }, 39 | plugins: [ 40 | new HtmlWebPackPlugin({ 41 | title: 'Monaco Editor Sample' 42 | }) 43 | ] 44 | }; 45 | -------------------------------------------------------------------------------- /src/basic-languages/xml/xml.contribution.ts: -------------------------------------------------------------------------------- 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: 'xml', 13 | extensions: [ 14 | '.xml', 15 | '.dtd', 16 | '.ascx', 17 | '.csproj', 18 | '.config', 19 | '.wxi', 20 | '.wxl', 21 | '.wxs', 22 | '.xaml', 23 | '.svg', 24 | '.svgz', 25 | '.opf', 26 | '.xsl' 27 | ], 28 | firstLine: '(\\<\\?xml.*)|(\\ { 32 | if (AMD) { 33 | return new Promise((resolve, reject) => { 34 | require(['vs/basic-languages/xml/xml'], resolve, reject); 35 | }); 36 | } else { 37 | return import('./xml'); 38 | } 39 | } 40 | }); 41 | -------------------------------------------------------------------------------- /src/basic-languages/cpp/cpp.contribution.ts: -------------------------------------------------------------------------------- 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: 'c', 13 | extensions: ['.c', '.h'], 14 | aliases: ['C', 'c'], 15 | loader: () => { 16 | if (AMD) { 17 | return new Promise((resolve, reject) => { 18 | require(['vs/basic-languages/cpp/cpp'], resolve, reject); 19 | }); 20 | } else { 21 | return import('./cpp'); 22 | } 23 | } 24 | }); 25 | registerLanguage({ 26 | id: 'cpp', 27 | extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'], 28 | aliases: ['C++', 'Cpp', 'cpp'], 29 | loader: () => { 30 | if (AMD) { 31 | return new Promise((resolve, reject) => { 32 | require(['vs/basic-languages/cpp/cpp'], resolve, reject); 33 | }); 34 | } else { 35 | return import('./cpp'); 36 | } 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /webpack-plugin/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /website/playground/new-samples/customizing-the-appearence/scrollbars/sample.js: -------------------------------------------------------------------------------- 1 | // Remember to check out the CSS too! 2 | var htmlCode = 3 | '\n\n \n \n