Use the global monaco only in the AMD case (see microsoft/monaco-editor#1974)

This commit is contained in:
Alex Dima 2020-09-08 13:40:42 +02:00
parent 1af07d9cdb
commit d7cc098c48
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
80 changed files with 347 additions and 387 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/.idea/ /.idea/
/*.iml /*.iml
/node_modules/ /node_modules/
/out/
/release/ /release/

View file

@ -1,4 +1,5 @@
/.vscode/ /.vscode/
/out/
/release/**/*.test.js /release/**/*.test.js
/release/**/test/ /release/**/test/
/scripts/ /scripts/
@ -7,6 +8,8 @@
/gulpfile.js /gulpfile.js
/tsconfig.json /tsconfig.json
/.npmignore /.npmignore
/.prettierrc
/.prettierignore
/.travis.yml /.travis.yml
/.editorconfig /.editorconfig
/azure-pipelines.yml /azure-pipelines.yml

2
.prettierignore Normal file
View file

@ -0,0 +1,2 @@
/out/
/release/

36
package-lock.json generated
View file

@ -330,16 +330,16 @@
"dev": true "dev": true
}, },
"cosmiconfig": { "cosmiconfig": {
"version": "6.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz",
"integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/parse-json": "^4.0.0", "@types/parse-json": "^4.0.0",
"import-fresh": "^3.1.0", "import-fresh": "^3.2.1",
"parse-json": "^5.0.0", "parse-json": "^5.0.0",
"path-type": "^4.0.0", "path-type": "^4.0.0",
"yaml": "^1.7.2" "yaml": "^1.10.0"
} }
}, },
"cross-spawn": { "cross-spawn": {
@ -775,15 +775,15 @@
"dev": true "dev": true
}, },
"husky": { "husky": {
"version": "4.2.5", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz",
"integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^4.0.0", "chalk": "^4.0.0",
"ci-info": "^2.0.0", "ci-info": "^2.0.0",
"compare-versions": "^3.6.0", "compare-versions": "^3.6.0",
"cosmiconfig": "^6.0.0", "cosmiconfig": "^7.0.0",
"find-versions": "^3.2.0", "find-versions": "^3.2.0",
"opencollective-postinstall": "^2.0.2", "opencollective-postinstall": "^2.0.2",
"pkg-dir": "^4.2.0", "pkg-dir": "^4.2.0",
@ -958,9 +958,9 @@
} }
}, },
"json-parse-even-better-errors": { "json-parse-even-better-errors": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true "dev": true
}, },
"json-schema": { "json-schema": {
@ -1665,9 +1665,9 @@
} }
}, },
"terser": { "terser": {
"version": "4.8.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.0.tgz",
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", "integrity": "sha512-XTT3D3AwxC54KywJijmY2mxZ8nJiEjBHVYzq8l9OaYuRFWeQNBwvipuzzYEP4e+/AVcd1hqG/CqgsdIRyT45Fg==",
"dev": true, "dev": true,
"requires": { "requires": {
"commander": "^2.20.0", "commander": "^2.20.0",
@ -1726,9 +1726,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "3.7.5", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
"integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
"dev": true "dev": true
}, },
"uri-js": { "uri-js": {

View file

@ -3,11 +3,11 @@
"version": "1.10.0", "version": "1.10.0",
"description": "Bundle of many languages for the Monaco Editor.", "description": "Bundle of many languages for the Monaco Editor.",
"scripts": { "scripts": {
"compile": "mrmdir ./release && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json", "compile": "mrmdir ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json",
"watch": "tsc -p ./src --watch", "watch": "tsc -p ./src --watch",
"watch-esm": "tsc -p ./src/tsconfig.esm.json --watch", "watch-esm": "tsc -p ./src/tsconfig.esm.json --watch",
"test": "tape -r ./test/all.js", "test": "tape -r ./test/all.js",
"prepublishOnly": "npm run compile && node ./scripts/bundle", "prepublishOnly": "mrmdir ./release && npm run compile && node ./scripts/release.js && node ./scripts/bundle",
"prettier": "prettier --write ." "prettier": "prettier --write ."
}, },
"author": "Microsoft Corporation", "author": "Microsoft Corporation",
@ -22,16 +22,16 @@
"devDependencies": { "devDependencies": {
"@types/tape": "^4.2.34", "@types/tape": "^4.2.34",
"glob": "^7.1.6", "glob": "^7.1.6",
"husky": "^4.2.5", "husky": "^4.3.0",
"jsdom": "^16.4.0", "jsdom": "^16.4.0",
"monaco-editor-core": "0.20.0", "monaco-editor-core": "0.20.0",
"monaco-plugin-helpers": "^1.0.2", "monaco-plugin-helpers": "^1.0.3",
"prettier": "^2.1.1", "prettier": "^2.1.1",
"pretty-quick": "^3.0.0", "pretty-quick": "^3.0.0",
"requirejs": "^2.3.6", "requirejs": "^2.3.6",
"tape": "^4.13.2", "tape": "^4.13.2",
"terser": "^4.6.6", "terser": "^5.3.0",
"typescript": "3.7.5" "typescript": "4.0.2"
}, },
"husky": { "husky": {
"hooks": { "hooks": {

View file

@ -22,45 +22,60 @@ const BUNDLED_FILE_HEADER = [
].join('\n'); ].join('\n');
bundleOne('monaco.contribution'); bundleOne('monaco.contribution');
glob( glob('out/amd/*/*.contribution.js', { cwd: path.dirname(__dirname) }, function (
'release/dev/*/*.contribution.js', err,
{ cwd: path.dirname(__dirname) }, files
function (err, files) { ) {
if (err) { if (err) {
console.log(err); console.log(err);
return; return;
}
files.forEach(function (file) {
file = file.replace(/\.contribution\.js$/, '');
file = file.replace(/release[/\\]dev[/\\]/, '');
bundleOne(file);
});
} }
); files.forEach(function (file) {
file = file.replace(/\.contribution\.js$/, '');
file = file.replace(/out[/\\]amd[/\\]/, '');
bundleOne(file, ['vs/basic-languages/monaco.contribution']);
});
});
function bundleOne(moduleId, exclude) { function bundleOne(moduleId, exclude) {
requirejs.optimize( requirejs.optimize(
{ {
baseUrl: 'release/dev/', baseUrl: 'out/amd/',
name: 'vs/basic-languages/' + moduleId, name: 'vs/basic-languages/' + moduleId,
out: 'release/min/' + moduleId + '.js', out: 'release/dev/' + moduleId + '.js',
exclude: exclude, exclude: exclude,
paths: { paths: {
'vs/basic-languages': REPO_ROOT + '/release/dev' 'vs/basic-languages': REPO_ROOT + '/out/amd',
'vs/basic-languages/fillers/monaco-editor-core':
REPO_ROOT + '/out/amd/fillers/monaco-editor-core-amd'
}, },
optimize: 'none' optimize: 'none'
}, },
function (buildResponse) { async function (buildResponse) {
const filePath = path.join( const devFilePath = path.join(
REPO_ROOT,
'release/dev/' + moduleId + '.js'
);
const minFilePath = path.join(
REPO_ROOT, REPO_ROOT,
'release/min/' + moduleId + '.js' 'release/min/' + moduleId + '.js'
); );
const fileContents = fs.readFileSync(filePath).toString(); const fileContents = fs.readFileSync(devFilePath).toString();
console.log(); console.log();
console.log(`Minifying ${filePath}...`); console.log(`Minifying ${devFilePath}...`);
const result = terser.minify(fileContents); const result = await terser.minify(fileContents, {
console.log(`Done.`); output: {
fs.writeFileSync(filePath, BUNDLED_FILE_HEADER + result.code); comments: 'some'
}
});
console.log(`Done minifying ${devFilePath}.`);
try {
fs.mkdirSync(path.join(REPO_ROOT, 'release/min'));
} catch (err) {}
try {
fs.mkdirSync(path.dirname(minFilePath));
} catch (err) {}
fs.writeFileSync(minFilePath, BUNDLED_FILE_HEADER + result.code);
} }
); );
} }

17
scripts/release.js Normal file
View file

@ -0,0 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const path = require('path');
const helpers = require('monaco-plugin-helpers');
const REPO_ROOT = path.join(__dirname, '../');
helpers.packageESM({
repoRoot: REPO_ROOT,
esmSource: 'out/esm',
esmDestination: 'release/esm',
entryPoints: ['monaco.contribution.js'],
resolveSkip: ['monaco-editor-core']
});

View file

@ -3,17 +3,15 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
// Allow for running under nodejs/requirejs in tests import { languages } from './fillers/monaco-editor-core';
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
interface ILang extends monaco.languages.ILanguageExtensionPoint { interface ILang extends languages.ILanguageExtensionPoint {
loader: () => Promise<ILangImpl>; loader: () => Promise<ILangImpl>;
} }
interface ILangImpl { interface ILangImpl {
conf: monaco.languages.LanguageConfiguration; conf: languages.LanguageConfiguration;
language: monaco.languages.IMonarchLanguage; language: languages.IMonarchLanguage;
} }
const languageDefinitions: { [languageId: string]: ILang } = {}; const languageDefinitions: { [languageId: string]: ILang } = {};
@ -68,16 +66,16 @@ export function registerLanguage(def: ILang): void {
const languageId = def.id; const languageId = def.id;
languageDefinitions[languageId] = def; languageDefinitions[languageId] = def;
_monaco.languages.register(def); languages.register(def);
const lazyLanguageLoader = LazyLanguageLoader.getOrCreate(languageId); const lazyLanguageLoader = LazyLanguageLoader.getOrCreate(languageId);
_monaco.languages.setMonarchTokensProvider( languages.setMonarchTokensProvider(
languageId, languageId,
lazyLanguageLoader.whenLoaded().then((mod) => mod.language) lazyLanguageLoader.whenLoaded().then((mod) => mod.language)
); );
_monaco.languages.onLanguage(languageId, () => { languages.onLanguage(languageId, () => {
lazyLanguageLoader.load().then((mod) => { lazyLanguageLoader.load().then((mod) => {
_monaco.languages.setLanguageConfiguration(languageId, mod.conf); languages.setLanguageConfiguration(languageId, mod.conf);
}); });
}); });
} }

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '*' lineComment: '*'
}, },
@ -423,7 +422,7 @@ const abapKeywords = [
'final' 'final'
]; ];
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: 'invalid', defaultToken: 'invalid',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.abap', tokenPostfix: '.abap',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
// the default separators except `@$` // the default separators except `@$`
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -201,7 +200,7 @@ keywords.forEach((lowercase) => {
keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase)); keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase));
}); });
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.apex', tokenPostfix: '.apex',

View file

@ -3,16 +3,15 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: 'keyword', defaultToken: 'keyword',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.azcli', tokenPostfix: '.azcli',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: 'REM' lineComment: 'REM'
}, },
@ -34,7 +33,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.bat', tokenPostfix: '.bat',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['(*', '*)'] blockComment: ['(*', '*)']
@ -33,7 +32,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.cameligo', tokenPostfix: '.cameligo',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: ';;' lineComment: ';;'
}, },
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.clj', tokenPostfix: '.clj',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
blockComment: ['###', '###'], blockComment: ['###', '###'],
@ -39,7 +38,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.coffee', tokenPostfix: '.coffee',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -38,7 +37,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.cpp', tokenPostfix: '.cpp',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
lineComment: '//', lineComment: '//',
@ -40,7 +39,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.cs', tokenPostfix: '.cs',

View file

@ -3,16 +3,15 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
brackets: [], brackets: [],
autoClosingPairs: [], autoClosingPairs: [],
surroundingPairs: [] surroundingPairs: []
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
// Set defaultToken to invalid to see what you do not tokenize yet // Set defaultToken to invalid to see what you do not tokenize yet
// defaultToken: 'invalid', // defaultToken: 'invalid',
keywords: [], keywords: [],

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import LanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import IMonarchLanguage = monaco.languages.IMonarchLanguage;
export const conf: LanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g, wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,
comments: { comments: {
@ -43,7 +42,7 @@ export const conf: LanguageConfiguration = {
} }
}; };
export const language = <IMonarchLanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.css', tokenPostfix: '.css',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import LanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import IMonarchLanguage = monaco.languages.IMonarchLanguage;
export const conf: LanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -44,7 +43,7 @@ export const conf: LanguageConfiguration = {
} }
}; };
export const language = <IMonarchLanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: 'invalid', defaultToken: 'invalid',
tokenPostfix: '.dart', tokenPostfix: '.dart',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
brackets: [ brackets: [
['{', '}'], ['{', '}'],
['[', ']'], ['[', ']'],
@ -28,7 +27,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.dockerfile', tokenPostfix: '.dockerfile',

View file

@ -0,0 +1,12 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Resolves with the global monaco API
declare const define: any;
define([], function () {
return (<any>self).monaco;
});

View file

@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export * from 'monaco-editor-core';

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['(*', '*)'] blockComment: ['(*', '*)']
@ -41,7 +40,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.fs', tokenPostfix: '.fs',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -34,7 +33,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.go', tokenPostfix: '.go',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
}, },
@ -34,7 +33,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
// Set defaultToken to invalid to see what you do not tokenize yet // Set defaultToken to invalid to see what you do not tokenize yet
defaultToken: 'invalid', defaultToken: 'invalid',
tokenPostfix: '.gql', tokenPostfix: '.gql',

View file

@ -3,12 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
// Allow for running under nodejs/requirejs in tests
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
const EMPTY_ELEMENTS: string[] = [ const EMPTY_ELEMENTS: string[] = [
'area', 'area',
@ -29,7 +24,7 @@ const EMPTY_ELEMENTS: string[] = [
'wbr' 'wbr'
]; ];
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
comments: { comments: {
@ -68,7 +63,7 @@ export const conf: IRichLanguageConfiguration = {
), ),
afterText: /^<\/(\w[\w\d]*)\s*>$/i, afterText: /^<\/(\w[\w\d]*)\s*>$/i,
action: { action: {
indentAction: _monaco.languages.IndentAction.IndentOutdent indentAction: languages.IndentAction.IndentOutdent
} }
}, },
{ {
@ -78,12 +73,12 @@ export const conf: IRichLanguageConfiguration = {
)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, )}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
'i' 'i'
), ),
action: { indentAction: _monaco.languages.IndentAction.Indent } action: { indentAction: languages.IndentAction.Indent }
} }
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '', tokenPostfix: '',
// ignoreCase: true, // ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -30,7 +29,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.hcl', tokenPostfix: '.hcl',

View file

@ -3,12 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
// Allow for running under nodejs/requirejs in tests
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
const EMPTY_ELEMENTS: string[] = [ const EMPTY_ELEMENTS: string[] = [
'area', 'area',
@ -29,7 +24,7 @@ const EMPTY_ELEMENTS: string[] = [
'wbr' 'wbr'
]; ];
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
comments: { comments: {
@ -70,7 +65,7 @@ export const conf: IRichLanguageConfiguration = {
), ),
afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i, afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
action: { action: {
indentAction: _monaco.languages.IndentAction.IndentOutdent indentAction: languages.IndentAction.IndentOutdent
} }
}, },
{ {
@ -80,7 +75,7 @@ export const conf: IRichLanguageConfiguration = {
)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, )}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
'i' 'i'
), ),
action: { indentAction: _monaco.languages.IndentAction.Indent } action: { indentAction: languages.IndentAction.Indent }
} }
], ],
@ -92,7 +87,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.html', tokenPostfix: '.html',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
}, },
@ -31,7 +30,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.ini', tokenPostfix: '.ini',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
// the default separators except `@$` // the default separators except `@$`
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -45,7 +44,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.java', tokenPostfix: '.java',

View file

@ -7,16 +7,11 @@ import {
conf as tsConf, conf as tsConf,
language as tsLanguage language as tsLanguage
} from '../typescript/typescript'; } from '../typescript/typescript';
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
// Allow for running under nodejs/requirejs in tests export const conf: languages.LanguageConfiguration = tsConf;
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
export const conf: IRichLanguageConfiguration = tsConf; export const language = <languages.IMonarchLanguage>{
export const language = <ILanguage>{
// Set defaultToken to invalid to see what you do not tokenize yet // Set defaultToken to invalid to see what you do not tokenize yet
defaultToken: 'invalid', defaultToken: 'invalid',
tokenPostfix: '.js', tokenPostfix: '.js',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
brackets: [ brackets: [
['{', '}'], ['{', '}'],
['[', ']'], ['[', ']'],
@ -28,7 +27,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.julia', tokenPostfix: '.julia',
keywords: [ keywords: [

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
// the default separators except `@$` // the default separators except `@$`
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -45,7 +44,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.kt', tokenPostfix: '.kt',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g, wordPattern: /(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,
comments: { comments: {
blockComment: ['/*', '*/'], blockComment: ['/*', '*/'],
@ -39,7 +38,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.less', tokenPostfix: '.less',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: 'COMMENT' lineComment: 'COMMENT'
// blockComment: ['COMMENT', '.'], // blockComment: ['COMMENT', '.'],
@ -36,7 +35,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
// Set defaultToken to invalid to see what you do not tokenize yet // Set defaultToken to invalid to see what you do not tokenize yet
// defaultToken: 'invalid', // defaultToken: 'invalid',
tokenPostfix: '.lexon', tokenPostfix: '.lexon',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '--', lineComment: '--',
blockComment: ['--[[', ']]'] blockComment: ['--[[', ']]']
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.lua', tokenPostfix: '.lua',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
blockComment: ['<!--', '-->'] blockComment: ['<!--', '-->']
}, },
@ -34,7 +33,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.md', tokenPostfix: '.md',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
blockComment: ['###', '###'], blockComment: ['###', '###'],
@ -20,7 +19,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: false, ignoreCase: false,
tokenPostfix: '.mips', tokenPostfix: '.mips',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -25,7 +24,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.msdax', tokenPostfix: '.msdax',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '--', lineComment: '--',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sql', tokenPostfix: '.sql',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.objective-c', tokenPostfix: '.objective-c',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
// the default separators except `@$` // the default separators except `@$`
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -41,7 +40,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.pascal', tokenPostfix: '.pascal',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['(*', '*)'] blockComment: ['(*', '*)']
@ -33,7 +32,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.pascaligo', tokenPostfix: '.pascaligo',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
}, },
@ -33,7 +32,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.perl', tokenPostfix: '.perl',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '--', lineComment: '--',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sql', tokenPostfix: '.sql',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -36,7 +35,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '', tokenPostfix: '',
// ignoreCase: true, // ignoreCase: true,

View file

@ -5,10 +5,9 @@
* Based on the ATS/Postiats lexer by Hongwei Xi. * Based on the ATS/Postiats lexer by Hongwei Xi.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['(*', '*)'] blockComment: ['(*', '*)']
@ -27,7 +26,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.pats', tokenPostfix: '.pats',
// TODO: staload and dynload are followed by a special kind of string literals // TODO: staload and dynload are followed by a special kind of string literals

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -24,7 +23,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.pq', tokenPostfix: '.pq',
ignoreCase: false, ignoreCase: false,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
// the default separators except `$-` // the default separators except `$-`
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -40,7 +39,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.ps1', tokenPostfix: '.ps1',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//' lineComment: '//'
}, },
@ -27,7 +26,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.pug', tokenPostfix: '.pug',

View file

@ -3,14 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
// Allow for running under nodejs/requirejs in tests export const conf: languages.LanguageConfiguration = {
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
export const conf: IRichLanguageConfiguration = {
comments: { comments: {
lineComment: '#', lineComment: '#',
blockComment: ["'''", "'''"] blockComment: ["'''", "'''"]
@ -39,7 +34,7 @@ export const conf: IRichLanguageConfiguration = {
beforeText: new RegExp( beforeText: new RegExp(
'^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$' '^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$'
), ),
action: { indentAction: _monaco.languages.IndentAction.Indent } action: { indentAction: languages.IndentAction.Indent }
} }
], ],
folding: { folding: {
@ -51,7 +46,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.python', tokenPostfix: '.python',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
}, },
@ -29,7 +28,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.r', tokenPostfix: '.r',

View file

@ -3,12 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
// Allow for running under nodejs/requirejs in tests
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
const EMPTY_ELEMENTS: string[] = [ const EMPTY_ELEMENTS: string[] = [
'area', 'area',
@ -29,7 +24,7 @@ const EMPTY_ELEMENTS: string[] = [
'wbr' 'wbr'
]; ];
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
comments: { comments: {
@ -67,7 +62,7 @@ export const conf: IRichLanguageConfiguration = {
), ),
afterText: /^<\/(\w[\w\d]*)\s*>$/i, afterText: /^<\/(\w[\w\d]*)\s*>$/i,
action: { action: {
indentAction: _monaco.languages.IndentAction.IndentOutdent indentAction: languages.IndentAction.IndentOutdent
} }
}, },
{ {
@ -77,12 +72,12 @@ export const conf: IRichLanguageConfiguration = {
)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`, )}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
'i' 'i'
), ),
action: { indentAction: _monaco.languages.IndentAction.Indent } action: { indentAction: languages.IndentAction.Indent }
} }
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '', tokenPostfix: '',
// ignoreCase: true, // ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
brackets: [ brackets: [
['{', '}'], ['{', '}'],
['[', ']'], ['[', ']'],
@ -28,7 +27,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.redis', tokenPostfix: '.redis',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '--', lineComment: '--',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sql', tokenPostfix: '.sql',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
brackets: [ brackets: [
['{', '}'], ['{', '}'],
['[', ']'], ['[', ']'],
@ -31,7 +30,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.rst', tokenPostfix: '.rst',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#', lineComment: '#',
blockComment: ['=begin', '=end'] blockComment: ['=begin', '=end']
@ -89,7 +88,7 @@ export const conf: IRichLanguageConfiguration = {
* regular expression can also contain comments. * regular expression can also contain comments.
*/ */
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.ruby', tokenPostfix: '.ruby',
keywords: [ keywords: [

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -38,7 +37,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.rust', tokenPostfix: '.rust',
defaultToken: 'invalid', defaultToken: 'invalid',
keywords: [ keywords: [

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: "'" lineComment: "'"
}, },
@ -25,7 +24,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sb', tokenPostfix: '.sb',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
/* /*
* `...` is allowed as an identifier. * `...` is allowed as an identifier.
* $ is allowed in identifiers. * $ is allowed in identifiers.
@ -49,7 +48,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.scala', tokenPostfix: '.scala',
// We can't easily add everything from Dotty, but we can at least add some of its keywords // We can't easily add everything from Dotty, but we can at least add some of its keywords

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: ';', lineComment: ';',
blockComment: ['#|', '|#'] blockComment: ['#|', '|#']
@ -33,7 +32,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.scheme', tokenPostfix: '.scheme',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import LanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import IMonarchLanguage = monaco.languages.IMonarchLanguage;
export const conf: LanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(#?-?\d*\.\d\w*%?)|([@$#!.:]?[\w-?]+%?)|[@#!.]/g, wordPattern: /(#?-?\d*\.\d\w*%?)|([@$#!.:]?[\w-?]+%?)|[@#!.]/g,
comments: { comments: {
blockComment: ['/*', '*/'], blockComment: ['/*', '*/'],
@ -39,7 +38,7 @@ export const conf: LanguageConfiguration = {
} }
}; };
export const language = <IMonarchLanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.scss', tokenPostfix: '.scss',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
}, },
@ -33,7 +32,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
ignoreCase: true, ignoreCase: true,
tokenPostfix: '.shell', tokenPostfix: '.shell',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -25,7 +24,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sol', tokenPostfix: '.sol',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -25,7 +24,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.aes', tokenPostfix: '.aes',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '--', lineComment: '--',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -32,7 +31,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sql', tokenPostfix: '.sql',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['(*', '*)'] blockComment: ['(*', '*)']
@ -116,7 +115,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.st', tokenPostfix: '.st',
ignoreCase: true, ignoreCase: true,

View file

@ -2,10 +2,9 @@
* Copyright (C) David Owens II, owensd.io. All rights reserved. * Copyright (C) David Owens II, owensd.io. All rights reserved.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -33,7 +32,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.swift', tokenPostfix: '.swift',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '//', lineComment: '//',
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -64,7 +63,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.sv', tokenPostfix: '.sv',

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
brackets: [ brackets: [
['{', '}'], ['{', '}'],
['[', ']'], ['[', ']'],
@ -28,7 +27,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.tcl', tokenPostfix: '.tcl',
specialFunctions: [ specialFunctions: [

View file

@ -6,10 +6,7 @@
import '../monaco.contribution'; import '../monaco.contribution';
import { loadLanguage } from '../_.contribution'; import { loadLanguage } from '../_.contribution';
import * as test from 'tape'; import * as test from 'tape';
import { editor } from '../fillers/monaco-editor-core';
// Allow for running under nodejs/requirejs in tests
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
export interface IRelaxedToken { export interface IRelaxedToken {
startIndex: number; startIndex: number;
@ -56,7 +53,7 @@ function runTests(
function runTest(t: test.Test, languageId: string, test: ITestItem[]): void { function runTest(t: test.Test, languageId: string, test: ITestItem[]): void {
let text = test.map((t) => t.line).join('\n'); let text = test.map((t) => t.line).join('\n');
let actualTokens = _monaco.editor.tokenize(text, languageId); let actualTokens = editor.tokenize(text, languageId);
let actual = actualTokens.map((lineTokens, index) => { let actual = actualTokens.map((lineTokens, index) => {
return { return {
line: test[index].line, line: test[index].line,

View file

@ -1,7 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "esnext", "module": "esnext",
"outDir": "../release/esm", "moduleResolution": "node",
"outDir": "../out/esm",
"target": "es5", "target": "es5",
"lib": [ "lib": [
"dom", "dom",
@ -10,7 +11,5 @@
"es2015.iterable", "es2015.iterable",
"es2015.promise" "es2015.promise"
] ]
}, }
"include": ["**/*.ts"],
"files": ["../node_modules/monaco-editor-core/monaco.d.ts"]
} }

View file

@ -1,7 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "amd", "module": "amd",
"outDir": "../release/dev", "moduleResolution": "node",
"outDir": "../out/amd",
"target": "es5", "target": "es5",
"strict": true, "strict": true,
"lib": [ "lib": [
@ -11,7 +12,5 @@
"es2015.iterable", "es2015.iterable",
"es2015.promise" "es2015.promise"
] ]
}, }
"include": ["**/*.ts"],
"files": ["../node_modules/monaco-editor-core/monaco.d.ts"]
} }

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
comments: { comments: {
@ -44,7 +43,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '', tokenPostfix: '',
ignoreCase: true, ignoreCase: true,

View file

@ -3,14 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
// Allow for running under nodejs/requirejs in tests export const conf: languages.LanguageConfiguration = {
const _monaco: typeof monaco =
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
export const conf: IRichLanguageConfiguration = {
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
comments: { comments: {
@ -30,7 +25,7 @@ export const conf: IRichLanguageConfiguration = {
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
afterText: /^\s*\*\/$/, afterText: /^\s*\*\/$/,
action: { action: {
indentAction: _monaco.languages.IndentAction.IndentOutdent, indentAction: languages.IndentAction.IndentOutdent,
appendText: ' * ' appendText: ' * '
} }
}, },
@ -38,7 +33,7 @@ export const conf: IRichLanguageConfiguration = {
// e.g. /** ...| // e.g. /** ...|
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
action: { action: {
indentAction: _monaco.languages.IndentAction.None, indentAction: languages.IndentAction.None,
appendText: ' * ' appendText: ' * '
} }
}, },
@ -46,7 +41,7 @@ export const conf: IRichLanguageConfiguration = {
// e.g. * ...| // e.g. * ...|
beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
action: { action: {
indentAction: _monaco.languages.IndentAction.None, indentAction: languages.IndentAction.None,
appendText: '* ' appendText: '* '
} }
}, },
@ -54,7 +49,7 @@ export const conf: IRichLanguageConfiguration = {
// e.g. */| // e.g. */|
beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/,
action: { action: {
indentAction: _monaco.languages.IndentAction.None, indentAction: languages.IndentAction.None,
removeText: 1 removeText: 1
} }
} }

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: "'", lineComment: "'",
blockComment: ['/*', '*/'] blockComment: ['/*', '*/']
@ -57,7 +56,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.vb', tokenPostfix: '.vb',
ignoreCase: true, ignoreCase: true,

View file

@ -3,10 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
blockComment: ['<!--', '-->'] blockComment: ['<!--', '-->']
}, },
@ -23,7 +22,7 @@ export const conf: IRichLanguageConfiguration = {
] ]
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
defaultToken: '', defaultToken: '',
tokenPostfix: '.xml', tokenPostfix: '.xml',

View file

@ -1,7 +1,6 @@
import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import type { languages } from '../fillers/monaco-editor-core';
import ILanguage = monaco.languages.IMonarchLanguage;
export const conf: IRichLanguageConfiguration = { export const conf: languages.LanguageConfiguration = {
comments: { comments: {
lineComment: '#' lineComment: '#'
}, },
@ -29,7 +28,7 @@ export const conf: IRichLanguageConfiguration = {
} }
}; };
export const language = <ILanguage>{ export const language = <languages.IMonarchLanguage>{
tokenPostfix: '.yaml', tokenPostfix: '.yaml',
brackets: [ brackets: [

View file

@ -8,6 +8,8 @@ requirejs.config({
paths: { paths: {
'vs/css': 'test/css.mock', 'vs/css': 'test/css.mock',
'vs/nls': 'test/nls.mock', 'vs/nls': 'test/nls.mock',
'out/amd/fillers/monaco-editor-core':
'out/amd/fillers/monaco-editor-core-amd',
vs: 'node_modules/monaco-editor-core/dev/vs' vs: 'node_modules/monaco-editor-core/dev/vs'
}, },
nodeRequire: require nodeRequire: require
@ -25,25 +27,24 @@ global.window = { location: {}, navigator: tmp.window.navigator };
requirejs( requirejs(
['./test/setup'], ['./test/setup'],
function () { function () {
glob( glob('out/amd/*/*.test.js', { cwd: path.dirname(__dirname) }, function (
'release/dev/*/*.test.js', err,
{ cwd: path.dirname(__dirname) }, files
function (err, files) { ) {
if (err) { if (err) {
console.log(err); console.log(err);
return; return;
}
requirejs(
files.map((f) => f.replace(/\.js$/, '')),
function () {
// We can launch the tests!
},
function (err) {
console.log(err);
}
);
} }
); requirejs(
files.map((f) => f.replace(/\.js$/, '')),
function () {
// We can launch the tests!
},
function (err) {
console.log(err);
}
);
});
}, },
function (err) { function (err) {
console.log(err); console.log(err);