mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Also generate features.ts from the monaco-editor npm module
This commit is contained in:
parent
10a995c595
commit
6a5c30039f
4 changed files with 191 additions and 108 deletions
|
|
@ -7,6 +7,22 @@ const glob = require('glob');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const customFeatureLabels = {
|
||||||
|
'vs/editor/browser/controller/coreCommands': 'coreCommands',
|
||||||
|
'vs/editor/contrib/caretOperations/caretOperations': 'caretOperations',
|
||||||
|
'vs/editor/contrib/caretOperations/transpose': 'transpose',
|
||||||
|
'vs/editor/contrib/colorPicker/colorDetector': 'colorDetector',
|
||||||
|
'vs/editor/contrib/goToDefinition/goToDefinitionCommands': 'goToDefinitionCommands',
|
||||||
|
'vs/editor/contrib/goToDefinition/goToDefinitionMouse': 'goToDefinitionMouse',
|
||||||
|
'vs/editor/contrib/snippet/snippetController2': 'snippets',
|
||||||
|
'vs/editor/standalone/browser/quickOpen/gotoLine': 'gotoLine',
|
||||||
|
'vs/editor/standalone/browser/quickOpen/quickCommand': 'quickCommand',
|
||||||
|
'vs/editor/standalone/browser/quickOpen/quickOutline': 'quickOutline',
|
||||||
|
};
|
||||||
|
|
||||||
|
generateLanguages();
|
||||||
|
generateFeatures();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns { Promise<{ label: string; entry: string; }[]> }
|
* @returns { Promise<{ label: string; entry: string; }[]> }
|
||||||
*/
|
*/
|
||||||
|
|
@ -43,8 +59,8 @@ function readAdvancedLanguages() {
|
||||||
|
|
||||||
resolve(
|
resolve(
|
||||||
files
|
files
|
||||||
.map(file => file.substring('./node_modules/monaco-editor/esm/vs/language/'.length))
|
.map(file => file.substring('./node_modules/monaco-editor/esm/vs/language/'.length))
|
||||||
.map(file => file.substring(0, file.length - '/monaco.contribution.js'.length))
|
.map(file => file.substring(0, file.length - '/monaco.contribution.js'.length))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -85,62 +101,61 @@ function getAdvancedLanguages() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all([getBasicLanguages(), getAdvancedLanguages()]).then(([basicLanguages, advancedLanguages]) => {
|
function generateLanguages() {
|
||||||
basicLanguages.sort(strcmp);
|
return Promise.all([getBasicLanguages(), getAdvancedLanguages()]).then(([basicLanguages, advancedLanguages]) => {
|
||||||
advancedLanguages.sort(strcmp);
|
basicLanguages.sort(strcmp);
|
||||||
|
advancedLanguages.sort(strcmp);
|
||||||
|
|
||||||
let i = 0, len = basicLanguages.length;
|
let i = 0, len = basicLanguages.length;
|
||||||
let j = 0, lenJ = advancedLanguages.length;
|
let j = 0, lenJ = advancedLanguages.length;
|
||||||
let result = [];
|
let result = [];
|
||||||
while (i < len || j < lenJ) {
|
while (i < len || j < lenJ) {
|
||||||
if (i < len && j < lenJ) {
|
if (i < len && j < lenJ) {
|
||||||
if (basicLanguages[i].label === advancedLanguages[j].label) {
|
if (basicLanguages[i].label === advancedLanguages[j].label) {
|
||||||
let entry = [];
|
let entry = [];
|
||||||
entry.push(basicLanguages[i].entry);
|
entry.push(basicLanguages[i].entry);
|
||||||
entry.push(advancedLanguages[j].entry);
|
entry.push(advancedLanguages[j].entry);
|
||||||
result.push({
|
result.push({
|
||||||
label: basicLanguages[i].label,
|
label: basicLanguages[i].label,
|
||||||
entry: entry,
|
entry: entry,
|
||||||
worker: advancedLanguages[j].worker
|
worker: advancedLanguages[j].worker
|
||||||
});
|
});
|
||||||
i++;
|
i++;
|
||||||
j++;
|
j++;
|
||||||
} else if (basicLanguages[i].label < advancedLanguages[j].label) {
|
} else if (basicLanguages[i].label < advancedLanguages[j].label) {
|
||||||
|
result.push(basicLanguages[i]);
|
||||||
|
i++;
|
||||||
|
} else {
|
||||||
|
result.push(advancedLanguages[j]);
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
} else if (i < len) {
|
||||||
result.push(basicLanguages[i]);
|
result.push(basicLanguages[i]);
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
result.push(advancedLanguages[j]);
|
result.push(advancedLanguages[j]);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
} else if (i < len) {
|
|
||||||
result.push(basicLanguages[i]);
|
|
||||||
i++;
|
|
||||||
} else {
|
|
||||||
result.push(advancedLanguages[j]);
|
|
||||||
j++;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const code = `//
|
const code = `//
|
||||||
// THIS IS A GENERATED FILE. PLEASE DO NOT EDIT DIRECTLY.
|
// THIS IS A GENERATED FILE. PLEASE DO NOT EDIT DIRECTLY.
|
||||||
// node scripts/import-editor.js
|
// GENERATED USING node scripts/import-editor.js
|
||||||
//
|
//
|
||||||
import { IFeatureDefinition } from "./types";
|
import { IFeatureDefinition } from "./types";
|
||||||
|
|
||||||
const languagesArr: IFeatureDefinition[] = ${
|
export const languagesArr: IFeatureDefinition[] = ${
|
||||||
JSON.stringify(result, null, ' ')
|
JSON.stringify(result, null, ' ')
|
||||||
.replace(/"label":/g, 'label:')
|
.replace(/"label":/g, 'label:')
|
||||||
.replace(/"entry":/g, 'entry:')
|
.replace(/"entry":/g, 'entry:')
|
||||||
.replace(/"worker":/g, 'worker:')
|
.replace(/"worker":/g, 'worker:')
|
||||||
.replace(/"id":/g, 'id:')
|
.replace(/"id":/g, 'id:')
|
||||||
.replace(/"/g, '\'')
|
.replace(/"/g, '\'')
|
||||||
};
|
};
|
||||||
|
|
||||||
export const languagesById: { [language: string]: IFeatureDefinition; } = {};
|
|
||||||
languagesArr.forEach(language => languagesById[language.label] = language);
|
|
||||||
`
|
`
|
||||||
fs.writeFileSync(path.join(__dirname, '../src/languages.ts'), code);
|
fs.writeFileSync(path.join(__dirname, '../src/languages.ts'), code.replace(/\r\n/g, '\n'));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function strcmp(a, b) {
|
function strcmp(a, b) {
|
||||||
if (a < b) {
|
if (a < b) {
|
||||||
|
|
@ -152,7 +167,71 @@ function strcmp(a, b) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// getBasicLanguages().then((basicLanguages) => {
|
/**
|
||||||
// console.log(basicLanguages);
|
* @returns { string[] }
|
||||||
// });
|
*/
|
||||||
// getAdvancedLanguages().then(r => console.log(r));
|
function generateFeatures() {
|
||||||
|
const skipImports = [
|
||||||
|
'vs/editor/browser/widget/codeEditorWidget',
|
||||||
|
'vs/editor/browser/widget/diffEditorWidget',
|
||||||
|
'vs/editor/browser/widget/diffNavigator',
|
||||||
|
'vs/editor/common/standaloneStrings',
|
||||||
|
'vs/editor/contrib/tokenization/tokenization',
|
||||||
|
'vs/editor/editor.all',
|
||||||
|
];
|
||||||
|
|
||||||
|
let features = [];
|
||||||
|
const files = (
|
||||||
|
fs.readFileSync(path.join(__dirname, '../node_modules/monaco-editor/esm/vs/editor/edcore.main.js')).toString()
|
||||||
|
+ fs.readFileSync(path.join(__dirname, '../node_modules/monaco-editor/esm/vs/editor/editor.all.js')).toString()
|
||||||
|
);
|
||||||
|
files.split(/\r\n|\n/).forEach(line => {
|
||||||
|
const m = line.match(/import '([^']+)'/);
|
||||||
|
if (m) {
|
||||||
|
const tmp = path.posix.join('vs/editor', m[1]).replace(/\.js$/, '');
|
||||||
|
if (skipImports.indexOf(tmp) === -1) {
|
||||||
|
features.push(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let result = features.map((feature) => {
|
||||||
|
return {
|
||||||
|
label: customFeatureLabels[feature] || path.basename(path.dirname(feature)),
|
||||||
|
entry: feature
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
result.sort((a, b) => {
|
||||||
|
const labelCmp = strcmp(a.label, b.label);
|
||||||
|
if (labelCmp === 0) {
|
||||||
|
return strcmp(a.entry, b.entry);
|
||||||
|
}
|
||||||
|
return labelCmp;
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let i = 0; i < result.length; i++) {
|
||||||
|
if (i + 1 < result.length && result[i].label === result[i + 1].label) {
|
||||||
|
if (typeof result[i].entry === 'string') {
|
||||||
|
result[i].entry = [result[i].entry];
|
||||||
|
}
|
||||||
|
result[i].entry.push(result[i + 1].entry);
|
||||||
|
result.splice(i + 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const code = `//
|
||||||
|
// THIS IS A GENERATED FILE. PLEASE DO NOT EDIT DIRECTLY.
|
||||||
|
// GENERATED USING node scripts/import-editor.js
|
||||||
|
//
|
||||||
|
import { IFeatureDefinition } from "./types";
|
||||||
|
|
||||||
|
export const featuresArr: IFeatureDefinition[] = ${
|
||||||
|
JSON.stringify(result, null, ' ')
|
||||||
|
.replace(/"label":/g, 'label:')
|
||||||
|
.replace(/"entry":/g, 'entry:')
|
||||||
|
.replace(/"/g, '\'')
|
||||||
|
};
|
||||||
|
`
|
||||||
|
fs.writeFileSync(path.join(__dirname, '../src/features.ts'), code.replace(/\r\n/g, '\n'));
|
||||||
|
}
|
||||||
|
|
|
||||||
107
src/features.ts
107
src/features.ts
|
|
@ -1,174 +1,175 @@
|
||||||
|
//
|
||||||
|
// THIS IS A GENERATED FILE. PLEASE DO NOT EDIT DIRECTLY.
|
||||||
|
// GENERATED USING node scripts/import-editor.js
|
||||||
|
//
|
||||||
import { IFeatureDefinition } from "./types";
|
import { IFeatureDefinition } from "./types";
|
||||||
|
|
||||||
const featuresArr: IFeatureDefinition[] = [
|
export const featuresArr: IFeatureDefinition[] = [
|
||||||
{
|
{
|
||||||
label: 'accessibilityHelp',
|
label: 'accessibilityHelp',
|
||||||
entry: 'vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp',
|
entry: 'vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'bracketMatching',
|
label: 'bracketMatching',
|
||||||
entry: 'vs/editor/contrib/bracketMatching/bracketMatching',
|
entry: 'vs/editor/contrib/bracketMatching/bracketMatching'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'caretOperations',
|
label: 'caretOperations',
|
||||||
entry: 'vs/editor/contrib/caretOperations/caretOperations',
|
entry: 'vs/editor/contrib/caretOperations/caretOperations'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'clipboard',
|
label: 'clipboard',
|
||||||
entry: 'vs/editor/contrib/clipboard/clipboard',
|
entry: 'vs/editor/contrib/clipboard/clipboard'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'codeAction',
|
label: 'codeAction',
|
||||||
entry: 'vs/editor/contrib/codeAction/codeActionContributions',
|
entry: 'vs/editor/contrib/codeAction/codeActionContributions'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'codelens',
|
label: 'codelens',
|
||||||
entry: 'vs/editor/contrib/codelens/codelensController',
|
entry: 'vs/editor/contrib/codelens/codelensController'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'colorDetector',
|
label: 'colorDetector',
|
||||||
entry: 'vs/editor/contrib/colorPicker/colorDetector',
|
entry: 'vs/editor/contrib/colorPicker/colorDetector'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'comment',
|
label: 'comment',
|
||||||
entry: 'vs/editor/contrib/comment/comment',
|
entry: 'vs/editor/contrib/comment/comment'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'contextmenu',
|
label: 'contextmenu',
|
||||||
entry: 'vs/editor/contrib/contextmenu/contextmenu',
|
entry: 'vs/editor/contrib/contextmenu/contextmenu'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'coreCommands',
|
label: 'coreCommands',
|
||||||
entry: 'vs/editor/browser/controller/coreCommands',
|
entry: 'vs/editor/browser/controller/coreCommands'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'cursorUndo',
|
label: 'cursorUndo',
|
||||||
entry: 'vs/editor/contrib/cursorUndo/cursorUndo',
|
entry: 'vs/editor/contrib/cursorUndo/cursorUndo'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'dnd',
|
label: 'dnd',
|
||||||
entry: 'vs/editor/contrib/dnd/dnd',
|
entry: 'vs/editor/contrib/dnd/dnd'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'find',
|
label: 'find',
|
||||||
entry: 'vs/editor/contrib/find/findController',
|
entry: 'vs/editor/contrib/find/findController'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'folding',
|
label: 'folding',
|
||||||
entry: 'vs/editor/contrib/folding/folding',
|
entry: 'vs/editor/contrib/folding/folding'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'fontZoom',
|
label: 'fontZoom',
|
||||||
entry: 'vs/editor/contrib/fontZoom/fontZoom',
|
entry: 'vs/editor/contrib/fontZoom/fontZoom'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'format',
|
label: 'format',
|
||||||
entry: 'vs/editor/contrib/format/formatActions',
|
entry: 'vs/editor/contrib/format/formatActions'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'goToDefinitionCommands',
|
label: 'goToDefinitionCommands',
|
||||||
entry: 'vs/editor/contrib/goToDefinition/goToDefinitionCommands',
|
entry: 'vs/editor/contrib/goToDefinition/goToDefinitionCommands'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'goToDefinitionMouse',
|
label: 'goToDefinitionMouse',
|
||||||
entry: 'vs/editor/contrib/goToDefinition/goToDefinitionMouse',
|
entry: 'vs/editor/contrib/goToDefinition/goToDefinitionMouse'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'gotoError',
|
label: 'gotoError',
|
||||||
entry: 'vs/editor/contrib/gotoError/gotoError',
|
entry: 'vs/editor/contrib/gotoError/gotoError'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'gotoLine',
|
label: 'gotoLine',
|
||||||
entry: 'vs/editor/standalone/browser/quickOpen/gotoLine',
|
entry: 'vs/editor/standalone/browser/quickOpen/gotoLine'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'hover',
|
label: 'hover',
|
||||||
entry: 'vs/editor/contrib/hover/hover',
|
entry: 'vs/editor/contrib/hover/hover'
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'inPlaceReplace',
|
|
||||||
entry: 'vs/editor/contrib/inPlaceReplace/inPlaceReplace',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'inspectTokens',
|
|
||||||
entry: 'vs/editor/standalone/browser/inspectTokens/inspectTokens',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'iPadShowKeyboard',
|
label: 'iPadShowKeyboard',
|
||||||
entry: 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard',
|
entry: 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'inPlaceReplace',
|
||||||
|
entry: 'vs/editor/contrib/inPlaceReplace/inPlaceReplace'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'inspectTokens',
|
||||||
|
entry: 'vs/editor/standalone/browser/inspectTokens/inspectTokens'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'linesOperations',
|
label: 'linesOperations',
|
||||||
entry: 'vs/editor/contrib/linesOperations/linesOperations',
|
entry: 'vs/editor/contrib/linesOperations/linesOperations'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'links',
|
label: 'links',
|
||||||
entry: 'vs/editor/contrib/links/links',
|
entry: 'vs/editor/contrib/links/links'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'multicursor',
|
label: 'multicursor',
|
||||||
entry: 'vs/editor/contrib/multicursor/multicursor',
|
entry: 'vs/editor/contrib/multicursor/multicursor'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'parameterHints',
|
label: 'parameterHints',
|
||||||
entry: 'vs/editor/contrib/parameterHints/parameterHints',
|
entry: 'vs/editor/contrib/parameterHints/parameterHints'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'quickCommand',
|
label: 'quickCommand',
|
||||||
entry: 'vs/editor/standalone/browser/quickOpen/quickCommand',
|
entry: 'vs/editor/standalone/browser/quickOpen/quickCommand'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'quickOutline',
|
label: 'quickOutline',
|
||||||
entry: 'vs/editor/standalone/browser/quickOpen/quickOutline',
|
entry: 'vs/editor/standalone/browser/quickOpen/quickOutline'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'referenceSearch',
|
label: 'referenceSearch',
|
||||||
entry: [
|
entry: [
|
||||||
'vs/editor/contrib/referenceSearch/referenceSearch',
|
'vs/editor/contrib/referenceSearch/referenceSearch',
|
||||||
'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch',
|
'vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch'
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'rename',
|
label: 'rename',
|
||||||
entry: 'vs/editor/contrib/rename/rename',
|
entry: 'vs/editor/contrib/rename/rename'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'smartSelect',
|
label: 'smartSelect',
|
||||||
entry: 'vs/editor/contrib/smartSelect/smartSelect',
|
entry: 'vs/editor/contrib/smartSelect/smartSelect'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'snippets',
|
label: 'snippets',
|
||||||
entry: 'vs/editor/contrib/snippet/snippetController2',
|
entry: 'vs/editor/contrib/snippet/snippetController2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'suggest',
|
label: 'suggest',
|
||||||
entry: 'vs/editor/contrib/suggest/suggestController',
|
entry: 'vs/editor/contrib/suggest/suggestController'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'toggleHighContrast',
|
label: 'toggleHighContrast',
|
||||||
entry: 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast',
|
entry: 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'toggleTabFocusMode',
|
label: 'toggleTabFocusMode',
|
||||||
entry: 'vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode',
|
entry: 'vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'transpose',
|
label: 'transpose',
|
||||||
entry: 'vs/editor/contrib/caretOperations/transpose',
|
entry: 'vs/editor/contrib/caretOperations/transpose'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'wordHighlighter',
|
label: 'wordHighlighter',
|
||||||
entry: 'vs/editor/contrib/wordHighlighter/wordHighlighter',
|
entry: 'vs/editor/contrib/wordHighlighter/wordHighlighter'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'wordOperations',
|
label: 'wordOperations',
|
||||||
entry: 'vs/editor/contrib/wordOperations/wordOperations',
|
entry: 'vs/editor/contrib/wordOperations/wordOperations'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'wordPartOperations',
|
label: 'wordPartOperations',
|
||||||
entry: 'vs/editor/contrib/wordPartOperations/wordPartOperations',
|
entry: 'vs/editor/contrib/wordPartOperations/wordPartOperations'
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const featuresById: { [feature: string]: IFeatureDefinition; } = {};
|
|
||||||
featuresArr.forEach(feature => featuresById[feature.label] = feature);
|
|
||||||
|
|
|
||||||
10
src/index.ts
10
src/index.ts
|
|
@ -3,8 +3,8 @@ import * as webpack from 'webpack';
|
||||||
import * as loaderUtils from 'loader-utils';
|
import * as loaderUtils from 'loader-utils';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { AddWorkerEntryPointPlugin } from './plugins/AddWorkerEntryPointPlugin';
|
import { AddWorkerEntryPointPlugin } from './plugins/AddWorkerEntryPointPlugin';
|
||||||
import { languagesById } from './languages';
|
import { languagesArr } from './languages';
|
||||||
import { featuresById } from './features';
|
import { featuresArr } from './features';
|
||||||
import { IFeatureDefinition } from './types';
|
import { IFeatureDefinition } from './types';
|
||||||
|
|
||||||
const INCLUDE_LOADER_PATH = require.resolve('./loaders/include');
|
const INCLUDE_LOADER_PATH = require.resolve('./loaders/include');
|
||||||
|
|
@ -18,6 +18,12 @@ const EDITOR_MODULE: IFeatureDefinition = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const languagesById: { [language: string]: IFeatureDefinition; } = {};
|
||||||
|
languagesArr.forEach(language => languagesById[language.label] = language);
|
||||||
|
|
||||||
|
const featuresById: { [feature: string]: IFeatureDefinition; } = {};
|
||||||
|
featuresArr.forEach(feature => featuresById[feature.label] = feature);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a resolved path for a given Monaco file.
|
* Return a resolved path for a given Monaco file.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
//
|
//
|
||||||
// THIS IS A GENERATED FILE. PLEASE DO NOT EDIT DIRECTLY.
|
// THIS IS A GENERATED FILE. PLEASE DO NOT EDIT DIRECTLY.
|
||||||
// node scripts/import-editor.js
|
// GENERATED USING node scripts/import-editor.js
|
||||||
//
|
//
|
||||||
import { IFeatureDefinition } from "./types";
|
import { IFeatureDefinition } from "./types";
|
||||||
|
|
||||||
const languagesArr: IFeatureDefinition[] = [
|
export const languagesArr: IFeatureDefinition[] = [
|
||||||
{
|
{
|
||||||
label: 'abap',
|
label: 'abap',
|
||||||
entry: 'vs/basic-languages/abap/abap.contribution'
|
entry: 'vs/basic-languages/abap/abap.contribution'
|
||||||
|
|
@ -267,6 +267,3 @@ const languagesArr: IFeatureDefinition[] = [
|
||||||
entry: 'vs/basic-languages/yaml/yaml.contribution'
|
entry: 'vs/basic-languages/yaml/yaml.contribution'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const languagesById: { [language: string]: IFeatureDefinition; } = {};
|
|
||||||
languagesArr.forEach(language => languagesById[language.label] = language);
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue