mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Reorganize project
This commit is contained in:
parent
49f2283894
commit
93c48edccc
121 changed files with 875 additions and 426 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/.vscode/
|
||||
/release/**/test/
|
||||
/release/**/*.test.js/
|
||||
/scripts/
|
||||
/src/
|
||||
/test/
|
||||
|
|
|
|||
21
README.md
21
README.md
|
|
@ -52,25 +52,18 @@ This npm module is bundled and distributed in the [monaco-editor](https://www.np
|
|||
|
||||
## Dev: Adding a new language
|
||||
|
||||
* create `$/src/myLang.ts`
|
||||
* create `$/test/myLang.test.ts`
|
||||
* create `$/src/myLang/myLang.contribution.ts`
|
||||
* create `$/src/myLang/myLang.ts`
|
||||
* create `$/src/myLang/myLang.test.ts`
|
||||
* restart compilation with `$> npm run watch`
|
||||
* edit `$/src/monaco.contribution.ts` and register your new language:
|
||||
* edit `$/test/setup.js` and load your new language while testing
|
||||
```js
|
||||
registerLanguage({
|
||||
id: 'sql',
|
||||
extensions: [ '.sql' ],
|
||||
aliases: [ 'SQL' ],
|
||||
module: './sql'
|
||||
});
|
||||
'release/dev/sql/sql.test',
|
||||
```
|
||||
* edit `$/test/all.js` and load your new language while testing
|
||||
* edit `$/scripts/bundle.js` and ship your new language
|
||||
```js
|
||||
'out/test/sql.test',
|
||||
```
|
||||
* edit `$/gulpfile.js` and ship your new language
|
||||
```js
|
||||
bundleOne('src/sql'),
|
||||
bundleOne('sql/sql'),
|
||||
```
|
||||
|
||||
## Code of Conduct
|
||||
|
|
|
|||
|
|
@ -21,44 +21,44 @@ const BUNDLED_FILE_HEADER = [
|
|||
].join('\n');
|
||||
|
||||
bundleOne('monaco.contribution');
|
||||
bundleOne('bat');
|
||||
bundleOne('css');
|
||||
bundleOne('coffee');
|
||||
bundleOne('cpp');
|
||||
bundleOne('csharp');
|
||||
bundleOne('dockerfile');
|
||||
bundleOne('fsharp');
|
||||
bundleOne('go');
|
||||
bundleOne('handlebars');
|
||||
bundleOne('html');
|
||||
bundleOne('ini');
|
||||
bundleOne('pug');
|
||||
bundleOne('java');
|
||||
bundleOne('less');
|
||||
bundleOne('lua');
|
||||
bundleOne('markdown');
|
||||
bundleOne('msdax');
|
||||
bundleOne('objective-c');
|
||||
bundleOne('php');
|
||||
bundleOne('powershell');
|
||||
bundleOne('postiats');
|
||||
bundleOne('python');
|
||||
bundleOne('r');
|
||||
bundleOne('razor');
|
||||
bundleOne('ruby');
|
||||
bundleOne('scss');
|
||||
bundleOne('sql');
|
||||
bundleOne('swift');
|
||||
bundleOne('vb');
|
||||
bundleOne('xml');
|
||||
bundleOne('yaml');
|
||||
bundleOne('solidity');
|
||||
bundleOne('sb');
|
||||
bundleOne('mysql');
|
||||
bundleOne('redshift');
|
||||
bundleOne('pgsql');
|
||||
bundleOne('redis');
|
||||
bundleOne('csp');
|
||||
bundleOne('bat/bat');
|
||||
bundleOne('css/css');
|
||||
bundleOne('coffee/coffee');
|
||||
bundleOne('cpp/cpp');
|
||||
bundleOne('csharp/csharp');
|
||||
bundleOne('dockerfile/dockerfile');
|
||||
bundleOne('fsharp/fsharp');
|
||||
bundleOne('go/go');
|
||||
bundleOne('handlebars/handlebars');
|
||||
bundleOne('html/html');
|
||||
bundleOne('ini/ini');
|
||||
bundleOne('pug/pug');
|
||||
bundleOne('java/java');
|
||||
bundleOne('less/less');
|
||||
bundleOne('lua/lua');
|
||||
bundleOne('markdown/markdown');
|
||||
bundleOne('msdax/msdax');
|
||||
bundleOne('objective-c/objective-c');
|
||||
bundleOne('php/php');
|
||||
bundleOne('powershell/powershell');
|
||||
bundleOne('postiats/postiats');
|
||||
bundleOne('python/python');
|
||||
bundleOne('r/r');
|
||||
bundleOne('razor/razor');
|
||||
bundleOne('ruby/ruby');
|
||||
bundleOne('scss/scss');
|
||||
bundleOne('sql/sql');
|
||||
bundleOne('swift/swift');
|
||||
bundleOne('vb/vb');
|
||||
bundleOne('xml/xml');
|
||||
bundleOne('yaml/yaml');
|
||||
bundleOne('solidity/solidity');
|
||||
bundleOne('sb/sb');
|
||||
bundleOne('mysql/mysql');
|
||||
bundleOne('redshift/redshift');
|
||||
bundleOne('pgsql/pgsql');
|
||||
bundleOne('redis/redis');
|
||||
bundleOne('csp/csp');
|
||||
|
||||
function bundleOne(moduleId, exclude) {
|
||||
requirejs.optimize({
|
||||
|
|
|
|||
46
src/_.contribution.ts
Normal file
46
src/_.contribution.ts
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
interface ILang extends monaco.languages.ILanguageExtensionPoint {
|
||||
loader: () => monaco.Promise<ILangImpl>;
|
||||
}
|
||||
|
||||
interface ILangImpl {
|
||||
conf: monaco.languages.LanguageConfiguration;
|
||||
language: monaco.languages.IMonarchLanguage;
|
||||
}
|
||||
|
||||
let languageDefinitions: { [languageId: string]: ILang } = {};
|
||||
|
||||
function _loadLanguage(languageId: string): monaco.Promise<void> {
|
||||
const loader = languageDefinitions[languageId].loader;
|
||||
return loader().then((mod) => {
|
||||
_monaco.languages.setMonarchTokensProvider(languageId, mod.language);
|
||||
_monaco.languages.setLanguageConfiguration(languageId, mod.conf);
|
||||
});
|
||||
}
|
||||
|
||||
let languagePromises: { [languageId: string]: monaco.Promise<void> } = {};
|
||||
|
||||
export function loadLanguage(languageId: string): monaco.Promise<void> {
|
||||
if (!languagePromises[languageId]) {
|
||||
languagePromises[languageId] = _loadLanguage(languageId);
|
||||
}
|
||||
return languagePromises[languageId];
|
||||
}
|
||||
|
||||
export function registerLanguage(def: ILang): void {
|
||||
let languageId = def.id;
|
||||
|
||||
languageDefinitions[languageId] = def;
|
||||
_monaco.languages.register(def);
|
||||
_monaco.languages.onLanguage(languageId, () => {
|
||||
loadLanguage(languageId);
|
||||
});
|
||||
}
|
||||
17
src/bat/bat.contribution.ts
Normal file
17
src/bat/bat.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'bat',
|
||||
extensions: ['.bat', '.cmd'],
|
||||
aliases: ['Batch', 'bat'],
|
||||
loader: () => _monaco.Promise.wrap(import('./bat'))
|
||||
});
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('bat', [
|
||||
// Keywords
|
||||
18
src/coffee/coffee.contribution.ts
Normal file
18
src/coffee/coffee.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'coffeescript',
|
||||
extensions: ['.coffee'],
|
||||
aliases: ['CoffeeScript', 'coffeescript', 'coffee'],
|
||||
mimetypes: ['text/x-coffeescript', 'text/coffeescript'],
|
||||
loader: () => _monaco.Promise.wrap(import('./coffee'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('coffeescript', [
|
||||
// Comments
|
||||
23
src/cpp/cpp.contribution.ts
Normal file
23
src/cpp/cpp.contribution.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'c',
|
||||
extensions: ['.c', '.h'],
|
||||
aliases: ['C', 'c'],
|
||||
loader: () => _monaco.Promise.wrap(import('./cpp'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'cpp',
|
||||
extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'],
|
||||
aliases: ['C++', 'Cpp', 'cpp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./cpp'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('cpp', [
|
||||
// Keywords
|
||||
17
src/csharp/csharp.contribution.ts
Normal file
17
src/csharp/csharp.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'csharp',
|
||||
extensions: ['.cs', '.csx'],
|
||||
aliases: ['C#', 'csharp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./csharp'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('csharp', [
|
||||
|
||||
17
src/csp/csp.contribution.ts
Normal file
17
src/csp/csp.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'csp',
|
||||
extensions: [],
|
||||
aliases: ['CSP', 'csp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./csp'))
|
||||
});
|
||||
|
|
@ -5,6 +5,6 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('csp', []);
|
||||
18
src/css/css.contribution.ts
Normal file
18
src/css/css.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'css',
|
||||
extensions: ['.css'],
|
||||
aliases: ['CSS', 'css'],
|
||||
mimetypes: ['text/css'],
|
||||
loader: () => _monaco.Promise.wrap(import('./css'))
|
||||
});
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('css', [
|
||||
// Skip whitespace
|
||||
18
src/dockerfile/dockerfile.contribution.ts
Normal file
18
src/dockerfile/dockerfile.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'dockerfile',
|
||||
extensions: ['.dockerfile'],
|
||||
filenames: ['Dockerfile'],
|
||||
aliases: ['Dockerfile'],
|
||||
loader: () => _monaco.Promise.wrap(import('./dockerfile'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('dockerfile', [
|
||||
// All
|
||||
17
src/fsharp/fsharp.contribution.ts
Normal file
17
src/fsharp/fsharp.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'fsharp',
|
||||
extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'],
|
||||
aliases: ['F#', 'FSharp', 'fsharp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./fsharp'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('fsharp', [
|
||||
// comments - single line
|
||||
17
src/go/go.contribution.ts
Normal file
17
src/go/go.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'go',
|
||||
extensions: ['.go'],
|
||||
aliases: ['Go'],
|
||||
loader: () => _monaco.Promise.wrap(import('./go'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('go', [
|
||||
// Tests
|
||||
18
src/handlebars/handlebars.contribution.ts
Normal file
18
src/handlebars/handlebars.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'handlebars',
|
||||
extensions: ['.handlebars', '.hbs'],
|
||||
aliases: ['Handlebars', 'handlebars'],
|
||||
mimetypes: ['text/x-handlebars-template'],
|
||||
loader: () => _monaco.Promise.wrap(import('./handlebars'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization(['handlebars', 'css'], [
|
||||
|
||||
18
src/html/html.contribution.ts
Normal file
18
src/html/html.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'html',
|
||||
extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
|
||||
aliases: ['HTML', 'htm', 'html', 'xhtml'],
|
||||
mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'],
|
||||
loader: () => _monaco.Promise.wrap(import('./html'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization(['html', 'css'], [
|
||||
|
||||
18
src/ini/ini.contribution.ts
Normal file
18
src/ini/ini.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'ini',
|
||||
extensions: ['.ini', '.properties', '.gitconfig'],
|
||||
filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'],
|
||||
aliases: ['Ini', 'ini'],
|
||||
loader: () => _monaco.Promise.wrap(import('./ini'))
|
||||
});
|
||||
18
src/java/java.contribution.ts
Normal file
18
src/java/java.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'java',
|
||||
extensions: ['.java', '.jav'],
|
||||
aliases: ['Java', 'java'],
|
||||
mimetypes: ['text/x-java-source', 'text/x-java'],
|
||||
loader: () => _monaco.Promise.wrap(import('./java'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('java', [
|
||||
// Comments - single line
|
||||
18
src/less/less.contribution.ts
Normal file
18
src/less/less.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'less',
|
||||
extensions: ['.less'],
|
||||
aliases: ['Less', 'less'],
|
||||
mimetypes: ['text/x-less', 'text/less'],
|
||||
loader: () => _monaco.Promise.wrap(import('./less'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization(['less'], [
|
||||
|
||||
17
src/lua/lua.contribution.ts
Normal file
17
src/lua/lua.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'lua',
|
||||
extensions: ['.lua'],
|
||||
aliases: ['Lua', 'lua'],
|
||||
loader: () => _monaco.Promise.wrap(import('./lua'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('lua', [
|
||||
|
||||
17
src/markdown/markdown.contribution.ts
Normal file
17
src/markdown/markdown.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'markdown',
|
||||
extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'],
|
||||
aliases: ['Markdown', 'markdown'],
|
||||
loader: () => _monaco.Promise.wrap(import('./markdown'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('markdown', [
|
||||
|
||||
0
src/test/mocha.d.ts → src/mocha.d.ts
vendored
0
src/test/mocha.d.ts → src/mocha.d.ts
vendored
|
|
@ -4,301 +4,41 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
interface ILang extends monaco.languages.ILanguageExtensionPoint {
|
||||
loader: () => monaco.Promise<ILangImpl>;
|
||||
}
|
||||
|
||||
interface ILangImpl {
|
||||
conf: monaco.languages.LanguageConfiguration;
|
||||
language: monaco.languages.IMonarchLanguage;
|
||||
}
|
||||
|
||||
let languageDefinitions: { [languageId: string]: ILang } = {};
|
||||
|
||||
function _loadLanguage(languageId: string): monaco.Promise<void> {
|
||||
const loader = languageDefinitions[languageId].loader;
|
||||
return loader().then((mod) => {
|
||||
_monaco.languages.setMonarchTokensProvider(languageId, mod.language);
|
||||
_monaco.languages.setLanguageConfiguration(languageId, mod.conf);
|
||||
});
|
||||
}
|
||||
|
||||
let languagePromises: { [languageId: string]: monaco.Promise<void> } = {};
|
||||
|
||||
export function loadLanguage(languageId: string): monaco.Promise<void> {
|
||||
if (!languagePromises[languageId]) {
|
||||
languagePromises[languageId] = _loadLanguage(languageId);
|
||||
}
|
||||
return languagePromises[languageId];
|
||||
}
|
||||
|
||||
function registerLanguage(def: ILang): void {
|
||||
let languageId = def.id;
|
||||
|
||||
languageDefinitions[languageId] = def;
|
||||
_monaco.languages.register(def);
|
||||
_monaco.languages.onLanguage(languageId, () => {
|
||||
loadLanguage(languageId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
registerLanguage({
|
||||
id: 'bat',
|
||||
extensions: ['.bat', '.cmd'],
|
||||
aliases: ['Batch', 'bat'],
|
||||
loader: () => _monaco.Promise.wrap(import('./bat'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'coffeescript',
|
||||
extensions: ['.coffee'],
|
||||
aliases: ['CoffeeScript', 'coffeescript', 'coffee'],
|
||||
mimetypes: ['text/x-coffeescript', 'text/coffeescript'],
|
||||
loader: () => _monaco.Promise.wrap(import('./coffee'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'c',
|
||||
extensions: ['.c', '.h'],
|
||||
aliases: ['C', 'c'],
|
||||
loader: () => _monaco.Promise.wrap(import('./cpp'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'cpp',
|
||||
extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'],
|
||||
aliases: ['C++', 'Cpp', 'cpp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./cpp'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'csharp',
|
||||
extensions: ['.cs', '.csx'],
|
||||
aliases: ['C#', 'csharp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./csharp'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'dockerfile',
|
||||
extensions: ['.dockerfile'],
|
||||
filenames: ['Dockerfile'],
|
||||
aliases: ['Dockerfile'],
|
||||
loader: () => _monaco.Promise.wrap(import('./dockerfile'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'fsharp',
|
||||
extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'],
|
||||
aliases: ['F#', 'FSharp', 'fsharp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./fsharp'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'go',
|
||||
extensions: ['.go'],
|
||||
aliases: ['Go'],
|
||||
loader: () => _monaco.Promise.wrap(import('./go'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'handlebars',
|
||||
extensions: ['.handlebars', '.hbs'],
|
||||
aliases: ['Handlebars', 'handlebars'],
|
||||
mimetypes: ['text/x-handlebars-template'],
|
||||
loader: () => _monaco.Promise.wrap(import('./handlebars'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'html',
|
||||
extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'],
|
||||
aliases: ['HTML', 'htm', 'html', 'xhtml'],
|
||||
mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'],
|
||||
loader: () => _monaco.Promise.wrap(import('./html'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'ini',
|
||||
extensions: ['.ini', '.properties', '.gitconfig'],
|
||||
filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'],
|
||||
aliases: ['Ini', 'ini'],
|
||||
loader: () => _monaco.Promise.wrap(import('./ini'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'pug',
|
||||
extensions: ['.jade', '.pug'],
|
||||
aliases: ['Pug', 'Jade', 'jade'],
|
||||
loader: () => _monaco.Promise.wrap(import('./pug'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'java',
|
||||
extensions: ['.java', '.jav'],
|
||||
aliases: ['Java', 'java'],
|
||||
mimetypes: ['text/x-java-source', 'text/x-java'],
|
||||
loader: () => _monaco.Promise.wrap(import('./java'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'lua',
|
||||
extensions: ['.lua'],
|
||||
aliases: ['Lua', 'lua'],
|
||||
loader: () => _monaco.Promise.wrap(import('./lua'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'markdown',
|
||||
extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'],
|
||||
aliases: ['Markdown', 'markdown'],
|
||||
loader: () => _monaco.Promise.wrap(import('./markdown'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'msdax',
|
||||
extensions: ['.dax', '.msdax'],
|
||||
aliases: ['DAX', 'MSDAX'],
|
||||
loader: () => _monaco.Promise.wrap(import('./msdax'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'objective-c',
|
||||
extensions: ['.m'],
|
||||
aliases: ['Objective-C'],
|
||||
loader: () => _monaco.Promise.wrap(import('./objective-c'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'postiats',
|
||||
extensions: ['.dats', '.sats', '.hats'],
|
||||
aliases: ['ATS', 'ATS/Postiats'],
|
||||
loader: () => _monaco.Promise.wrap(import('./postiats'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'php',
|
||||
extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'],
|
||||
aliases: ['PHP', 'php'],
|
||||
mimetypes: ['application/x-php'],
|
||||
loader: () => _monaco.Promise.wrap(import('./php'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'powershell',
|
||||
extensions: ['.ps1', '.psm1', '.psd1'],
|
||||
aliases: ['PowerShell', 'powershell', 'ps', 'ps1'],
|
||||
loader: () => _monaco.Promise.wrap(import('./powershell'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'python',
|
||||
extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'],
|
||||
aliases: ['Python', 'py'],
|
||||
firstLine: '^#!/.*\\bpython[0-9.-]*\\b',
|
||||
loader: () => _monaco.Promise.wrap(import('./python'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'r',
|
||||
extensions: ['.r', '.rhistory', '.rprofile', '.rt'],
|
||||
aliases: ['R', 'r'],
|
||||
loader: () => _monaco.Promise.wrap(import('./r'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'razor',
|
||||
extensions: ['.cshtml'],
|
||||
aliases: ['Razor', 'razor'],
|
||||
mimetypes: ['text/x-cshtml'],
|
||||
loader: () => _monaco.Promise.wrap(import('./razor'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'ruby',
|
||||
extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.pp'],
|
||||
filenames: ['rakefile'],
|
||||
aliases: ['Ruby', 'rb'],
|
||||
loader: () => _monaco.Promise.wrap(import('./ruby'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'swift',
|
||||
aliases: ['Swift', 'swift'],
|
||||
extensions: ['.swift'],
|
||||
mimetypes: ['text/swift'],
|
||||
loader: () => _monaco.Promise.wrap(import('./swift'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'sql',
|
||||
extensions: ['.sql'],
|
||||
aliases: ['SQL'],
|
||||
loader: () => _monaco.Promise.wrap(import('./sql'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'vb',
|
||||
extensions: ['.vb'],
|
||||
aliases: ['Visual Basic', 'vb'],
|
||||
loader: () => _monaco.Promise.wrap(import('./vb'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'xml',
|
||||
extensions: ['.xml', '.dtd', '.ascx', '.csproj', '.config', '.wxi', '.wxl', '.wxs', '.xaml', '.svg', '.svgz'],
|
||||
firstLine: '(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)',
|
||||
aliases: ['XML', 'xml'],
|
||||
mimetypes: ['text/xml', 'application/xml', 'application/xaml+xml', 'application/xml-dtd'],
|
||||
loader: () => _monaco.Promise.wrap(import('./xml'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'less',
|
||||
extensions: ['.less'],
|
||||
aliases: ['Less', 'less'],
|
||||
mimetypes: ['text/x-less', 'text/less'],
|
||||
loader: () => _monaco.Promise.wrap(import('./less'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'scss',
|
||||
extensions: ['.scss'],
|
||||
aliases: ['Sass', 'sass', 'scss'],
|
||||
mimetypes: ['text/x-scss', 'text/scss'],
|
||||
loader: () => _monaco.Promise.wrap(import('./scss'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'css',
|
||||
extensions: ['.css'],
|
||||
aliases: ['CSS', 'css'],
|
||||
mimetypes: ['text/css'],
|
||||
loader: () => _monaco.Promise.wrap(import('./css'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'yaml',
|
||||
extensions: ['.yaml', '.yml'],
|
||||
aliases: ['YAML', 'yaml', 'YML', 'yml'],
|
||||
mimetypes: ['application/x-yaml'],
|
||||
loader: () => _monaco.Promise.wrap(import('./yaml'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'sol',
|
||||
extensions: ['.sol'],
|
||||
aliases: ['sol', 'solidity', 'Solidity'],
|
||||
loader: () => _monaco.Promise.wrap(import('./solidity'))
|
||||
});
|
||||
registerLanguage({
|
||||
id: 'sb',
|
||||
extensions: ['.sb'],
|
||||
aliases: ['Small Basic', 'sb'],
|
||||
loader: () => _monaco.Promise.wrap(import('./sb'))
|
||||
});
|
||||
|
||||
registerLanguage({
|
||||
id: 'mysql',
|
||||
extensions: [],
|
||||
aliases: ['MySQL', 'mysql'],
|
||||
loader: () => _monaco.Promise.wrap(import('./mysql'))
|
||||
});
|
||||
|
||||
registerLanguage({
|
||||
id: 'pgsql',
|
||||
extensions: [],
|
||||
aliases: ['PostgreSQL', 'postgres', 'pg', 'postgre'],
|
||||
loader: () => _monaco.Promise.wrap(import('./pgsql'))
|
||||
});
|
||||
|
||||
registerLanguage({
|
||||
id: 'redshift',
|
||||
extensions: [],
|
||||
aliases: ['Redshift', 'redshift'],
|
||||
loader: () => _monaco.Promise.wrap(import('./redshift'))
|
||||
});
|
||||
|
||||
registerLanguage({
|
||||
id: 'redis',
|
||||
extensions: ['.redis'],
|
||||
aliases: ['redis'],
|
||||
loader: () => _monaco.Promise.wrap(import('./redis'))
|
||||
});
|
||||
|
||||
registerLanguage({
|
||||
id: 'csp',
|
||||
extensions: [],
|
||||
aliases: ['CSP', 'csp'],
|
||||
loader: () => _monaco.Promise.wrap(import('./csp'))
|
||||
});
|
||||
import './bat/bat.contribution';
|
||||
import './coffee/coffee.contribution';
|
||||
import './cpp/cpp.contribution';
|
||||
import './csharp/csharp.contribution';
|
||||
import './csp/csp.contribution';
|
||||
import './css/css.contribution';
|
||||
import './dockerfile/dockerfile.contribution';
|
||||
import './fsharp/fsharp.contribution';
|
||||
import './go/go.contribution';
|
||||
import './handlebars/handlebars.contribution';
|
||||
import './html/html.contribution';
|
||||
import './ini/ini.contribution';
|
||||
import './java/java.contribution';
|
||||
import './less/less.contribution';
|
||||
import './lua/lua.contribution';
|
||||
import './markdown/markdown.contribution';
|
||||
import './msdax/msdax.contribution';
|
||||
import './mysql/mysql.contribution';
|
||||
import './objective-c/objective-c.contribution';
|
||||
import './pgsql/pgsql.contribution';
|
||||
import './php/php.contribution';
|
||||
import './postiats/postiats.contribution';
|
||||
import './powershell/powershell.contribution';
|
||||
import './pug/pug.contribution';
|
||||
import './python/python.contribution';
|
||||
import './r/r.contribution';
|
||||
import './razor/razor.contribution';
|
||||
import './redis/redis.contribution';
|
||||
import './redshift/redshift.contribution';
|
||||
import './ruby/ruby.contribution';
|
||||
import './sb/sb.contribution';
|
||||
import './scss/scss.contribution';
|
||||
import './solidity/solidity.contribution';
|
||||
import './sql/sql.contribution';
|
||||
import './swift/swift.contribution';
|
||||
import './vb/vb.contribution';
|
||||
import './xml/xml.contribution';
|
||||
import './yaml/yaml.contribution';
|
||||
|
|
|
|||
17
src/msdax/msdax.contribution.ts
Normal file
17
src/msdax/msdax.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'msdax',
|
||||
extensions: ['.dax', '.msdax'],
|
||||
aliases: ['DAX', 'MSDAX'],
|
||||
loader: () => _monaco.Promise.wrap(import('./msdax'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('msdax', [
|
||||
// Comments
|
||||
17
src/mysql/mysql.contribution.ts
Normal file
17
src/mysql/mysql.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'mysql',
|
||||
extensions: [],
|
||||
aliases: ['MySQL', 'mysql'],
|
||||
loader: () => _monaco.Promise.wrap(import('./mysql'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('mysql', [
|
||||
// Comments
|
||||
17
src/objective-c/objective-c.contribution.ts
Normal file
17
src/objective-c/objective-c.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'objective-c',
|
||||
extensions: ['.m'],
|
||||
aliases: ['Objective-C'],
|
||||
loader: () => _monaco.Promise.wrap(import('./objective-c'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('objective-c', [
|
||||
// Keywords
|
||||
17
src/pgsql/pgsql.contribution.ts
Normal file
17
src/pgsql/pgsql.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'pgsql',
|
||||
extensions: [],
|
||||
aliases: ['PostgreSQL', 'postgres', 'pg', 'postgre'],
|
||||
loader: () => _monaco.Promise.wrap(import('./pgsql'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('sql', [
|
||||
// Comments
|
||||
18
src/php/php.contribution.ts
Normal file
18
src/php/php.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'php',
|
||||
extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'],
|
||||
aliases: ['PHP', 'php'],
|
||||
mimetypes: ['application/x-php'],
|
||||
loader: () => _monaco.Promise.wrap(import('./php'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization(['php', 'css'], [
|
||||
// Bug 13596:[ErrorTelemetry] Stream did not advance while tokenizing. Mode id is php (stuck)
|
||||
17
src/postiats/postiats.contribution.ts
Normal file
17
src/postiats/postiats.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'postiats',
|
||||
extensions: ['.dats', '.sats', '.hats'],
|
||||
aliases: ['ATS', 'ATS/Postiats'],
|
||||
loader: () => _monaco.Promise.wrap(import('./postiats'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('postiats', [
|
||||
// Keywords
|
||||
17
src/powershell/powershell.contribution.ts
Normal file
17
src/powershell/powershell.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'powershell',
|
||||
extensions: ['.ps1', '.psm1', '.psd1'],
|
||||
aliases: ['PowerShell', 'powershell', 'ps', 'ps1'],
|
||||
loader: () => _monaco.Promise.wrap(import('./powershell'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('powershell', [
|
||||
// Comments - single line
|
||||
17
src/pug/pug.contribution.ts
Normal file
17
src/pug/pug.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'pug',
|
||||
extensions: ['.jade', '.pug'],
|
||||
aliases: ['Pug', 'Jade', 'jade'],
|
||||
loader: () => _monaco.Promise.wrap(import('./pug'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('pug', [
|
||||
// Tags [Pug]
|
||||
18
src/python/python.contribution.ts
Normal file
18
src/python/python.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'python',
|
||||
extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'],
|
||||
aliases: ['Python', 'py'],
|
||||
firstLine: '^#!/.*\\bpython[0-9.-]*\\b',
|
||||
loader: () => _monaco.Promise.wrap(import('./python'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('python', [
|
||||
// Keywords
|
||||
17
src/r/r.contribution.ts
Normal file
17
src/r/r.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'r',
|
||||
extensions: ['.r', '.rhistory', '.rprofile', '.rt'],
|
||||
aliases: ['R', 'r'],
|
||||
loader: () => _monaco.Promise.wrap(import('./r'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('r', [
|
||||
// Keywords
|
||||
18
src/razor/razor.contribution.ts
Normal file
18
src/razor/razor.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'razor',
|
||||
extensions: ['.cshtml'],
|
||||
aliases: ['Razor', 'razor'],
|
||||
mimetypes: ['text/x-cshtml'],
|
||||
loader: () => _monaco.Promise.wrap(import('./razor'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('razor', [
|
||||
|
||||
17
src/redis/redis.contribution.ts
Normal file
17
src/redis/redis.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'redis',
|
||||
extensions: ['.redis'],
|
||||
aliases: ['redis'],
|
||||
loader: () => _monaco.Promise.wrap(import('./redis'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('redis', [
|
||||
|
||||
17
src/redshift/redshift.contribution.ts
Normal file
17
src/redshift/redshift.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'redshift',
|
||||
extensions: [],
|
||||
aliases: ['Redshift', 'redshift'],
|
||||
loader: () => _monaco.Promise.wrap(import('./redshift'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('sql', [
|
||||
// Comments
|
||||
18
src/ruby/ruby.contribution.ts
Normal file
18
src/ruby/ruby.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'ruby',
|
||||
extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.pp'],
|
||||
filenames: ['rakefile'],
|
||||
aliases: ['Ruby', 'rb'],
|
||||
loader: () => _monaco.Promise.wrap(import('./ruby'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('ruby', [
|
||||
// Keywords
|
||||
17
src/sb/sb.contribution.ts
Normal file
17
src/sb/sb.contribution.ts
Normal 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.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'sb',
|
||||
extensions: ['.sb'],
|
||||
aliases: ['Small Basic', 'sb'],
|
||||
loader: () => _monaco.Promise.wrap(import('./sb'))
|
||||
});
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { testTokenization } from './testRunner';
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('sb', [
|
||||
|
||||
18
src/scss/scss.contribution.ts
Normal file
18
src/scss/scss.contribution.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
// Allow for running under nodejs/requirejs in tests
|
||||
const _monaco: typeof monaco = (typeof monaco === 'undefined' ? (<any>self).monaco : monaco);
|
||||
|
||||
registerLanguage({
|
||||
id: 'scss',
|
||||
extensions: ['.scss'],
|
||||
aliases: ['Sass', 'sass', 'scss'],
|
||||
mimetypes: ['text/x-scss', 'text/scss'],
|
||||
loader: () => _monaco.Promise.wrap(import('./scss'))
|
||||
});
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { testTokenization as actualTestTokenization, ITestItem } from './testRunner';
|
||||
import { testTokenization as actualTestTokenization, ITestItem } from '../test/testRunner';
|
||||
|
||||
function testTokenization(_language: string | string[], tests: ITestItem[][]): void {
|
||||
tests = tests.map(t => {
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue