mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
More native promises
This commit is contained in:
parent
35c57b5990
commit
3c3465db29
2 changed files with 2 additions and 6 deletions
|
|
@ -6,14 +6,10 @@
|
||||||
|
|
||||||
import { registerLanguage } from '../_.contribution';
|
import { registerLanguage } from '../_.contribution';
|
||||||
|
|
||||||
// Allow for running under nodejs/requirejs in tests
|
|
||||||
const _monaco: typeof monaco =
|
|
||||||
typeof monaco === 'undefined' ? (<any>self).monaco : monaco;
|
|
||||||
|
|
||||||
registerLanguage({
|
registerLanguage({
|
||||||
id: 'graphql',
|
id: 'graphql',
|
||||||
extensions: ['.graphql', '.gql'],
|
extensions: ['.graphql', '.gql'],
|
||||||
aliases: ['GraphQL', 'graphql', 'gql'],
|
aliases: ['GraphQL', 'graphql', 'gql'],
|
||||||
mimetypes: ['application/graphql'],
|
mimetypes: ['application/graphql'],
|
||||||
loader: () => _monaco.Promise.wrap(import('./graphql')),
|
loader: () => import('./graphql')
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export function testTokenization(_language:string|string[], tests:ITestItem[][])
|
||||||
let mainLanguage = languages[0];
|
let mainLanguage = languages[0];
|
||||||
suite(mainLanguage + ' tokenization', () => {
|
suite(mainLanguage + ' tokenization', () => {
|
||||||
test('', (done) => {
|
test('', (done) => {
|
||||||
_monaco.Promise.join(languages.map(l => loadLanguage(l))).then(() => {
|
Promise.all(languages.map(l => loadLanguage(l))).then(() => {
|
||||||
// clean stack
|
// clean stack
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
runTests(mainLanguage, tests);
|
runTests(mainLanguage, tests);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue