repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
angular/angular.js
https://github.com/angular/angular.js/blob/d8f77817eb5c98dec5317bc3756d1ea1812bcfbe/lib/grunt/validate-angular-files.js
lib/grunt/validate-angular-files.js
'use strict'; var path = require('path'); var fs = require('fs'); var glob = require('glob'); var _ = require('lodash'); var files = require('../../angularFiles').files; module.exports = function(grunt) { grunt.registerTask('validate-angular-files', function() { var combinedFiles = _.clone(files.angularModules...
javascript
MIT
d8f77817eb5c98dec5317bc3756d1ea1812bcfbe
2026-01-04T14:56:54.449246Z
false
angular/angular.js
https://github.com/angular/angular.js/blob/d8f77817eb5c98dec5317bc3756d1ea1812bcfbe/lib/grunt/plugins.js
lib/grunt/plugins.js
'use strict'; /* eslint-disable no-invalid-this */ var util = require('./utils.js'); var npmRun = require('npm-run'); module.exports = function(grunt) { grunt.registerMultiTask('min', 'minify JS files', function() { util.min(this.data, this.async()); }); grunt.registerTask('minall', 'minify all the JS f...
javascript
MIT
d8f77817eb5c98dec5317bc3756d1ea1812bcfbe
2026-01-04T14:56:54.449246Z
false
angular/angular.js
https://github.com/angular/angular.js/blob/d8f77817eb5c98dec5317bc3756d1ea1812bcfbe/lib/grunt/utils.js
lib/grunt/utils.js
'use strict'; var fs = require('fs'); var shell = require('shelljs'); var grunt = require('grunt'); var spawn = require('npm-run').spawn; var CSP_CSS_HEADER = '/* Include this file in your html if you are using the CSP mode. */\n\n'; module.exports = { codeScriptFolder: 'scripts/code.angularjs.org-firebase', d...
javascript
MIT
d8f77817eb5c98dec5317bc3756d1ea1812bcfbe
2026-01-04T14:56:54.449246Z
false
angular/angular.js
https://github.com/angular/angular.js/blob/d8f77817eb5c98dec5317bc3756d1ea1812bcfbe/lib/versions/version-info.js
lib/versions/version-info.js
'use strict'; var fs = require('fs'); var path = require('path'); var shell = require('shelljs'); var semver = require('semver'); var _ = require('lodash'); var process = require('process'); // We are only interested in whether this environment variable exists, hence the !! var NO_REMOTE_REQUESTS = !!process.env['NG1...
javascript
MIT
d8f77817eb5c98dec5317bc3756d1ea1812bcfbe
2026-01-04T14:56:54.449246Z
false
angular/angular.js
https://github.com/angular/angular.js/blob/d8f77817eb5c98dec5317bc3756d1ea1812bcfbe/lib/promises-aplus/promises-aplus-test-adapter.js
lib/promises-aplus/promises-aplus-test-adapter.js
'use strict'; /* global qFactory: false */ /* exported isFunction, isPromiseLike, isObject, isUndefined, minErr, extend */ /* eslint-disable no-unused-vars */ function isFunction(value) { return typeof value === 'function'; } function isPromiseLike(obj) { return obj && isFunction(obj.then); } function isObject(...
javascript
MIT
d8f77817eb5c98dec5317bc3756d1ea1812bcfbe
2026-01-04T14:56:54.449246Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/gulpfile.js
gulpfile.js
const gulp = require('gulp'); const es = require('event-stream'); const path = require('path'); const fs = require('fs'); const rimraf = require('rimraf'); const cp = require('child_process'); const CleanCSS = require('clean-css'); const uncss = require('uncss'); const File = require('vinyl');
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/src/basic-languages/pgsql/keywords.js
src/basic-languages/pgsql/keywords.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/src/basic-languages/mysql/keywords.js
src/basic-languages/mysql/keywords.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/src/basic-languages/sql/keywords.js
src/basic-languages/sql/keywords.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/src/language/typescript/lib/typescriptServices.js
src/language/typescript/lib/typescriptServices.js
// // **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript` // /* MONACOCHANGE */ var require = undefined; var module = { exports: {} }; /* END MONACOCHANGE */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All r...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
true
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-typescript-react/webpack.config.js
samples/browser-esm-webpack-typescript-react/webpack.config.js
const path = require('path'); const HtmlWebPackPlugin = require('html-webpack-plugin'); const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'); const isDevelopment = process.env.NODE_ENV !== 'production'; module.exports = { mode: 'development', entry: { app: './src/index.tsx', 'editor...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-parcel/src/index.js
samples/browser-esm-parcel/src/index.js
import JSONWorker from 'url:monaco-editor/esm/vs/language/json/json.worker.js'; import CSSWorker from 'url:monaco-editor/esm/vs/language/css/css.worker.js'; import HTMLWorker from 'url:monaco-editor/esm/vs/language/html/html.worker.js'; import TSWorker from 'url:monaco-editor/esm/vs/language/typescript/ts.worker.js'; i...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/electron-esm-webpack/main.js
samples/electron-esm-webpack/main.js
const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ width: 800, height: 600, webPreferences: { worldSafeExecuteJavaScript: true } }); mainWindow.loadURL(`file://${__dirname}/di...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/electron-esm-webpack/index.js
samples/electron-esm-webpack/index.js
import * as monaco from 'monaco-editor'; self.MonacoEnvironment = { getWorkerUrl: function (moduleId, label) { if (label === 'json') { return './json.worker.bundle.js'; } if (label === 'css' || label === 'scss' || label === 'less') { return './css.worker.bundle.js'; } if (label === 'html' || label ===...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/electron-esm-webpack/webpack.config.js
samples/electron-esm-webpack/webpack.config.js
const path = require('path'); module.exports = { entry: { app: './index.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker', 'html.worker': 'monaco-editor/esm/vs/la...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-typescript/webpack.config.js
samples/browser-esm-webpack-typescript/webpack.config.js
const path = require('path'); const HtmlWebPackPlugin = require('html-webpack-plugin'); module.exports = { mode: 'development', entry: { app: './src/index.ts', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 'css.worker': 'mona...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-esbuild/index.js
samples/browser-esm-esbuild/index.js
import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; self.MonacoEnvironment = { getWorkerUrl: function (moduleId, label) { if (label === 'json') { return './vs/language/json/json.worker.js'; } if (label === 'css' || label === 'scss' || label === 'less') { return './vs/language/css/css.wor...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-esbuild/build.js
samples/browser-esm-esbuild/build.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-monaco-plugin/index.js
samples/browser-esm-webpack-monaco-plugin/index.js
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; (function () { // create div to avoid needing a HtmlWebpackPlugin template const div = document.createElement('div'); div.id = 'root'; div.style = 'width:800px; height:600px; border:1px solid #ccc;'; document.body.appendChild(div); })(); monaco.e...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-monaco-plugin/webpack.config.js
samples/browser-esm-webpack-monaco-plugin/webpack.config.js
const path = require('path'); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); module.exports = { mode: process.env.NODE_ENV, entry: './index.js', output: { path: path.resolve(__dirname, 'dist'), filename: '[name].bundle.js' }, module: { rules: [ { test: /\.css$/, use: ['style...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/legacy/electron-amd/main.js
samples/legacy/electron-amd/main.js
const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ width: 800, height: 600, webPreferences: { worldSafeExecuteJavaScript: true } }); mainWindow.loadURL(`file://${__dirname}/el...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/legacy/electron-amd-nodeIntegration/main.js
samples/legacy/electron-amd-nodeIntegration/main.js
const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true, worldSafeExecuteJavaScript: true, sandbox: false, ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-small/generate-imports.js
samples/browser-esm-webpack-small/generate-imports.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *-------------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-small/index.js
samples/browser-esm-webpack-small/index.js
// (1) Desired editor features: // BEGIN_FEATURES import 'monaco-editor/esm/vs/editor/browser/controller/coreCommands.js'; // import 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js'; // import 'monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget.js'; // import 'monaco-editor/esm/vs/editor/browse...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack-small/webpack.config.js
samples/browser-esm-webpack-small/webpack.config.js
const path = require('path'); const TerserPlugin = require('terser-webpack-plugin'); module.exports = { mode: 'production', entry: { app: './index.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js' // "json.worker": 'monaco-editor/esm/vs/language/json/json.worker', // "css.worker": 'monaco-...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack/index.js
samples/browser-esm-webpack/index.js
import * as monaco from 'monaco-editor'; self.MonacoEnvironment = { getWorkerUrl: function (moduleId, label) { if (label === 'json') { return './json.worker.bundle.js'; } if (label === 'css' || label === 'scss' || label === 'less') { return './css.worker.bundle.js'; } if (label === 'html' || label ===...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/samples/browser-esm-webpack/webpack.config.js
samples/browser-esm-webpack/webpack.config.js
const path = require('path'); module.exports = { mode: 'development', entry: { app: './index.js', 'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js', 'json.worker': 'monaco-editor/esm/vs/language/json/json.worker', 'css.worker': 'monaco-editor/esm/vs/language/css/css.worker', 'html.worker': 'm...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/smoke/common.js
test/smoke/common.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/smoke/server.js
test/smoke/server.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/smoke/vite/index.js
test/smoke/vite/index.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/smoke/webpack/index.js
test/smoke/webpack/index.js
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; // expose the monaco API as a global for tests window.monacoAPI = monaco;
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/smoke/esbuild/index.js
test/smoke/esbuild/index.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/smoke/parcel/index.js
test/smoke/parcel/index.js
import * as monaco from '../../../out/monaco-editor/esm/vs/editor/editor.main.js'; self.MonacoEnvironment = { getWorker: function (moduleId, label) { if (label === 'json') { return new Worker( new URL('../../../out/monaco-editor/esm/vs/language/json/json.worker.js', import.meta.url), { type: 'module' } ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/manual/index.js
test/manual/index.js
/// <reference path="../../out/monaco-editor/monaco.d.ts" /> define(['require', './samples'], function (require, SAMPLES) { let model = monaco.editor.createModel('', 'plaintext'); monaco.languages.typescript.typescriptDefaults.setInlayHintsOptions({ includeInlayParameterNameHints: 'all', includeInlayParameterNam...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/manual/dev-setup.js
test/manual/dev-setup.js
//@ts-check (function () { const corePaths = { src: '/vscode/out/vs', 'npm/dev': 'node_modules/monaco-editor-core/dev/vs', 'npm/min': 'node_modules/monaco-editor-core/min/vs', built: '/vscode/out-monaco-editor-core/min/vs', releaseDev: 'out/monaco-editor/dev/vs', releaseMin: 'out/monaco-editor/min/vs' };...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/manual/diff.js
test/manual/diff.js
/// <reference path="../../node_modules/monaco-editor-core/monaco.d.ts" /> define(['require'], function (require) { var container = document.getElementById('container'); var original = monaco.editor.createModel(getOriginalStr(), 'javascript'); var modified = monaco.editor.createModel(getModifiedStr(), 'javascript')...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/manual/samples.js
test/manual/samples.js
/// <reference path="../../node_modules/monaco-editor-core/monaco.d.ts" /> define(['./generated/all-samples'], function (ALL_SAMPLES) { var XHR_SAMPLES = {}; ALL_SAMPLES.forEach(function (sample) { XHR_SAMPLES[sample.name] = sample.content; }); var samples = []; var modesIds = monaco.languages.getLanguages()....
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/test/manual/typescript/custom-worker.js
test/manual/typescript/custom-worker.js
// This example uses @typescript/vfs to create a virtual TS program // which can do work on a bg thread. // This version of the vfs edits the global scope (in the case of a webworker, this is 'self') import 'https://unpkg.com/@typescript/vfs@1.3.0/dist/vfs.globals.js'; /** @type { import("@typescript/vfs") } */ const...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/build/amd/plugin.js
build/amd/plugin.js
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/build/amd/src/loader.js
build/amd/src/loader.js
'use strict'; /*!----------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.42.0-dev-20230906(e7d7a5b072e74702a912a4c855a3bda21a7757e7) * Released under the MIT license * https://github.com/microsoft/vscode/blob/main/LICENSE.txt *-----------...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
true
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/build/amd/src/nls.messages-loader.js
build/amd/src/nls.messages-loader.js
export function load(name, req, load, config) { const requestedLanguage = config['vs/nls']?.availableLanguages?.['*']; if (!requestedLanguage || requestedLanguage === 'en') { load({}); } else { req([`vs/nls.messages.${requestedLanguage}`], () => { load({}); }); } }
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/static/monarch/monarch.js
website/static/monarch/monarch.js
/// <reference path="../../node_modules/monaco-editor/monaco.d.ts" /> "use strict"; /*----------------------------------------- General helpers ------------------------------------------*/ function clearInnerText(elem) { elem.innerHTML = ""; } function getInnerText(elem) { var text = elem.innerText; if (!text)...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/all.js
website/src/website/data/playground-samples/all.js
(function () { var PLAY_SAMPLES = [ { chapter: "Creating the editor", name: "Hello world!", id: "creating-the-editor-hello-world", path: "creating-the-editor/hello-world", }, { chapter: "Creating the editor", name: "Editor basic options", id: "creating-the-editor-editor-basic-options", pa...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.js
website/src/website/data/playground-samples/creating-the-diffeditor/multi-line-example/sample.js
var originalModel = monaco.editor.createModel( "This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text", "text/plain" ); var modifiedModel = monaco.editor.createModel( "just some text\nabcz\nzzzzefgh\nSome more text.\nThis line is removed on the left.", "text/plain" ); var diffEditor = mona...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.js
website/src/website/data/playground-samples/creating-the-diffeditor/hello-diff-world/sample.js
const originalModel = monaco.editor.createModel( /* set from `originalModel`: */ `hello world`, "text/plain" ); const modifiedModel = monaco.editor.createModel( /* set from `modifiedModel`: */ `Hello World!`, "text/plain" ); const diffEditor = monaco.editor.createDiffEditor( document.getElementById("container"), ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.js
website/src/website/data/playground-samples/creating-the-diffeditor/inline-diff-example/sample.js
var originalModel = monaco.editor.createModel( "This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text", "text/plain" ); var modifiedModel = monaco.editor.createModel( "just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.", "text/plain" ); var diffEditor = monac...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-key-events/sample.js
var editor = monaco.editor.create(document.getElementById("container"), { value: "function hello() {\n\talert('Hello world!');\n}", language: "javascript", }); var myBinding = editor.addCommand(monaco.KeyCode.F9, function () { alert("F9 pressed!"); }); // You can't dispose `addCommand` // If you need to dispose it...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/line-and-inline-decorations/sample.js
var jsCode = [ '"use strict";', "function Person(age) {", " if (age) {", " this.age = age;", " }", "}", "Person.prototype.getAge = function () {", " return this.age;", "};", ].join("\n"); var editor = monaco.editor.create(document.getElementById("container"), { value: jsCode, language: "javascript", }); v...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-keybinding-to-an-existing-command/sample.js
// Explanation: // First, we need to know the ID of the command. // If you know the default key bindings, you can get the ID by following these steps. // 1. open Visual Studio Code and navigate to "Preferences => Keyboard Shortcuts". // 2. enter a shortcut key (e.g. Tab, Escape, Enter, etc.) in the search text input at...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/adding-a-command-to-an-editor-instance/sample.js
var jsCode = [ '"use strict";', "function Person(age) {", " if (age) {", " this.age = age;", " }", "}", "Person.prototype.getAge = function () {", " return this.age;", "};", ].join("\n"); var editor = monaco.editor.create(document.getElementById("container"), { value: jsCode, language: "javascript", }); v...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/revealing-a-position/sample.js
var jsCodeArr = [ "// ------------------------------", "// ------------------------------", "function Person(age) {", " if (age) {", " this.age = age;", " }", "}", "Person.prototype.getAge = function () {", " return this.age;", "};", "", "", ]; jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0)); jsCodeArr =...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/listening-to-mouse-events/sample.js
var jsCode = [ '"use strict";', "function Person(age) {", " if (age) {", " this.age = age;", " }", "}", "Person.prototype.getAge = function () {", " return this.age;", "};", ].join("\n"); var editor = monaco.editor.create(document.getElementById("container"), { value: jsCode, language: "javascript", glyph...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/adding-an-action-to-an-editor-instance/sample.js
var editor = monaco.editor.create(document.getElementById("container"), { value: [ "", "class Example {", "\tprivate m:number;", "", "\tpublic met(): string {", '\t\treturn "Hello world!";', "\t}", "}", ].join("\n"), language: "typescript", }); // Explanation: // Press F1 => the action will appear a...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/rendering-glyphs-in-the-margin/sample.js
var jsCode = [ '"use strict";', "function Person(age) {", " if (age) {", " this.age = age;", " }", "}", "Person.prototype.getAge = function () {", " return this.age;", "};", ].join("\n"); var editor = monaco.editor.create(document.getElementById("container"), { value: jsCode, language: "javascript", glyph...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.js
website/src/website/data/playground-samples/interacting-with-the-editor/customizing-the-line-numbers/sample.js
function lineNumbersFunc(originalLineNumber) { var map = [ "O", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", ]; if (originalLineNumber < map.length) { return map[originalLineNumber]; } return originalLineNumber; } var jsCode = [ '"use strict";', "function Person(age) {", ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/hover-provider-example/sample.js
monaco.languages.register({ id: "mySpecialLanguage" }); monaco.languages.registerHoverProvider("mySpecialLanguage", { provideHover: function (model, position) { return xhr("./playground.html").then(function (res) { return { range: new monaco.Range( 1, 1, model.getLineCount(), model.getLin...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/codelens-provider-example/sample.js
var editor = monaco.editor.create(document.getElementById("container"), { value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n', language: "json", }); var commandId = editor.addCommand( 0, function () { // services available in `ctx` alert("my command is executing!"); }, "" ); monaco.languages.registerCodeLensPro...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/color-provider-example/sample.js
monaco.languages.register({ id: "colorLanguage", }); monaco.editor.create(document.getElementById("container"), { value: "red\nblue\ngreen", language: "colorLanguage", colorDecorators: true, }); monaco.languages.registerColorProvider("colorLanguage", { provideColorPresentations: (model, colorInfo) => { var col...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.js
website/src/website/data/playground-samples/extending-language-services/configure-javascript-defaults/sample.js
// Add additional d.ts files to the JavaScript language service and change. // Also change the default compilation options. // The sample below shows how a class Facts is declared and introduced // to the system and how the compiler is told to use ES6 (target=2). // validation settings monaco.typescript.javascriptDefa...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/completion-provider-example/sample.js
function createDependencyProposals(range) { // returning a static list of proposals, not even looking at the prefix (filtering is done by the Monaco editor), // here you could do a server side lookup return [ { label: '"lodash"', kind: monaco.languages.CompletionItemKind.Function, documentation: "The Loda...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.js
website/src/website/data/playground-samples/extending-language-services/configure-json-defaults/sample.js
// Configures two JSON schemas, with references. var jsonCode = ["{", ' "p1": "v3",', ' "p2": false', "}"].join("\n"); var modelUri = monaco.Uri.parse("a://b/foo.json"); // a made up unique URI for our model var model = monaco.editor.createModel(jsonCode, "json", modelUri); // configure the JSON language suppor...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/folding-provider-example/sample.js
monaco.languages.register({ id: "foldLanguage", }); var value = `1. Hit F1 to bring up the Command Palette 2. Type 'fold' 3. Choose 'Fold All Block Comments' or 'Fold All Regions' 5. comment1 6. comment1 7. comment1 9. unfoldable text 10. unfoldable text 11. unfoldable text 13. comment2 14. comment2 15. comment2 1...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/inlay-hints-provider-example/sample.js
const value = ` const f = (a, b) => a + b; const result = f(2, 5); `; const editor = monaco.editor.create(document.getElementById("container"), { value, language: "javascript", }); monaco.languages.registerInlayHintsProvider("javascript", { provideInlayHints(model, range, token) { return { hints: [ { ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.js
website/src/website/data/playground-samples/extending-language-services/model-markers-example/sample.js
function validate(model) { const markers = []; // lines start at 1 for (let i = 1; i < model.getLineCount() + 1; i++) { const range = { startLineNumber: i, startColumn: 1, endLineNumber: i, endColumn: model.getLineLength(i) + 1, }; const content = model.getValueInRange(range).trim(); const number...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/symbols-provider-example/sample.js
monaco.languages.registerDocumentSymbolProvider("json", { provideDocumentSymbols: function (model, token) { return [ { range: { startLineNumber: 1, startColumn: 1, endLineNumber: 2, endColumn: 1, }, name: "File", kind: 0, detail: "", tags: [], selectionRange: { ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.js
website/src/website/data/playground-samples/extending-language-services/semantic-tokens-provider-example/sample.js
/** @type {monaco.languages.SemanticTokensLegend} */ const legend = { tokenTypes: [ "comment", "string", "keyword", "number", "regexp", "operator", "namespace", "type", "struct", "class", "interface", "enum", "typeParameter", "function", "member", "macro", "variable", "parameter", ...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.js
website/src/website/data/playground-samples/extending-language-services/custom-languages/sample.js
// Register a new language monaco.languages.register({ id: "mySpecialLanguage" }); // Register a tokens provider for the language monaco.languages.setMonarchTokensProvider("mySpecialLanguage", { tokenizer: { root: [ [/\[error.*/, "custom-error"], [/\[notice.*/, "custom-notice"], [/\[info.*/, "custom-info"]...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.js
website/src/website/data/playground-samples/creating-the-editor/hard-wrapping/sample.js
var jsCode = '// jqeuery excerpt:\n// 1 2 3 4\n//34567890123456789012345678901234567890\n/*!\r\n * Sizzle CSS Selector Engine v2.3.0\r\n * https://sizzlejs.com/\r\n *\r\n * Copyright jQuery Foundation and other contributors\r\n * Released under the MIT license\r\n * http://jquery.org/lice...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js
website/src/website/data/playground-samples/creating-the-editor/web-component/sample.js
customElements.define( "code-view-monaco", class CodeViewMonaco extends HTMLElement { _monacoEditor; /** @type HTMLElement */ _editor; constructor() { super(); const shadowRoot = this.attachShadow({ mode: "open" }); // Copy over editor styles const styles = document.querySelectorAll( "link[...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.js
website/src/website/data/playground-samples/creating-the-editor/syntax-highlighting-for-html-elements/sample.js
// The colorizeElement-function will read the data-lang-attribute // from the element to select the correct language mode. In this // sample it is text/css. monaco.editor.colorizeElement(document.getElementById("code"), {});
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js
website/src/website/data/playground-samples/creating-the-editor/hello-world/sample.js
const value = /* set from `myEditor.getModel()`: */ `function hello() { alert('Hello world!'); }`; // Hover on each property to see its docs! const myEditor = monaco.editor.create(document.getElementById("container"), { value, language: "javascript", automaticLayout: true, });
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.js
website/src/website/data/playground-samples/creating-the-editor/editor-basic-options/sample.js
// Through the options literal, the behaviour of the editor can be easily customized. // Here are a few examples of config options that can be passed to the editor. // You can also call editor.updateOptions at any time to change the options. var editor = monaco.editor.create(document.getElementById("container"), { va...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.js
website/src/website/data/playground-samples/customizing-the-appearence/exposed-colors/sample.js
// The editor colors can be customized through CSS or through JS monaco.editor.defineTheme("myTheme", { base: "vs", inherit: true, rules: [], colors: { "editor.foreground": "#000000", "editor.background": "#EDF9FA", "editorCursor.foreground": "#8B0000", "editor.lineHighlightBackground": "#0000FF20", "edi...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.js
website/src/website/data/playground-samples/customizing-the-appearence/scrollbars/sample.js
// Remember to check out the CSS too! var htmlCode = '<html><!--long linelong linelong linelong linelong linelong linelong linelong linelong linelong line-->\n<head>\n <!-- HTML comment -->\n <style type="text/css">\n /* CSS comment */\n </style>\n <script type="javascript">\n // JavaScript comment\n </' + "script>...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
microsoft/monaco-editor
https://github.com/microsoft/monaco-editor/blob/ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8/website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.js
website/src/website/data/playground-samples/customizing-the-appearence/tokens-and-colors/sample.js
// Theme matching (i.e. applying a style to a token) happens in JavaScript. // We must therefore register the theme rules in JavaScript. // A custom theme must name its base theme (i.e. 'vs', 'vs-dark' or 'hc-black') // It can then choose to inherit the rules from the base theme or not // A rule token matching is pref...
javascript
MIT
ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8
2026-01-04T14:58:11.817025Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/eslint.config.js
eslint.config.js
// eslint.config.js const { defineConfig } = require('eslint/config'); const globals = require('globals'); const { fixupPluginRules } = require('@eslint/compat'); const eslintPluginDiff = require('eslint-plugin-diff'); let stylistic; const runESMImports = async () => { stylistic = await import('@stylistic/eslint-pl...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/scripts/setup.js
scripts/setup.js
const { execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); const icons = { clean: '🧹', delete: '🗑️', install: '📦', build: '🔨', success: '✅', error: '❌', working: '⚡' }; const execCommand = (command, description) => { try { console.log(`\n${icons.work...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/scripts/count-locs.js
scripts/count-locs.js
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const PACKAGES_DIR = path.join(__dirname, '..', 'packages'); const EXCLUDE_DIRS = ['node_modules', 'dist', 'build', '.next', 'coverage', '.git']; const EXCLUDE_PACKAGES = ['bruno-toml', 'bruno-tests', 'bruno-docs']; const CODE_EXTENSIONS = ['...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/scripts/dev-hot-reload.js
scripts/dev-hot-reload.js
#!/usr/bin/env node /** # Bruno Development Script # # This script sets up and runs the Bruno development environment with hot-reloading. # It manages concurrent processes for various packages and provides cleanup on exit. # # Usage: # From the root of the project, run: # node ./scripts/dev-hot-reload.js [opti...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/scripts/build-electron.js
scripts/build-electron.js
const os = require('os'); const fs = require('fs-extra'); const util = require('util'); const spawn = util.promisify(require('child_process').spawn); const path = require('path'); async function deleteFileIfExists(filePath) { try { const exists = await fs.pathExists(filePath); if (exists) { await fs.re...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/scripts/dev.js
scripts/dev.js
const { spawn } = require('child_process'); const path = require('path'); // ANSI color codes const colors = { reset: '\x1b[0m', bright: '\x1b[1m', dim: '\x1b[2m', green: '\x1b[32m', yellow: '\x1b[33m', blue: '\x1b[34m', magenta: '\x1b[35m', cyan: '\x1b[36m', red: '\x1b[31m' }; const log = { info:...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/scripts/pr-checkout.js
scripts/pr-checkout.js
#!/usr/bin/env node const { execSync } = require('child_process'); const path = require('path'); const fs = require('fs'); const prNumber = process.argv[2]; if (!prNumber || !/^\d+$/.test(prNumber)) { console.error('Usage: node scripts/pr-checkout.js <pr-number>'); process.exit(1); } const repoRoot = path.resol...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/footer/sidebar-toggle/sidebar-toggle.spec.js
tests/footer/sidebar-toggle/sidebar-toggle.spec.js
import { test, expect } from '../../../playwright'; test.describe('Sidebar Toggle', () => { test('should toggle sidebar visibility when clicking the toggle button', async ({ page }) => { // Get the sidebar and toggle button elements const sidebar = page.locator('aside.sidebar'); const toggleButton = page...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/footer/notifications/notifications.spec.js
tests/footer/notifications/notifications.spec.js
import { test, expect } from '../../../playwright'; test.describe('Notifications Modal', () => { test('should open notifications modal when clicking bell icon and close with close button', async ({ page }) => { // Get the notification bell icon in the status bar const notificationBell = page.getByLabel('Chec...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/ssl/custom-ca-certs/server/index.js
tests/ssl/custom-ca-certs/server/index.js
#!/usr/bin/env node const path = require('node:path'); const fs = require('node:fs'); const https = require('node:https'); const WebSocket = require('ws'); const { killProcessOnPort } = require('./helpers/platform'); function createServer(certsDir, port = 8090) { const serverOptions = { key: fs.readFileSync(pat...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/ssl/custom-ca-certs/server/scripts/generate-certs.js
tests/ssl/custom-ca-certs/server/scripts/generate-certs.js
#!/usr/bin/env node const path = require('node:path'); const { createCertsDir, generateCertificates, addCAToTruststore, verifyCertificates } = require('../helpers/certs'); /** * Setup CA certificates for testing server */ async function setup() { console.log('🔧 Setting up CA certificates for test server'...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/ssl/custom-ca-certs/server/helpers/certs.js
tests/ssl/custom-ca-certs/server/helpers/certs.js
const { execCommand, execCommandSilent, detectPlatform } = require('./platform'); const fs = require('node:fs'); const path = require('node:path'); function createCertsDir(certsDir) { if (fs.existsSync(certsDir)) { fs.rmSync(certsDir, { recursive: true, force: true }); } fs.mkdirSync(certsDir, { recursive: t...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/ssl/custom-ca-certs/server/helpers/platform.js
tests/ssl/custom-ca-certs/server/helpers/platform.js
const { execSync } = require('node:child_process'); const os = require('node:os'); function execCommand(command, cwd = process.cwd()) { return execSync(command, { cwd, stdio: 'inherit', timeout: 30000 }); } function execCommandSilent(command, cwd = process.cwd()) { return execSync(command, { cwd...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/preferences/support-links.spec.js
tests/preferences/support-links.spec.js
import { test, expect } from '../../playwright'; test('Should verify all support links with correct URL in preference > Support tab', async ({ page }) => { // Open Preferences await page.getByLabel('Open Preferences').click(); // Go to Support tab await page.getByRole('tab', { name: 'Support' }).click(); /...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/tests/preferences/default-collection-location/default-collection-location.spec.js
tests/preferences/default-collection-location/default-collection-location.spec.js
import { test, expect } from '../../../playwright'; test.describe('Default Collection Location Feature', () => { test('Should hydrate the default location from preferences', async ({ pageWithUserData: page }) => { // open preferences await page.locator('.preferences-button').click(); // verify the defau...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-common/babel.config.js
packages/bruno-common/babel.config.js
module.exports = { presets: [ ['@babel/preset-env', { modules: 'auto' }], '@babel/preset-typescript', ], };
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-common/rollup.config.js
packages/bruno-common/rollup.config.js
const { nodeResolve } = require('@rollup/plugin-node-resolve'); const commonjs = require('@rollup/plugin-commonjs'); const typescript = require('@rollup/plugin-typescript'); const dts = require('rollup-plugin-dts'); const { terser } = require('rollup-plugin-terser'); const peerDepsExternal = require('rollup-plugin-peer...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-common/jest.config.js
packages/bruno-common/jest.config.js
module.exports = { transform: { '^.+\\.(ts|js)$': 'babel-jest', }, transformIgnorePatterns: [ '/node_modules/(?!(lodash-es|is-ip|ip-regex|super-regex|function-timeout|time-span|convert-hrtime|clone-regexp|is-regexp)/)' ], testEnvironment: 'node' };
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-toml/src/jsonToToml.js
packages/bruno-toml/src/jsonToToml.js
const stringify = require('../lib/stringify'); const { get, each, filter } = require('lodash'); const keyValPairHasDuplicateKeys = (keyValPair) => { if (!keyValPair || !Array.isArray(keyValPair) || !keyValPair.length) { return false; } const names = keyValPair.map((pair) => pair.name); const uniqueNames =...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-toml/src/tomlToJson.js
packages/bruno-toml/src/tomlToJson.js
const Toml = require('@iarna/toml'); const { has, each, get } = require('lodash'); const stripNewlineAtEnd = (str) => { if (!str || typeof str !== 'string') { return ''; } return str.replace(/\n$/, ''); }; const tomlToJson = (toml) => { const json = Toml.parse(toml); const formattedJson = { meta: ...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-toml/tests/index.spec.js
packages/bruno-toml/tests/index.spec.js
const fs = require('fs'); const path = require('path'); const jsonToToml = require('../src/jsonToToml'); const tomlToJson = require('../src/tomlToJson'); const fixtures = [ 'methods/get', 'methods/delete', 'headers/simple-header', 'headers/empty-header', 'headers/spaces-in-header', 'headers/unicode-in-head...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-query/rollup.config.js
packages/bruno-query/rollup.config.js
const { nodeResolve } = require("@rollup/plugin-node-resolve"); const commonjs = require("@rollup/plugin-commonjs"); const typescript = require("@rollup/plugin-typescript"); const dts = require("rollup-plugin-dts"); const { terser } = require("rollup-plugin-terser"); const peerDepsExternal = require('rollup-plugin-peer...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-query/jest.config.js
packages/bruno-query/jest.config.js
/** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { preset: 'ts-jest', testEnvironment: 'node', };
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-tests/src/index.js
packages/bruno-tests/src/index.js
const express = require('express'); const bodyParser = require('body-parser'); const cors = require('cors'); const formDataParser = require('./multipart/form-data-parser'); const authRouter = require('./auth'); const echoRouter = require('./echo'); const xmlParser = require('./utils/xmlParser'); const multipartRouter =...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false
usebruno/bruno
https://github.com/usebruno/bruno/blob/b6a27bc66c93946b93ea736674830f700dbccb6e/packages/bruno-tests/src/auth/bearer.js
packages/bruno-tests/src/auth/bearer.js
const express = require('express'); const router = express.Router(); const authenticateToken = (req, res, next) => { const token = req.header('Authorization'); if (!token || token !== `Bearer your_secret_token`) { return res.status(401).json({ message: 'Unauthorized' }); } next(); }; router.get('/protec...
javascript
MIT
b6a27bc66c93946b93ea736674830f700dbccb6e
2026-01-04T14:59:20.022123Z
false