Przeglądaj źródła

Reorganize project

Alex Dima 7 lat temu
rodzic
commit
93c48edccc
100 zmienionych plików z 724 dodań i 382 usunięć
  1. 1 1
      .npmignore
  2. 7 14
      README.md
  3. 38 38
      scripts/bundle.js
  4. 46 0
      src/_.contribution.ts
  5. 17 0
      src/bat/bat.contribution.ts
  6. 1 1
      src/bat/bat.test.ts
  7. 0 0
      src/bat/bat.ts
  8. 18 0
      src/coffee/coffee.contribution.ts
  9. 1 1
      src/coffee/coffee.test.ts
  10. 0 0
      src/coffee/coffee.ts
  11. 23 0
      src/cpp/cpp.contribution.ts
  12. 1 1
      src/cpp/cpp.test.ts
  13. 0 0
      src/cpp/cpp.ts
  14. 17 0
      src/csharp/csharp.contribution.ts
  15. 1 1
      src/csharp/csharp.test.ts
  16. 0 0
      src/csharp/csharp.ts
  17. 17 0
      src/csp/csp.contribution.ts
  18. 1 1
      src/csp/csp.test.ts
  19. 0 0
      src/csp/csp.ts
  20. 18 0
      src/css/css.contribution.ts
  21. 1 1
      src/css/css.test.ts
  22. 0 0
      src/css/css.ts
  23. 18 0
      src/dockerfile/dockerfile.contribution.ts
  24. 1 1
      src/dockerfile/dockerfile.test.ts
  25. 0 0
      src/dockerfile/dockerfile.ts
  26. 17 0
      src/fsharp/fsharp.contribution.ts
  27. 1 1
      src/fsharp/fsharp.test.ts
  28. 0 0
      src/fsharp/fsharp.ts
  29. 17 0
      src/go/go.contribution.ts
  30. 1 1
      src/go/go.test.ts
  31. 0 0
      src/go/go.ts
  32. 18 0
      src/handlebars/handlebars.contribution.ts
  33. 1 1
      src/handlebars/handlebars.test.ts
  34. 0 0
      src/handlebars/handlebars.ts
  35. 18 0
      src/html/html.contribution.ts
  36. 1 1
      src/html/html.test.ts
  37. 0 0
      src/html/html.ts
  38. 18 0
      src/ini/ini.contribution.ts
  39. 0 0
      src/ini/ini.ts
  40. 18 0
      src/java/java.contribution.ts
  41. 1 1
      src/java/java.test.ts
  42. 0 0
      src/java/java.ts
  43. 18 0
      src/less/less.contribution.ts
  44. 1 1
      src/less/less.test.ts
  45. 0 0
      src/less/less.ts
  46. 17 0
      src/lua/lua.contribution.ts
  47. 1 1
      src/lua/lua.test.ts
  48. 0 0
      src/lua/lua.ts
  49. 17 0
      src/markdown/markdown.contribution.ts
  50. 1 1
      src/markdown/markdown.test.ts
  51. 0 0
      src/markdown/markdown.ts
  52. 0 0
      src/mocha.d.ts
  53. 38 298
      src/monaco.contribution.ts
  54. 17 0
      src/msdax/msdax.contribution.ts
  55. 1 1
      src/msdax/msdax.test.ts
  56. 0 0
      src/msdax/msdax.ts
  57. 17 0
      src/mysql/mysql.contribution.ts
  58. 1 1
      src/mysql/mysql.test.ts
  59. 0 0
      src/mysql/mysql.ts
  60. 17 0
      src/objective-c/objective-c.contribution.ts
  61. 1 1
      src/objective-c/objective-c.test.ts
  62. 0 0
      src/objective-c/objective-c.ts
  63. 17 0
      src/pgsql/pgsql.contribution.ts
  64. 1 1
      src/pgsql/pgsql.test.ts
  65. 0 0
      src/pgsql/pgsql.ts
  66. 18 0
      src/php/php.contribution.ts
  67. 1 1
      src/php/php.test.ts
  68. 0 0
      src/php/php.ts
  69. 17 0
      src/postiats/postiats.contribution.ts
  70. 1 1
      src/postiats/postiats.test.ts
  71. 0 0
      src/postiats/postiats.ts
  72. 17 0
      src/powershell/powershell.contribution.ts
  73. 1 1
      src/powershell/powershell.test.ts
  74. 0 0
      src/powershell/powershell.ts
  75. 17 0
      src/pug/pug.contribution.ts
  76. 1 1
      src/pug/pug.test.ts
  77. 0 0
      src/pug/pug.ts
  78. 18 0
      src/python/python.contribution.ts
  79. 1 1
      src/python/python.test.ts
  80. 0 0
      src/python/python.ts
  81. 17 0
      src/r/r.contribution.ts
  82. 1 1
      src/r/r.test.ts
  83. 0 0
      src/r/r.ts
  84. 18 0
      src/razor/razor.contribution.ts
  85. 1 1
      src/razor/razor.test.ts
  86. 0 0
      src/razor/razor.ts
  87. 17 0
      src/redis/redis.contribution.ts
  88. 1 1
      src/redis/redis.test.ts
  89. 0 0
      src/redis/redis.ts
  90. 17 0
      src/redshift/redshift.contribution.ts
  91. 1 1
      src/redshift/redshift.test.ts
  92. 0 0
      src/redshift/redshift.ts
  93. 18 0
      src/ruby/ruby.contribution.ts
  94. 1 1
      src/ruby/ruby.test.ts
  95. 0 0
      src/ruby/ruby.ts
  96. 17 0
      src/sb/sb.contribution.ts
  97. 1 1
      src/sb/sb.test.ts
  98. 0 0
      src/sb/sb.ts
  99. 18 0
      src/scss/scss.contribution.ts
  100. 1 1
      src/scss/scss.test.ts

+ 1 - 1
.npmignore

@@ -1,5 +1,5 @@
 /.vscode/
-/release/**/test/
+/release/**/*.test.js/
 /scripts/
 /src/
 /test/

+ 7 - 14
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

+ 38 - 38
scripts/bundle.js

@@ -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 - 0
src/_.contribution.ts

@@ -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 - 0
src/bat/bat.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/bat.test.ts → src/bat/bat.test.ts

@@ -4,7 +4,7 @@
  *--------------------------------------------------------------------------------------------*/
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('bat', [
 	// Keywords

+ 0 - 0
src/bat.ts → src/bat/bat.ts


+ 18 - 0
src/coffee/coffee.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/coffee.test.ts → src/coffee/coffee.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('coffeescript', [
 	// Comments

+ 0 - 0
src/coffee.ts → src/coffee/coffee.ts


+ 23 - 0
src/cpp/cpp.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/cpp.test.ts → src/cpp/cpp.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('cpp', [
 	// Keywords

+ 0 - 0
src/cpp.ts → src/cpp/cpp.ts


+ 17 - 0
src/csharp/csharp.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/csharp.test.ts → src/csharp/csharp.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('csharp', [
 

+ 0 - 0
src/csharp.ts → src/csharp/csharp.ts


+ 17 - 0
src/csp/csp.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/csp.test.ts → src/csp/csp.test.ts

@@ -5,6 +5,6 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('csp', []);

+ 0 - 0
src/csp.ts → src/csp/csp.ts


+ 18 - 0
src/css/css.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/css.test.ts → src/css/css.test.ts

@@ -4,7 +4,7 @@
  *--------------------------------------------------------------------------------------------*/
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('css', [
 	// Skip whitespace

+ 0 - 0
src/css.ts → src/css/css.ts


+ 18 - 0
src/dockerfile/dockerfile.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/dockerfile.test.ts → src/dockerfile/dockerfile.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('dockerfile', [
 	// All

+ 0 - 0
src/dockerfile.ts → src/dockerfile/dockerfile.ts


+ 17 - 0
src/fsharp/fsharp.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/fsharp.test.ts → src/fsharp/fsharp.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('fsharp', [
 	// comments - single line

+ 0 - 0
src/fsharp.ts → src/fsharp/fsharp.ts


+ 17 - 0
src/go/go.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/go.test.ts → src/go/go.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('go', [
 	// Tests

+ 0 - 0
src/go.ts → src/go/go.ts


+ 18 - 0
src/handlebars/handlebars.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/handlebars.test.ts → src/handlebars/handlebars.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization(['handlebars', 'css'], [
 

+ 0 - 0
src/handlebars.ts → src/handlebars/handlebars.ts


+ 18 - 0
src/html/html.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/html.test.ts → src/html/html.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization(['html', 'css'], [
 

+ 0 - 0
src/html.ts → src/html/html.ts


+ 18 - 0
src/ini/ini.contribution.ts

@@ -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'))
+});

+ 0 - 0
src/ini.ts → src/ini/ini.ts


+ 18 - 0
src/java/java.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/java.test.ts → src/java/java.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('java', [
 	// Comments - single line

+ 0 - 0
src/java.ts → src/java/java.ts


+ 18 - 0
src/less/less.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/less.test.ts → src/less/less.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization(['less'], [
 

+ 0 - 0
src/less.ts → src/less/less.ts


+ 17 - 0
src/lua/lua.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/lua.test.ts → src/lua/lua.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('lua', [
 

+ 0 - 0
src/lua.ts → src/lua/lua.ts


+ 17 - 0
src/markdown/markdown.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/markdown.test.ts → src/markdown/markdown.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('markdown', [
 

+ 0 - 0
src/markdown.ts → src/markdown/markdown.ts


+ 0 - 0
src/test/mocha.d.ts → src/mocha.d.ts


+ 38 - 298
src/monaco.contribution.ts

@@ -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 - 0
src/msdax/msdax.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/msdax.test.ts → src/msdax/msdax.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('msdax', [
 	// Comments

+ 0 - 0
src/msdax.ts → src/msdax/msdax.ts


+ 17 - 0
src/mysql/mysql.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/mysql.test.ts → src/mysql/mysql.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('mysql', [
 	// Comments

+ 0 - 0
src/mysql.ts → src/mysql/mysql.ts


+ 17 - 0
src/objective-c/objective-c.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/objective-c.test.ts → src/objective-c/objective-c.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('objective-c', [
 	// Keywords

+ 0 - 0
src/objective-c.ts → src/objective-c/objective-c.ts


+ 17 - 0
src/pgsql/pgsql.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/pgsql.test.ts → src/pgsql/pgsql.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('sql', [
 	// Comments

+ 0 - 0
src/pgsql.ts → src/pgsql/pgsql.ts


+ 18 - 0
src/php/php.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/php.test.ts → src/php/php.test.ts

@@ -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)

+ 0 - 0
src/php.ts → src/php/php.ts


+ 17 - 0
src/postiats/postiats.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/postiats.test.ts → src/postiats/postiats.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('postiats', [
 	// Keywords

+ 0 - 0
src/postiats.ts → src/postiats/postiats.ts


+ 17 - 0
src/powershell/powershell.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/powershell.test.ts → src/powershell/powershell.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('powershell', [
 	// Comments - single line

+ 0 - 0
src/powershell.ts → src/powershell/powershell.ts


+ 17 - 0
src/pug/pug.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/pug.test.ts → src/pug/pug.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('pug', [
 	// Tags [Pug]

+ 0 - 0
src/pug.ts → src/pug/pug.ts


+ 18 - 0
src/python/python.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/python.test.ts → src/python/python.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('python', [
 	// Keywords

+ 0 - 0
src/python.ts → src/python/python.ts


+ 17 - 0
src/r/r.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/r.test.ts → src/r/r.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('r', [
 	// Keywords

+ 0 - 0
src/r.ts → src/r/r.ts


+ 18 - 0
src/razor/razor.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/razor.test.ts → src/razor/razor.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('razor', [
 

+ 0 - 0
src/razor.ts → src/razor/razor.ts


+ 17 - 0
src/redis/redis.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/redis.test.ts → src/redis/redis.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('redis', [
 

+ 0 - 0
src/redis.ts → src/redis/redis.ts


+ 17 - 0
src/redshift/redshift.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/redshift.test.ts → src/redshift/redshift.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('sql', [
 	// Comments

+ 0 - 0
src/redshift.ts → src/redshift/redshift.ts


+ 18 - 0
src/ruby/ruby.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/ruby.test.ts → src/ruby/ruby.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('ruby', [
 	// Keywords

+ 0 - 0
src/ruby.ts → src/ruby/ruby.ts


+ 17 - 0
src/sb/sb.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/sb.test.ts → src/sb/sb.test.ts

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import { testTokenization } from './testRunner';
+import { testTokenization } from '../test/testRunner';
 
 testTokenization('sb', [
 

+ 0 - 0
src/sb.ts → src/sb/sb.ts


+ 18 - 0
src/scss/scss.contribution.ts

@@ -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'))
+});

+ 1 - 1
src/test/scss.test.ts → src/scss/scss.test.ts

@@ -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 => {

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików