mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -4,50 +4,17 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fs = require("fs");
|
||||
var ts = require("typescript");
|
||||
var path = require("path");
|
||||
var tsfmt = require('../../tsfmt.json');
|
||||
var util = require('gulp-util');
|
||||
function log(message) {
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
util.log.apply(util, [util.colors.cyan('[monaco.d.ts]'), message].concat(rest));
|
||||
}
|
||||
var SRC = path.join(__dirname, '../../src');
|
||||
var OUT_ROOT = path.join(__dirname, '../../');
|
||||
var RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||
var DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||
var CURRENT_PROCESSING_RULE = '';
|
||||
function logErr(message) {
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
util.log(util.colors.red('[monaco.d.ts]'), 'WHILE HANDLING RULE: ', CURRENT_PROCESSING_RULE);
|
||||
util.log.apply(util, [util.colors.red('[monaco.d.ts]'), message].concat(rest));
|
||||
}
|
||||
function moduleIdToPath(out, moduleId) {
|
||||
if (/\.d\.ts/.test(moduleId)) {
|
||||
return path.join(SRC, moduleId);
|
||||
}
|
||||
return path.join(OUT_ROOT, out, moduleId) + '.d.ts';
|
||||
}
|
||||
var SOURCE_FILE_MAP = {};
|
||||
function getSourceFile(out, inputFiles, moduleId) {
|
||||
if (!SOURCE_FILE_MAP[moduleId]) {
|
||||
var filePath = path.normalize(moduleIdToPath(out, moduleId));
|
||||
if (!inputFiles.hasOwnProperty(filePath)) {
|
||||
logErr('CANNOT FIND FILE ' + filePath + '. YOU MIGHT NEED TO RESTART gulp');
|
||||
return null;
|
||||
}
|
||||
var fileContents = inputFiles[filePath];
|
||||
var sourceFile = ts.createSourceFile(filePath, fileContents, ts.ScriptTarget.ES5);
|
||||
SOURCE_FILE_MAP[moduleId] = sourceFile;
|
||||
}
|
||||
return SOURCE_FILE_MAP[moduleId];
|
||||
const fs = require("fs");
|
||||
const ts = require("typescript");
|
||||
const path = require("path");
|
||||
const util = require("gulp-util");
|
||||
const dtsv = '2';
|
||||
const tsfmt = require('../../tsfmt.json');
|
||||
const SRC = path.join(__dirname, '../../src');
|
||||
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||
function logErr(message, ...rest) {
|
||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||
}
|
||||
function isDeclaration(a) {
|
||||
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
||||
@@ -58,8 +25,8 @@ function isDeclaration(a) {
|
||||
|| a.kind === ts.SyntaxKind.ModuleDeclaration);
|
||||
}
|
||||
function visitTopLevelDeclarations(sourceFile, visitor) {
|
||||
var stop = false;
|
||||
var visit = function (node) {
|
||||
let stop = false;
|
||||
let visit = (node) => {
|
||||
if (stop) {
|
||||
return;
|
||||
}
|
||||
@@ -73,12 +40,6 @@ function visitTopLevelDeclarations(sourceFile, visitor) {
|
||||
case ts.SyntaxKind.ModuleDeclaration:
|
||||
stop = visitor(node);
|
||||
}
|
||||
// if (node.kind !== ts.SyntaxKind.SourceFile) {
|
||||
// if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) {
|
||||
// console.log('FOUND TEXT IN NODE: ' + ts.SyntaxKind[node.kind]);
|
||||
// console.log(getNodeText(sourceFile, node));
|
||||
// }
|
||||
// }
|
||||
if (stop) {
|
||||
return;
|
||||
}
|
||||
@@ -87,23 +48,19 @@ function visitTopLevelDeclarations(sourceFile, visitor) {
|
||||
visit(sourceFile);
|
||||
}
|
||||
function getAllTopLevelDeclarations(sourceFile) {
|
||||
var all = [];
|
||||
visitTopLevelDeclarations(sourceFile, function (node) {
|
||||
let all = [];
|
||||
visitTopLevelDeclarations(sourceFile, (node) => {
|
||||
if (node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.ModuleDeclaration) {
|
||||
var interfaceDeclaration = node;
|
||||
var triviaStart = interfaceDeclaration.pos;
|
||||
var triviaEnd = interfaceDeclaration.name.pos;
|
||||
var triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd });
|
||||
// // let nodeText = getNodeText(sourceFile, node);
|
||||
// if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) {
|
||||
// console.log('TRIVIA: ', triviaText);
|
||||
// }
|
||||
let interfaceDeclaration = node;
|
||||
let triviaStart = interfaceDeclaration.pos;
|
||||
let triviaEnd = interfaceDeclaration.name.pos;
|
||||
let triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd });
|
||||
if (triviaText.indexOf('@internal') === -1) {
|
||||
all.push(node);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var nodeText = getNodeText(sourceFile, node);
|
||||
let nodeText = getNodeText(sourceFile, node);
|
||||
if (nodeText.indexOf('@internal') === -1) {
|
||||
all.push(node);
|
||||
}
|
||||
@@ -113,9 +70,9 @@ function getAllTopLevelDeclarations(sourceFile) {
|
||||
return all;
|
||||
}
|
||||
function getTopLevelDeclaration(sourceFile, typeName) {
|
||||
var result = null;
|
||||
visitTopLevelDeclarations(sourceFile, function (node) {
|
||||
if (isDeclaration(node)) {
|
||||
let result = null;
|
||||
visitTopLevelDeclarations(sourceFile, (node) => {
|
||||
if (isDeclaration(node) && node.name) {
|
||||
if (node.name.text === typeName) {
|
||||
result = node;
|
||||
return true /*stop*/;
|
||||
@@ -136,8 +93,8 @@ function getNodeText(sourceFile, node) {
|
||||
}
|
||||
function hasModifier(modifiers, kind) {
|
||||
if (modifiers) {
|
||||
for (var i = 0; i < modifiers.length; i++) {
|
||||
var mod = modifiers[i];
|
||||
for (let i = 0; i < modifiers.length; i++) {
|
||||
let mod = modifiers[i];
|
||||
if (mod.kind === kind) {
|
||||
return true;
|
||||
}
|
||||
@@ -152,42 +109,36 @@ function isDefaultExport(declaration) {
|
||||
return (hasModifier(declaration.modifiers, ts.SyntaxKind.DefaultKeyword)
|
||||
&& hasModifier(declaration.modifiers, ts.SyntaxKind.ExportKeyword));
|
||||
}
|
||||
function getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage) {
|
||||
var result = getNodeText(sourceFile, declaration);
|
||||
// if (result.indexOf('MonacoWorker') >= 0) {
|
||||
// console.log('here!');
|
||||
// // console.log(ts.SyntaxKind[declaration.kind]);
|
||||
// }
|
||||
function getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage, enums) {
|
||||
let result = getNodeText(sourceFile, declaration);
|
||||
if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) {
|
||||
var interfaceDeclaration = declaration;
|
||||
var staticTypeName_1 = (isDefaultExport(interfaceDeclaration)
|
||||
? importName + ".default"
|
||||
: importName + "." + declaration.name.text);
|
||||
var instanceTypeName_1 = staticTypeName_1;
|
||||
var typeParametersCnt = (interfaceDeclaration.typeParameters ? interfaceDeclaration.typeParameters.length : 0);
|
||||
let interfaceDeclaration = declaration;
|
||||
const staticTypeName = (isDefaultExport(interfaceDeclaration)
|
||||
? `${importName}.default`
|
||||
: `${importName}.${declaration.name.text}`);
|
||||
let instanceTypeName = staticTypeName;
|
||||
const typeParametersCnt = (interfaceDeclaration.typeParameters ? interfaceDeclaration.typeParameters.length : 0);
|
||||
if (typeParametersCnt > 0) {
|
||||
var arr = [];
|
||||
for (var i = 0; i < typeParametersCnt; i++) {
|
||||
let arr = [];
|
||||
for (let i = 0; i < typeParametersCnt; i++) {
|
||||
arr.push('any');
|
||||
}
|
||||
instanceTypeName_1 = instanceTypeName_1 + "<" + arr.join(',') + ">";
|
||||
instanceTypeName = `${instanceTypeName}<${arr.join(',')}>`;
|
||||
}
|
||||
var members = interfaceDeclaration.members;
|
||||
members.forEach(function (member) {
|
||||
const members = interfaceDeclaration.members;
|
||||
members.forEach((member) => {
|
||||
try {
|
||||
var memberText = getNodeText(sourceFile, member);
|
||||
let memberText = getNodeText(sourceFile, member);
|
||||
if (memberText.indexOf('@internal') >= 0 || memberText.indexOf('private') >= 0) {
|
||||
// console.log('BEFORE: ', result);
|
||||
result = result.replace(memberText, '');
|
||||
// console.log('AFTER: ', result);
|
||||
}
|
||||
else {
|
||||
var memberName = member.name.text;
|
||||
const memberName = member.name.text;
|
||||
if (isStatic(member)) {
|
||||
usage.push("a = " + staticTypeName_1 + "." + memberName + ";");
|
||||
usage.push(`a = ${staticTypeName}.${memberName};`);
|
||||
}
|
||||
else {
|
||||
usage.push("a = (<" + instanceTypeName_1 + ">b)." + memberName + ";");
|
||||
usage.push(`a = (<${instanceTypeName}>b).${memberName};`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,15 +149,115 @@ function getMassagedTopLevelDeclarationText(sourceFile, declaration, importName,
|
||||
}
|
||||
result = result.replace(/export default/g, 'export');
|
||||
result = result.replace(/export declare/g, 'export');
|
||||
if (declaration.kind === ts.SyntaxKind.EnumDeclaration) {
|
||||
result = result.replace(/const enum/, 'enum');
|
||||
enums.push(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function format(text) {
|
||||
function format(text, endl) {
|
||||
const REALLY_FORMAT = false;
|
||||
text = preformat(text, endl);
|
||||
if (!REALLY_FORMAT) {
|
||||
return text;
|
||||
}
|
||||
// Parse the source text
|
||||
var sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true);
|
||||
let sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true);
|
||||
// Get the formatting edits on the input sources
|
||||
var edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt);
|
||||
let edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt);
|
||||
// Apply the edits on the input code
|
||||
return applyEdits(text, edits);
|
||||
function countParensCurly(text) {
|
||||
let cnt = 0;
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
if (text.charAt(i) === '(' || text.charAt(i) === '{') {
|
||||
cnt++;
|
||||
}
|
||||
if (text.charAt(i) === ')' || text.charAt(i) === '}') {
|
||||
cnt--;
|
||||
}
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
function repeatStr(s, cnt) {
|
||||
let r = '';
|
||||
for (let i = 0; i < cnt; i++) {
|
||||
r += s;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
function preformat(text, endl) {
|
||||
let lines = text.split(endl);
|
||||
let inComment = false;
|
||||
let inCommentDeltaIndent = 0;
|
||||
let indent = 0;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i].replace(/\s$/, '');
|
||||
let repeat = false;
|
||||
let lineIndent = 0;
|
||||
do {
|
||||
repeat = false;
|
||||
if (line.substring(0, 4) === ' ') {
|
||||
line = line.substring(4);
|
||||
lineIndent++;
|
||||
repeat = true;
|
||||
}
|
||||
if (line.charAt(0) === '\t') {
|
||||
line = line.substring(1);
|
||||
lineIndent++;
|
||||
repeat = true;
|
||||
}
|
||||
} while (repeat);
|
||||
if (line.length === 0) {
|
||||
continue;
|
||||
}
|
||||
if (inComment) {
|
||||
if (/\*\//.test(line)) {
|
||||
inComment = false;
|
||||
}
|
||||
lines[i] = repeatStr('\t', lineIndent + inCommentDeltaIndent) + line;
|
||||
continue;
|
||||
}
|
||||
if (/\/\*/.test(line)) {
|
||||
inComment = true;
|
||||
inCommentDeltaIndent = indent - lineIndent;
|
||||
lines[i] = repeatStr('\t', indent) + line;
|
||||
continue;
|
||||
}
|
||||
const cnt = countParensCurly(line);
|
||||
let shouldUnindentAfter = false;
|
||||
let shouldUnindentBefore = false;
|
||||
if (cnt < 0) {
|
||||
if (/[({]/.test(line)) {
|
||||
shouldUnindentAfter = true;
|
||||
}
|
||||
else {
|
||||
shouldUnindentBefore = true;
|
||||
}
|
||||
}
|
||||
else if (cnt === 0) {
|
||||
shouldUnindentBefore = /^\}/.test(line);
|
||||
}
|
||||
let shouldIndentAfter = false;
|
||||
if (cnt > 0) {
|
||||
shouldIndentAfter = true;
|
||||
}
|
||||
else if (cnt === 0) {
|
||||
shouldIndentAfter = /{$/.test(line);
|
||||
}
|
||||
if (shouldUnindentBefore) {
|
||||
indent--;
|
||||
}
|
||||
lines[i] = repeatStr('\t', indent) + line;
|
||||
if (shouldUnindentAfter) {
|
||||
indent--;
|
||||
}
|
||||
if (shouldIndentAfter) {
|
||||
indent++;
|
||||
}
|
||||
}
|
||||
return lines.join(endl);
|
||||
}
|
||||
function getRuleProvider(options) {
|
||||
// Share this between multiple formatters using the same options.
|
||||
// This represents the bulk of the space the formatter uses.
|
||||
@@ -214,11 +265,11 @@ function format(text) {
|
||||
}
|
||||
function applyEdits(text, edits) {
|
||||
// Apply edits in reverse on the existing text
|
||||
var result = text;
|
||||
for (var i = edits.length - 1; i >= 0; i--) {
|
||||
var change = edits[i];
|
||||
var head = result.slice(0, change.span.start);
|
||||
var tail = result.slice(change.span.start + change.span.length);
|
||||
let result = text;
|
||||
for (let i = edits.length - 1; i >= 0; i--) {
|
||||
let change = edits[i];
|
||||
let head = result.slice(0, change.span.start);
|
||||
let tail = result.slice(change.span.start + change.span.length);
|
||||
result = head + change.newText + tail;
|
||||
}
|
||||
return result;
|
||||
@@ -226,186 +277,254 @@ function format(text) {
|
||||
}
|
||||
function createReplacer(data) {
|
||||
data = data || '';
|
||||
var rawDirectives = data.split(';');
|
||||
var directives = [];
|
||||
rawDirectives.forEach(function (rawDirective) {
|
||||
let rawDirectives = data.split(';');
|
||||
let directives = [];
|
||||
rawDirectives.forEach((rawDirective) => {
|
||||
if (rawDirective.length === 0) {
|
||||
return;
|
||||
}
|
||||
var pieces = rawDirective.split('=>');
|
||||
var findStr = pieces[0];
|
||||
var replaceStr = pieces[1];
|
||||
let pieces = rawDirective.split('=>');
|
||||
let findStr = pieces[0];
|
||||
let replaceStr = pieces[1];
|
||||
findStr = findStr.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&');
|
||||
findStr = '\\b' + findStr + '\\b';
|
||||
directives.push([new RegExp(findStr, 'g'), replaceStr]);
|
||||
});
|
||||
return function (str) {
|
||||
for (var i = 0; i < directives.length; i++) {
|
||||
return (str) => {
|
||||
for (let i = 0; i < directives.length; i++) {
|
||||
str = str.replace(directives[i][0], directives[i][1]);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
}
|
||||
function generateDeclarationFile(out, inputFiles, recipe) {
|
||||
var endl = /\r\n/.test(recipe) ? '\r\n' : '\n';
|
||||
var lines = recipe.split(endl);
|
||||
var result = [];
|
||||
var usageCounter = 0;
|
||||
var usageImports = [];
|
||||
var usage = [];
|
||||
usage.push("var a;");
|
||||
usage.push("var b;");
|
||||
var generateUsageImport = function (moduleId) {
|
||||
var importName = 'm' + (++usageCounter);
|
||||
usageImports.push("import * as " + importName + " from '" + moduleId.replace(/\.d\.ts$/, '') + "';");
|
||||
function generateDeclarationFile(recipe, sourceFileGetter) {
|
||||
const endl = /\r\n/.test(recipe) ? '\r\n' : '\n';
|
||||
let lines = recipe.split(endl);
|
||||
let result = [];
|
||||
let usageCounter = 0;
|
||||
let usageImports = [];
|
||||
let usage = [];
|
||||
let failed = false;
|
||||
usage.push(`var a;`);
|
||||
usage.push(`var b;`);
|
||||
const generateUsageImport = (moduleId) => {
|
||||
let importName = 'm' + (++usageCounter);
|
||||
usageImports.push(`import * as ${importName} from './${moduleId.replace(/\.d\.ts$/, '')}';`);
|
||||
return importName;
|
||||
};
|
||||
lines.forEach(function (line) {
|
||||
var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
let enums = [];
|
||||
let version = null;
|
||||
lines.forEach(line => {
|
||||
if (failed) {
|
||||
return;
|
||||
}
|
||||
let m0 = line.match(/^\/\/dtsv=(\d+)$/);
|
||||
if (m0) {
|
||||
version = m0[1];
|
||||
}
|
||||
let m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m1) {
|
||||
CURRENT_PROCESSING_RULE = line;
|
||||
var moduleId = m1[1];
|
||||
var sourceFile_1 = getSourceFile(out, inputFiles, moduleId);
|
||||
if (!sourceFile_1) {
|
||||
let moduleId = m1[1];
|
||||
const sourceFile = sourceFileGetter(moduleId);
|
||||
if (!sourceFile) {
|
||||
logErr(`While handling ${line}`);
|
||||
logErr(`Cannot find ${moduleId}`);
|
||||
failed = true;
|
||||
return;
|
||||
}
|
||||
var importName_1 = generateUsageImport(moduleId);
|
||||
var replacer_1 = createReplacer(m1[2]);
|
||||
var typeNames = m1[3].split(/,/);
|
||||
typeNames.forEach(function (typeName) {
|
||||
const importName = generateUsageImport(moduleId);
|
||||
let replacer = createReplacer(m1[2]);
|
||||
let typeNames = m1[3].split(/,/);
|
||||
typeNames.forEach((typeName) => {
|
||||
typeName = typeName.trim();
|
||||
if (typeName.length === 0) {
|
||||
return;
|
||||
}
|
||||
var declaration = getTopLevelDeclaration(sourceFile_1, typeName);
|
||||
let declaration = getTopLevelDeclaration(sourceFile, typeName);
|
||||
if (!declaration) {
|
||||
logErr('Cannot find type ' + typeName);
|
||||
logErr(`While handling ${line}`);
|
||||
logErr(`Cannot find ${typeName}`);
|
||||
failed = true;
|
||||
return;
|
||||
}
|
||||
result.push(replacer_1(getMassagedTopLevelDeclarationText(sourceFile_1, declaration, importName_1, usage)));
|
||||
result.push(replacer(getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage, enums)));
|
||||
});
|
||||
return;
|
||||
}
|
||||
var m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
let m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m2) {
|
||||
CURRENT_PROCESSING_RULE = line;
|
||||
var moduleId = m2[1];
|
||||
var sourceFile_2 = getSourceFile(out, inputFiles, moduleId);
|
||||
if (!sourceFile_2) {
|
||||
let moduleId = m2[1];
|
||||
const sourceFile = sourceFileGetter(moduleId);
|
||||
if (!sourceFile) {
|
||||
logErr(`While handling ${line}`);
|
||||
logErr(`Cannot find ${moduleId}`);
|
||||
failed = true;
|
||||
return;
|
||||
}
|
||||
var importName_2 = generateUsageImport(moduleId);
|
||||
var replacer_2 = createReplacer(m2[2]);
|
||||
var typeNames = m2[3].split(/,/);
|
||||
var typesToExcludeMap_1 = {};
|
||||
var typesToExcludeArr_1 = [];
|
||||
typeNames.forEach(function (typeName) {
|
||||
const importName = generateUsageImport(moduleId);
|
||||
let replacer = createReplacer(m2[2]);
|
||||
let typeNames = m2[3].split(/,/);
|
||||
let typesToExcludeMap = {};
|
||||
let typesToExcludeArr = [];
|
||||
typeNames.forEach((typeName) => {
|
||||
typeName = typeName.trim();
|
||||
if (typeName.length === 0) {
|
||||
return;
|
||||
}
|
||||
typesToExcludeMap_1[typeName] = true;
|
||||
typesToExcludeArr_1.push(typeName);
|
||||
typesToExcludeMap[typeName] = true;
|
||||
typesToExcludeArr.push(typeName);
|
||||
});
|
||||
getAllTopLevelDeclarations(sourceFile_2).forEach(function (declaration) {
|
||||
if (isDeclaration(declaration)) {
|
||||
if (typesToExcludeMap_1[declaration.name.text]) {
|
||||
getAllTopLevelDeclarations(sourceFile).forEach((declaration) => {
|
||||
if (isDeclaration(declaration) && declaration.name) {
|
||||
if (typesToExcludeMap[declaration.name.text]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// node is ts.VariableStatement
|
||||
var nodeText = getNodeText(sourceFile_2, declaration);
|
||||
for (var i = 0; i < typesToExcludeArr_1.length; i++) {
|
||||
if (nodeText.indexOf(typesToExcludeArr_1[i]) >= 0) {
|
||||
let nodeText = getNodeText(sourceFile, declaration);
|
||||
for (let i = 0; i < typesToExcludeArr.length; i++) {
|
||||
if (nodeText.indexOf(typesToExcludeArr[i]) >= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
result.push(replacer_2(getMassagedTopLevelDeclarationText(sourceFile_2, declaration, importName_2, usage)));
|
||||
result.push(replacer(getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage, enums)));
|
||||
});
|
||||
return;
|
||||
}
|
||||
result.push(line);
|
||||
});
|
||||
var resultTxt = result.join(endl);
|
||||
if (failed) {
|
||||
return null;
|
||||
}
|
||||
if (version !== dtsv) {
|
||||
if (!version) {
|
||||
logErr(`gulp watch restart required. 'monaco.d.ts.recipe' is written before versioning was introduced.`);
|
||||
}
|
||||
else {
|
||||
logErr(`gulp watch restart required. 'monaco.d.ts.recipe' v${version} does not match runtime v${dtsv}.`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
let resultTxt = result.join(endl);
|
||||
resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri');
|
||||
resultTxt = resultTxt.replace(/\bEvent</g, 'IEvent<');
|
||||
resultTxt = resultTxt.replace(/\bTPromise</g, 'Promise<');
|
||||
resultTxt = format(resultTxt);
|
||||
return [
|
||||
resultTxt,
|
||||
usageImports.join('\n') + "\n\n" + usage.join('\n')
|
||||
];
|
||||
resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl);
|
||||
resultTxt = format(resultTxt, endl);
|
||||
resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl);
|
||||
let resultEnums = [
|
||||
'/*---------------------------------------------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
' * Licensed under the Source EULA. See License.txt in the project root for license information.',
|
||||
' *--------------------------------------------------------------------------------------------*/',
|
||||
'',
|
||||
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
|
||||
''
|
||||
].concat(enums).join(endl);
|
||||
resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl);
|
||||
resultEnums = format(resultEnums, endl);
|
||||
resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl);
|
||||
return {
|
||||
result: resultTxt,
|
||||
usageContent: `${usageImports.join('\n')}\n\n${usage.join('\n')}`,
|
||||
enums: resultEnums
|
||||
};
|
||||
}
|
||||
function getIncludesInRecipe() {
|
||||
var recipe = fs.readFileSync(RECIPE_PATH).toString();
|
||||
var lines = recipe.split(/\r\n|\n|\r/);
|
||||
var result = [];
|
||||
lines.forEach(function (line) {
|
||||
var m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m1) {
|
||||
var moduleId = m1[1];
|
||||
result.push(moduleId);
|
||||
return;
|
||||
}
|
||||
var m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m2) {
|
||||
var moduleId = m2[1];
|
||||
result.push(moduleId);
|
||||
return;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function getFilesToWatch(out) {
|
||||
return getIncludesInRecipe().map(function (moduleId) { return moduleIdToPath(out, moduleId); });
|
||||
}
|
||||
exports.getFilesToWatch = getFilesToWatch;
|
||||
function run(out, inputFiles) {
|
||||
log('Starting monaco.d.ts generation');
|
||||
SOURCE_FILE_MAP = {};
|
||||
var recipe = fs.readFileSync(RECIPE_PATH).toString();
|
||||
var _a = generateDeclarationFile(out, inputFiles, recipe), result = _a[0], usageContent = _a[1];
|
||||
var currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
||||
log('Finished monaco.d.ts generation');
|
||||
var one = currentContent.replace(/\r\n/gm, '\n');
|
||||
var other = result.replace(/\r\n/gm, '\n');
|
||||
var isTheSame = one === other;
|
||||
function _run(sourceFileGetter) {
|
||||
const recipe = fs.readFileSync(exports.RECIPE_PATH).toString();
|
||||
const t = generateDeclarationFile(recipe, sourceFileGetter);
|
||||
if (!t) {
|
||||
return null;
|
||||
}
|
||||
const result = t.result;
|
||||
const usageContent = t.usageContent;
|
||||
const enums = t.enums;
|
||||
const currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
||||
const one = currentContent.replace(/\r\n/gm, '\n');
|
||||
const other = result.replace(/\r\n/gm, '\n');
|
||||
const isTheSame = (one === other);
|
||||
return {
|
||||
content: result,
|
||||
usageContent: usageContent,
|
||||
enums: enums,
|
||||
filePath: DECLARATION_PATH,
|
||||
isTheSame: isTheSame
|
||||
isTheSame
|
||||
};
|
||||
}
|
||||
exports.run = run;
|
||||
function complainErrors() {
|
||||
logErr('Not running monaco.d.ts generation due to compile errors');
|
||||
class FSProvider {
|
||||
existsSync(filePath) {
|
||||
return fs.existsSync(filePath);
|
||||
}
|
||||
readFileSync(_moduleId, filePath) {
|
||||
return fs.readFileSync(filePath);
|
||||
}
|
||||
}
|
||||
exports.complainErrors = complainErrors;
|
||||
var TypeScriptLanguageServiceHost = /** @class */ (function () {
|
||||
function TypeScriptLanguageServiceHost(libs, files, compilerOptions) {
|
||||
exports.FSProvider = FSProvider;
|
||||
class DeclarationResolver {
|
||||
constructor(_fsProvider) {
|
||||
this._fsProvider = _fsProvider;
|
||||
this._sourceFileCache = Object.create(null);
|
||||
}
|
||||
invalidateCache(moduleId) {
|
||||
this._sourceFileCache[moduleId] = null;
|
||||
}
|
||||
getDeclarationSourceFile(moduleId) {
|
||||
if (!this._sourceFileCache[moduleId]) {
|
||||
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
||||
}
|
||||
return this._sourceFileCache[moduleId];
|
||||
}
|
||||
_getDeclarationSourceFile(moduleId) {
|
||||
if (/\.d\.ts$/.test(moduleId)) {
|
||||
const fileName = path.join(SRC, moduleId);
|
||||
if (!this._fsProvider.existsSync(fileName)) {
|
||||
return null;
|
||||
}
|
||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
|
||||
}
|
||||
const fileName = path.join(SRC, `${moduleId}.ts`);
|
||||
if (!this._fsProvider.existsSync(fileName)) {
|
||||
return null;
|
||||
}
|
||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||
const fileMap = {
|
||||
'file.ts': fileContents
|
||||
};
|
||||
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
||||
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
||||
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5);
|
||||
}
|
||||
}
|
||||
exports.DeclarationResolver = DeclarationResolver;
|
||||
function run3(resolver) {
|
||||
const sourceFileGetter = (moduleId) => resolver.getDeclarationSourceFile(moduleId);
|
||||
return _run(sourceFileGetter);
|
||||
}
|
||||
exports.run3 = run3;
|
||||
class TypeScriptLanguageServiceHost {
|
||||
constructor(libs, files, compilerOptions) {
|
||||
this._libs = libs;
|
||||
this._files = files;
|
||||
this._compilerOptions = compilerOptions;
|
||||
}
|
||||
// --- language service host ---------------
|
||||
TypeScriptLanguageServiceHost.prototype.getCompilationSettings = function () {
|
||||
getCompilationSettings() {
|
||||
return this._compilerOptions;
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getScriptFileNames = function () {
|
||||
}
|
||||
getScriptFileNames() {
|
||||
return ([]
|
||||
.concat(Object.keys(this._libs))
|
||||
.concat(Object.keys(this._files)));
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getScriptVersion = function (fileName) {
|
||||
}
|
||||
getScriptVersion(_fileName) {
|
||||
return '1';
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getProjectVersion = function () {
|
||||
}
|
||||
getProjectVersion() {
|
||||
return '1';
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getScriptSnapshot = function (fileName) {
|
||||
}
|
||||
getScriptSnapshot(fileName) {
|
||||
if (this._files.hasOwnProperty(fileName)) {
|
||||
return ts.ScriptSnapshot.fromString(this._files[fileName]);
|
||||
}
|
||||
@@ -415,47 +534,25 @@ var TypeScriptLanguageServiceHost = /** @class */ (function () {
|
||||
else {
|
||||
return ts.ScriptSnapshot.fromString('');
|
||||
}
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getScriptKind = function (fileName) {
|
||||
}
|
||||
getScriptKind(_fileName) {
|
||||
return ts.ScriptKind.TS;
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getCurrentDirectory = function () {
|
||||
}
|
||||
getCurrentDirectory() {
|
||||
return '';
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.getDefaultLibFileName = function (options) {
|
||||
}
|
||||
getDefaultLibFileName(_options) {
|
||||
return 'defaultLib:es5';
|
||||
};
|
||||
TypeScriptLanguageServiceHost.prototype.isDefaultLibFileName = function (fileName) {
|
||||
}
|
||||
isDefaultLibFileName(fileName) {
|
||||
return fileName === this.getDefaultLibFileName(this._compilerOptions);
|
||||
};
|
||||
return TypeScriptLanguageServiceHost;
|
||||
}());
|
||||
}
|
||||
}
|
||||
function execute() {
|
||||
var OUTPUT_FILES = {};
|
||||
var SRC_FILES = {};
|
||||
var SRC_FILE_TO_EXPECTED_NAME = {};
|
||||
getIncludesInRecipe().forEach(function (moduleId) {
|
||||
if (/\.d\.ts$/.test(moduleId)) {
|
||||
var fileName_1 = path.join(SRC, moduleId);
|
||||
OUTPUT_FILES[moduleIdToPath('src', moduleId)] = fs.readFileSync(fileName_1).toString();
|
||||
return;
|
||||
}
|
||||
var fileName = path.join(SRC, moduleId) + '.ts';
|
||||
SRC_FILES[fileName] = fs.readFileSync(fileName).toString();
|
||||
SRC_FILE_TO_EXPECTED_NAME[fileName] = moduleIdToPath('src', moduleId);
|
||||
});
|
||||
var languageService = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, SRC_FILES, {}));
|
||||
var t1 = Date.now();
|
||||
Object.keys(SRC_FILES).forEach(function (fileName) {
|
||||
var t = Date.now();
|
||||
var emitOutput = languageService.getEmitOutput(fileName, true);
|
||||
OUTPUT_FILES[SRC_FILE_TO_EXPECTED_NAME[fileName]] = emitOutput.outputFiles[0].text;
|
||||
// console.log(`Generating .d.ts for ${fileName} took ${Date.now() - t} ms`);
|
||||
});
|
||||
console.log("Generating .d.ts took " + (Date.now() - t1) + " ms");
|
||||
// console.log(result.filePath);
|
||||
// fs.writeFileSync(result.filePath, result.content.replace(/\r\n/gm, '\n'));
|
||||
// fs.writeFileSync(path.join(SRC, 'user.ts'), result.usageContent.replace(/\r\n/gm, '\n'));
|
||||
return run('src', OUTPUT_FILES);
|
||||
let r = run3(new DeclarationResolver(new FSProvider()));
|
||||
if (!r) {
|
||||
throw new Error(`monaco.d.ts generation error - Cannot continue`);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
exports.execute = execute;
|
||||
|
||||
@@ -3,52 +3,24 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import fs = require('fs');
|
||||
import ts = require('typescript');
|
||||
import path = require('path');
|
||||
import * as fs from 'fs';
|
||||
import * as ts from 'typescript';
|
||||
import * as path from 'path';
|
||||
import * as util from 'gulp-util';
|
||||
|
||||
const dtsv = '2';
|
||||
|
||||
const tsfmt = require('../../tsfmt.json');
|
||||
|
||||
var util = require('gulp-util');
|
||||
function log(message: any, ...rest: any[]): void {
|
||||
util.log(util.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
}
|
||||
|
||||
const SRC = path.join(__dirname, '../../src');
|
||||
const OUT_ROOT = path.join(__dirname, '../../');
|
||||
const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||
export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||
|
||||
var CURRENT_PROCESSING_RULE = '';
|
||||
function logErr(message: any, ...rest: any[]): void {
|
||||
util.log(util.colors.red('[monaco.d.ts]'), 'WHILE HANDLING RULE: ', CURRENT_PROCESSING_RULE);
|
||||
util.log(util.colors.red('[monaco.d.ts]'), message, ...rest);
|
||||
}
|
||||
|
||||
function moduleIdToPath(out: string, moduleId: string): string {
|
||||
if (/\.d\.ts/.test(moduleId)) {
|
||||
return path.join(SRC, moduleId);
|
||||
}
|
||||
return path.join(OUT_ROOT, out, moduleId) + '.d.ts';
|
||||
}
|
||||
|
||||
let SOURCE_FILE_MAP: { [moduleId: string]: ts.SourceFile; } = {};
|
||||
function getSourceFile(out: string, inputFiles: { [file: string]: string; }, moduleId: string): ts.SourceFile {
|
||||
if (!SOURCE_FILE_MAP[moduleId]) {
|
||||
let filePath = path.normalize(moduleIdToPath(out, moduleId));
|
||||
|
||||
if (!inputFiles.hasOwnProperty(filePath)) {
|
||||
logErr('CANNOT FIND FILE ' + filePath + '. YOU MIGHT NEED TO RESTART gulp');
|
||||
return null;
|
||||
}
|
||||
|
||||
let fileContents = inputFiles[filePath];
|
||||
let sourceFile = ts.createSourceFile(filePath, fileContents, ts.ScriptTarget.ES5);
|
||||
|
||||
SOURCE_FILE_MAP[moduleId] = sourceFile;
|
||||
}
|
||||
return SOURCE_FILE_MAP[moduleId];
|
||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||
}
|
||||
|
||||
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
||||
|
||||
type TSTopLevelDeclaration = ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ClassDeclaration | ts.TypeAliasDeclaration | ts.FunctionDeclaration | ts.ModuleDeclaration;
|
||||
type TSTopLevelDeclare = TSTopLevelDeclaration | ts.VariableStatement;
|
||||
@@ -83,13 +55,6 @@ function visitTopLevelDeclarations(sourceFile: ts.SourceFile, visitor: (node: TS
|
||||
stop = visitor(<TSTopLevelDeclare>node);
|
||||
}
|
||||
|
||||
// if (node.kind !== ts.SyntaxKind.SourceFile) {
|
||||
// if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) {
|
||||
// console.log('FOUND TEXT IN NODE: ' + ts.SyntaxKind[node.kind]);
|
||||
// console.log(getNodeText(sourceFile, node));
|
||||
// }
|
||||
// }
|
||||
|
||||
if (stop) {
|
||||
return;
|
||||
}
|
||||
@@ -109,10 +74,6 @@ function getAllTopLevelDeclarations(sourceFile: ts.SourceFile): TSTopLevelDeclar
|
||||
let triviaEnd = interfaceDeclaration.name.pos;
|
||||
let triviaText = getNodeText(sourceFile, { pos: triviaStart, end: triviaEnd });
|
||||
|
||||
// // let nodeText = getNodeText(sourceFile, node);
|
||||
// if (getNodeText(sourceFile, node).indexOf('SymbolKind') >= 0) {
|
||||
// console.log('TRIVIA: ', triviaText);
|
||||
// }
|
||||
if (triviaText.indexOf('@internal') === -1) {
|
||||
all.push(node);
|
||||
}
|
||||
@@ -128,10 +89,10 @@ function getAllTopLevelDeclarations(sourceFile: ts.SourceFile): TSTopLevelDeclar
|
||||
}
|
||||
|
||||
|
||||
function getTopLevelDeclaration(sourceFile: ts.SourceFile, typeName: string): TSTopLevelDeclare {
|
||||
let result: TSTopLevelDeclare = null;
|
||||
function getTopLevelDeclaration(sourceFile: ts.SourceFile, typeName: string): TSTopLevelDeclare | null {
|
||||
let result: TSTopLevelDeclare | null = null;
|
||||
visitTopLevelDeclarations(sourceFile, (node) => {
|
||||
if (isDeclaration(node)) {
|
||||
if (isDeclaration(node) && node.name) {
|
||||
if (node.name.text === typeName) {
|
||||
result = node;
|
||||
return true /*stop*/;
|
||||
@@ -153,7 +114,7 @@ function getNodeText(sourceFile: ts.SourceFile, node: { pos: number; end: number
|
||||
return sourceFile.getFullText().substring(node.pos, node.end);
|
||||
}
|
||||
|
||||
function hasModifier(modifiers: ts.NodeArray<ts.Modifier>, kind: ts.SyntaxKind): boolean {
|
||||
function hasModifier(modifiers: ts.NodeArray<ts.Modifier> | undefined, kind: ts.SyntaxKind): boolean {
|
||||
if (modifiers) {
|
||||
for (let i = 0; i < modifiers.length; i++) {
|
||||
let mod = modifiers[i];
|
||||
@@ -176,19 +137,15 @@ function isDefaultExport(declaration: ts.InterfaceDeclaration | ts.ClassDeclarat
|
||||
);
|
||||
}
|
||||
|
||||
function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declaration: TSTopLevelDeclare, importName: string, usage: string[]): string {
|
||||
function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declaration: TSTopLevelDeclare, importName: string, usage: string[], enums: string[]): string {
|
||||
let result = getNodeText(sourceFile, declaration);
|
||||
// if (result.indexOf('MonacoWorker') >= 0) {
|
||||
// console.log('here!');
|
||||
// // console.log(ts.SyntaxKind[declaration.kind]);
|
||||
// }
|
||||
if (declaration.kind === ts.SyntaxKind.InterfaceDeclaration || declaration.kind === ts.SyntaxKind.ClassDeclaration) {
|
||||
let interfaceDeclaration = <ts.InterfaceDeclaration | ts.ClassDeclaration>declaration;
|
||||
|
||||
const staticTypeName = (
|
||||
isDefaultExport(interfaceDeclaration)
|
||||
? `${importName}.default`
|
||||
: `${importName}.${declaration.name.text}`
|
||||
: `${importName}.${declaration.name!.text}`
|
||||
);
|
||||
|
||||
let instanceTypeName = staticTypeName;
|
||||
@@ -206,9 +163,7 @@ function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declarati
|
||||
try {
|
||||
let memberText = getNodeText(sourceFile, member);
|
||||
if (memberText.indexOf('@internal') >= 0 || memberText.indexOf('private') >= 0) {
|
||||
// console.log('BEFORE: ', result);
|
||||
result = result.replace(memberText, '');
|
||||
// console.log('AFTER: ', result);
|
||||
} else {
|
||||
const memberName = (<ts.Identifier | ts.StringLiteral>member.name).text;
|
||||
if (isStatic(member)) {
|
||||
@@ -224,10 +179,22 @@ function getMassagedTopLevelDeclarationText(sourceFile: ts.SourceFile, declarati
|
||||
}
|
||||
result = result.replace(/export default/g, 'export');
|
||||
result = result.replace(/export declare/g, 'export');
|
||||
|
||||
if (declaration.kind === ts.SyntaxKind.EnumDeclaration) {
|
||||
result = result.replace(/const enum/, 'enum');
|
||||
enums.push(result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function format(text: string): string {
|
||||
function format(text: string, endl: string): string {
|
||||
const REALLY_FORMAT = false;
|
||||
|
||||
text = preformat(text, endl);
|
||||
if (!REALLY_FORMAT) {
|
||||
return text;
|
||||
}
|
||||
|
||||
// Parse the source text
|
||||
let sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true);
|
||||
@@ -238,6 +205,104 @@ function format(text: string): string {
|
||||
// Apply the edits on the input code
|
||||
return applyEdits(text, edits);
|
||||
|
||||
function countParensCurly(text: string): number {
|
||||
let cnt = 0;
|
||||
for (let i = 0; i < text.length; i++) {
|
||||
if (text.charAt(i) === '(' || text.charAt(i) === '{') {
|
||||
cnt++;
|
||||
}
|
||||
if (text.charAt(i) === ')' || text.charAt(i) === '}') {
|
||||
cnt--;
|
||||
}
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
function repeatStr(s: string, cnt: number): string {
|
||||
let r = '';
|
||||
for (let i = 0; i < cnt; i++) {
|
||||
r += s;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
function preformat(text: string, endl: string): string {
|
||||
let lines = text.split(endl);
|
||||
let inComment = false;
|
||||
let inCommentDeltaIndent = 0;
|
||||
let indent = 0;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i].replace(/\s$/, '');
|
||||
let repeat = false;
|
||||
let lineIndent = 0;
|
||||
do {
|
||||
repeat = false;
|
||||
if (line.substring(0, 4) === ' ') {
|
||||
line = line.substring(4);
|
||||
lineIndent++;
|
||||
repeat = true;
|
||||
}
|
||||
if (line.charAt(0) === '\t') {
|
||||
line = line.substring(1);
|
||||
lineIndent++;
|
||||
repeat = true;
|
||||
}
|
||||
} while (repeat);
|
||||
|
||||
if (line.length === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (inComment) {
|
||||
if (/\*\//.test(line)) {
|
||||
inComment = false;
|
||||
}
|
||||
lines[i] = repeatStr('\t', lineIndent + inCommentDeltaIndent) + line;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (/\/\*/.test(line)) {
|
||||
inComment = true;
|
||||
inCommentDeltaIndent = indent - lineIndent;
|
||||
lines[i] = repeatStr('\t', indent) + line;
|
||||
continue;
|
||||
}
|
||||
|
||||
const cnt = countParensCurly(line);
|
||||
let shouldUnindentAfter = false;
|
||||
let shouldUnindentBefore = false;
|
||||
if (cnt < 0) {
|
||||
if (/[({]/.test(line)) {
|
||||
shouldUnindentAfter = true;
|
||||
} else {
|
||||
shouldUnindentBefore = true;
|
||||
}
|
||||
} else if (cnt === 0) {
|
||||
shouldUnindentBefore = /^\}/.test(line);
|
||||
}
|
||||
let shouldIndentAfter = false;
|
||||
if (cnt > 0) {
|
||||
shouldIndentAfter = true;
|
||||
} else if (cnt === 0) {
|
||||
shouldIndentAfter = /{$/.test(line);
|
||||
}
|
||||
|
||||
if (shouldUnindentBefore) {
|
||||
indent--;
|
||||
}
|
||||
|
||||
lines[i] = repeatStr('\t', indent) + line;
|
||||
|
||||
if (shouldUnindentAfter) {
|
||||
indent--;
|
||||
}
|
||||
if (shouldIndentAfter) {
|
||||
indent++;
|
||||
}
|
||||
}
|
||||
return lines.join(endl);
|
||||
}
|
||||
|
||||
function getRuleProvider(options: ts.FormatCodeSettings) {
|
||||
// Share this between multiple formatters using the same options.
|
||||
// This represents the bulk of the space the formatter uses.
|
||||
@@ -282,7 +347,13 @@ function createReplacer(data: string): (str: string) => string {
|
||||
};
|
||||
}
|
||||
|
||||
function generateDeclarationFile(out: string, inputFiles: { [file: string]: string; }, recipe: string): [string, string] {
|
||||
interface ITempResult {
|
||||
result: string;
|
||||
usageContent: string;
|
||||
enums: string;
|
||||
}
|
||||
|
||||
function generateDeclarationFile(recipe: string, sourceFileGetter: SourceFileGetter): ITempResult | null {
|
||||
const endl = /\r\n/.test(recipe) ? '\r\n' : '\n';
|
||||
|
||||
let lines = recipe.split(endl);
|
||||
@@ -292,23 +363,39 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
||||
let usageImports: string[] = [];
|
||||
let usage: string[] = [];
|
||||
|
||||
let failed = false;
|
||||
|
||||
usage.push(`var a;`);
|
||||
usage.push(`var b;`);
|
||||
|
||||
const generateUsageImport = (moduleId: string) => {
|
||||
let importName = 'm' + (++usageCounter);
|
||||
usageImports.push(`import * as ${importName} from '${moduleId.replace(/\.d\.ts$/, '')}';`);
|
||||
usageImports.push(`import * as ${importName} from './${moduleId.replace(/\.d\.ts$/, '')}';`);
|
||||
return importName;
|
||||
};
|
||||
|
||||
let enums: string[] = [];
|
||||
let version: string | null = null;
|
||||
|
||||
lines.forEach(line => {
|
||||
|
||||
if (failed) {
|
||||
return;
|
||||
}
|
||||
|
||||
let m0 = line.match(/^\/\/dtsv=(\d+)$/);
|
||||
if (m0) {
|
||||
version = m0[1];
|
||||
}
|
||||
|
||||
let m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m1) {
|
||||
CURRENT_PROCESSING_RULE = line;
|
||||
let moduleId = m1[1];
|
||||
let sourceFile = getSourceFile(out, inputFiles, moduleId);
|
||||
const sourceFile = sourceFileGetter(moduleId);
|
||||
if (!sourceFile) {
|
||||
logErr(`While handling ${line}`);
|
||||
logErr(`Cannot find ${moduleId}`);
|
||||
failed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -324,20 +411,24 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
||||
}
|
||||
let declaration = getTopLevelDeclaration(sourceFile, typeName);
|
||||
if (!declaration) {
|
||||
logErr('Cannot find type ' + typeName);
|
||||
logErr(`While handling ${line}`);
|
||||
logErr(`Cannot find ${typeName}`);
|
||||
failed = true;
|
||||
return;
|
||||
}
|
||||
result.push(replacer(getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage)));
|
||||
result.push(replacer(getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage, enums)));
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m2) {
|
||||
CURRENT_PROCESSING_RULE = line;
|
||||
let moduleId = m2[1];
|
||||
let sourceFile = getSourceFile(out, inputFiles, moduleId);
|
||||
const sourceFile = sourceFileGetter(moduleId);
|
||||
if (!sourceFile) {
|
||||
logErr(`While handling ${line}`);
|
||||
logErr(`Cannot find ${moduleId}`);
|
||||
failed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -358,7 +449,7 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
||||
});
|
||||
|
||||
getAllTopLevelDeclarations(sourceFile).forEach((declaration) => {
|
||||
if (isDeclaration(declaration)) {
|
||||
if (isDeclaration(declaration) && declaration.name) {
|
||||
if (typesToExcludeMap[declaration.name.text]) {
|
||||
return;
|
||||
}
|
||||
@@ -371,7 +462,7 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
||||
}
|
||||
}
|
||||
}
|
||||
result.push(replacer(getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage)));
|
||||
result.push(replacer(getMassagedTopLevelDeclarationText(sourceFile, declaration, importName, usage, enums)));
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -379,81 +470,136 @@ function generateDeclarationFile(out: string, inputFiles: { [file: string]: stri
|
||||
result.push(line);
|
||||
});
|
||||
|
||||
if (failed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (version !== dtsv) {
|
||||
if (!version) {
|
||||
logErr(`gulp watch restart required. 'monaco.d.ts.recipe' is written before versioning was introduced.`);
|
||||
} else {
|
||||
logErr(`gulp watch restart required. 'monaco.d.ts.recipe' v${version} does not match runtime v${dtsv}.`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
let resultTxt = result.join(endl);
|
||||
resultTxt = resultTxt.replace(/\bURI\b/g, 'Uri');
|
||||
resultTxt = resultTxt.replace(/\bEvent</g, 'IEvent<');
|
||||
resultTxt = resultTxt.replace(/\bTPromise</g, 'Promise<');
|
||||
resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl);
|
||||
resultTxt = format(resultTxt, endl);
|
||||
resultTxt = resultTxt.split(/\r\n|\n|\r/).join(endl);
|
||||
|
||||
resultTxt = format(resultTxt);
|
||||
let resultEnums = [
|
||||
'/*---------------------------------------------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
' * Licensed under the Source EULA. See License.txt in the project root for license information.',
|
||||
' *--------------------------------------------------------------------------------------------*/',
|
||||
'',
|
||||
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
|
||||
''
|
||||
].concat(enums).join(endl);
|
||||
resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl);
|
||||
resultEnums = format(resultEnums, endl);
|
||||
resultEnums = resultEnums.split(/\r\n|\n|\r/).join(endl);
|
||||
|
||||
return [
|
||||
resultTxt,
|
||||
`${usageImports.join('\n')}\n\n${usage.join('\n')}`
|
||||
];
|
||||
}
|
||||
|
||||
function getIncludesInRecipe(): string[] {
|
||||
let recipe = fs.readFileSync(RECIPE_PATH).toString();
|
||||
let lines = recipe.split(/\r\n|\n|\r/);
|
||||
let result = [];
|
||||
|
||||
lines.forEach(line => {
|
||||
|
||||
let m1 = line.match(/^\s*#include\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m1) {
|
||||
let moduleId = m1[1];
|
||||
result.push(moduleId);
|
||||
return;
|
||||
}
|
||||
|
||||
let m2 = line.match(/^\s*#includeAll\(([^;)]*)(;[^)]*)?\)\:(.*)$/);
|
||||
if (m2) {
|
||||
let moduleId = m2[1];
|
||||
result.push(moduleId);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function getFilesToWatch(out: string): string[] {
|
||||
return getIncludesInRecipe().map((moduleId) => moduleIdToPath(out, moduleId));
|
||||
return {
|
||||
result: resultTxt,
|
||||
usageContent: `${usageImports.join('\n')}\n\n${usage.join('\n')}`,
|
||||
enums: resultEnums
|
||||
};
|
||||
}
|
||||
|
||||
export interface IMonacoDeclarationResult {
|
||||
content: string;
|
||||
usageContent: string;
|
||||
enums: string;
|
||||
filePath: string;
|
||||
isTheSame: boolean;
|
||||
}
|
||||
|
||||
export function run(out: string, inputFiles: { [file: string]: string; }): IMonacoDeclarationResult {
|
||||
log('Starting monaco.d.ts generation');
|
||||
SOURCE_FILE_MAP = {};
|
||||
function _run(sourceFileGetter: SourceFileGetter): IMonacoDeclarationResult | null {
|
||||
const recipe = fs.readFileSync(RECIPE_PATH).toString();
|
||||
const t = generateDeclarationFile(recipe, sourceFileGetter);
|
||||
if (!t) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let recipe = fs.readFileSync(RECIPE_PATH).toString();
|
||||
let [result, usageContent] = generateDeclarationFile(out, inputFiles, recipe);
|
||||
|
||||
let currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
||||
log('Finished monaco.d.ts generation');
|
||||
const result = t.result;
|
||||
const usageContent = t.usageContent;
|
||||
const enums = t.enums;
|
||||
|
||||
const currentContent = fs.readFileSync(DECLARATION_PATH).toString();
|
||||
const one = currentContent.replace(/\r\n/gm, '\n');
|
||||
const other = result.replace(/\r\n/gm, '\n');
|
||||
const isTheSame = one === other;
|
||||
const isTheSame = (one === other);
|
||||
|
||||
return {
|
||||
content: result,
|
||||
usageContent: usageContent,
|
||||
enums: enums,
|
||||
filePath: DECLARATION_PATH,
|
||||
isTheSame
|
||||
};
|
||||
}
|
||||
|
||||
export function complainErrors() {
|
||||
logErr('Not running monaco.d.ts generation due to compile errors');
|
||||
export class FSProvider {
|
||||
public existsSync(filePath: string): boolean {
|
||||
return fs.existsSync(filePath);
|
||||
}
|
||||
public readFileSync(_moduleId: string, filePath: string): Buffer {
|
||||
return fs.readFileSync(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
export class DeclarationResolver {
|
||||
|
||||
private _sourceFileCache: { [moduleId: string]: ts.SourceFile | null; };
|
||||
|
||||
constructor(private readonly _fsProvider: FSProvider) {
|
||||
this._sourceFileCache = Object.create(null);
|
||||
}
|
||||
|
||||
public invalidateCache(moduleId: string): void {
|
||||
this._sourceFileCache[moduleId] = null;
|
||||
}
|
||||
|
||||
public getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
||||
if (!this._sourceFileCache[moduleId]) {
|
||||
this._sourceFileCache[moduleId] = this._getDeclarationSourceFile(moduleId);
|
||||
}
|
||||
return this._sourceFileCache[moduleId];
|
||||
}
|
||||
|
||||
private _getDeclarationSourceFile(moduleId: string): ts.SourceFile | null {
|
||||
if (/\.d\.ts$/.test(moduleId)) {
|
||||
const fileName = path.join(SRC, moduleId);
|
||||
if (!this._fsProvider.existsSync(fileName)) {
|
||||
return null;
|
||||
}
|
||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||
return ts.createSourceFile(fileName, fileContents, ts.ScriptTarget.ES5);
|
||||
}
|
||||
const fileName = path.join(SRC, `${moduleId}.ts`);
|
||||
if (!this._fsProvider.existsSync(fileName)) {
|
||||
return null;
|
||||
}
|
||||
const fileContents = this._fsProvider.readFileSync(moduleId, fileName).toString();
|
||||
const fileMap: IFileMap = {
|
||||
'file.ts': fileContents
|
||||
};
|
||||
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
|
||||
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
|
||||
return ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5);
|
||||
}
|
||||
}
|
||||
|
||||
export function run3(resolver: DeclarationResolver): IMonacoDeclarationResult | null {
|
||||
const sourceFileGetter = (moduleId: string) => resolver.getDeclarationSourceFile(moduleId);
|
||||
return _run(sourceFileGetter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
interface ILibMap { [libName: string]: string; }
|
||||
@@ -478,12 +624,12 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||
}
|
||||
getScriptFileNames(): string[] {
|
||||
return (
|
||||
[]
|
||||
([] as string[])
|
||||
.concat(Object.keys(this._libs))
|
||||
.concat(Object.keys(this._files))
|
||||
);
|
||||
}
|
||||
getScriptVersion(fileName: string): string {
|
||||
getScriptVersion(_fileName: string): string {
|
||||
return '1';
|
||||
}
|
||||
getProjectVersion(): string {
|
||||
@@ -498,13 +644,13 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||
return ts.ScriptSnapshot.fromString('');
|
||||
}
|
||||
}
|
||||
getScriptKind(fileName: string): ts.ScriptKind {
|
||||
getScriptKind(_fileName: string): ts.ScriptKind {
|
||||
return ts.ScriptKind.TS;
|
||||
}
|
||||
getCurrentDirectory(): string {
|
||||
return '';
|
||||
}
|
||||
getDefaultLibFileName(options: ts.CompilerOptions): string {
|
||||
getDefaultLibFileName(_options: ts.CompilerOptions): string {
|
||||
return 'defaultLib:es5';
|
||||
}
|
||||
isDefaultLibFileName(fileName: string): boolean {
|
||||
@@ -513,36 +659,9 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||
}
|
||||
|
||||
export function execute(): IMonacoDeclarationResult {
|
||||
|
||||
const OUTPUT_FILES: { [file: string]: string; } = {};
|
||||
const SRC_FILES: IFileMap = {};
|
||||
const SRC_FILE_TO_EXPECTED_NAME: { [filename: string]: string; } = {};
|
||||
getIncludesInRecipe().forEach((moduleId) => {
|
||||
if (/\.d\.ts$/.test(moduleId)) {
|
||||
let fileName = path.join(SRC, moduleId);
|
||||
OUTPUT_FILES[moduleIdToPath('src', moduleId)] = fs.readFileSync(fileName).toString();
|
||||
return;
|
||||
}
|
||||
|
||||
let fileName = path.join(SRC, moduleId) + '.ts';
|
||||
SRC_FILES[fileName] = fs.readFileSync(fileName).toString();
|
||||
SRC_FILE_TO_EXPECTED_NAME[fileName] = moduleIdToPath('src', moduleId);
|
||||
});
|
||||
|
||||
const languageService = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, SRC_FILES, {}));
|
||||
|
||||
var t1 = Date.now();
|
||||
Object.keys(SRC_FILES).forEach((fileName) => {
|
||||
var t = Date.now();
|
||||
const emitOutput = languageService.getEmitOutput(fileName, true);
|
||||
OUTPUT_FILES[SRC_FILE_TO_EXPECTED_NAME[fileName]] = emitOutput.outputFiles[0].text;
|
||||
// console.log(`Generating .d.ts for ${fileName} took ${Date.now() - t} ms`);
|
||||
});
|
||||
console.log(`Generating .d.ts took ${Date.now() - t1} ms`);
|
||||
|
||||
// console.log(result.filePath);
|
||||
// fs.writeFileSync(result.filePath, result.content.replace(/\r\n/gm, '\n'));
|
||||
// fs.writeFileSync(path.join(SRC, 'user.ts'), result.usageContent.replace(/\r\n/gm, '\n'));
|
||||
|
||||
return run('src', OUTPUT_FILES);
|
||||
let r = run3(new DeclarationResolver(new FSProvider()));
|
||||
if (!r) {
|
||||
throw new Error(`monaco.d.ts generation error - Cannot continue`);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -25,29 +25,12 @@ declare namespace monaco {
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export enum Severity {
|
||||
Ignore = 0,
|
||||
Info = 1,
|
||||
Warning = 2,
|
||||
Error = 3,
|
||||
}
|
||||
|
||||
export enum MarkerTag {
|
||||
Unnecessary = 1,
|
||||
}
|
||||
|
||||
export enum MarkerSeverity {
|
||||
Hint = 1,
|
||||
Info = 2,
|
||||
Warning = 4,
|
||||
Error = 8,
|
||||
}
|
||||
|
||||
|
||||
#include(vs/base/common/winjs.base.d.ts): TValueCallback, ProgressCallback, Promise
|
||||
#include(vs/platform/markers/common/markers): MarkerTag, MarkerSeverity
|
||||
#include(vs/base/common/winjs.base.d.ts): Promise
|
||||
#include(vs/base/common/cancellation): CancellationTokenSource, CancellationToken
|
||||
#include(vs/base/common/uri): URI, UriComponents
|
||||
#include(vs/editor/common/standalone/standaloneBase): KeyCode, KeyMod
|
||||
#include(vs/base/common/keyCodes): KeyCode
|
||||
#include(vs/editor/common/standalone/standaloneBase): KeyMod
|
||||
#include(vs/base/common/htmlContent): IMarkdownString
|
||||
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
|
||||
#include(vs/base/browser/mouseEvent): IMouseEvent
|
||||
@@ -66,7 +49,7 @@ declare namespace monaco.editor {
|
||||
#include(vs/editor/common/services/webWorker): MonacoWebWorker, IWebWorkerOptions
|
||||
#include(vs/editor/standalone/browser/standaloneCodeEditor): IActionDescriptor, IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor
|
||||
export interface ICommandHandler {
|
||||
(...args:any[]): void;
|
||||
(...args: any[]): void;
|
||||
}
|
||||
#include(vs/platform/contextkey/common/contextkey): IContextKey
|
||||
#include(vs/editor/standalone/browser/standaloneServices): IEditorOverrideServices
|
||||
@@ -102,3 +85,5 @@ declare namespace monaco.worker {
|
||||
#includeAll(vs/editor/common/services/editorSimpleWorker;):
|
||||
|
||||
}
|
||||
|
||||
//dtsv=2
|
||||
@@ -1,19 +1,19 @@
|
||||
|
||||
// This file is adding references to various symbols which should not be removed via tree shaking
|
||||
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IHighlight } from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';
|
||||
import { SimpleWorkerClient, create as create1 } from 'vs/base/common/worker/simpleWorker';
|
||||
import { create as create2 } from 'vs/editor/common/services/editorSimpleWorker';
|
||||
import { QuickOpenWidget } from 'vs/base/parts/quickopen/browser/quickOpenWidget';
|
||||
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { PolyfillPromise } from 'vs/base/common/winjs.polyfill.promise';
|
||||
import { DiffNavigator } from 'vs/editor/browser/widget/diffNavigator';
|
||||
import * as editorAPI from 'vs/editor/editor.api';
|
||||
import { ServiceIdentifier } from './vs/platform/instantiation/common/instantiation';
|
||||
import { IContextViewService } from './vs/platform/contextview/browser/contextView';
|
||||
import { IHighlight } from './vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import { IWorkspaceContextService } from './vs/platform/workspace/common/workspace';
|
||||
import { IEnvironmentService } from './vs/platform/environment/common/environment';
|
||||
import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge';
|
||||
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
||||
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
||||
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
||||
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
||||
import { PolyfillPromise } from './vs/base/common/winjs.polyfill.promise';
|
||||
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
||||
import * as editorAPI from './vs/editor/editor.api';
|
||||
|
||||
(function () {
|
||||
var a: any;
|
||||
@@ -71,7 +71,6 @@ import * as editorAPI from 'vs/editor/editor.api';
|
||||
a = editorAPI.Range;
|
||||
a = editorAPI.Selection;
|
||||
a = editorAPI.SelectionDirection;
|
||||
a = editorAPI.Severity;
|
||||
a = editorAPI.MarkerSeverity;
|
||||
a = editorAPI.MarkerTag;
|
||||
a = editorAPI.Promise;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "monaco-editor-core",
|
||||
"private": true,
|
||||
"version": "0.12.0",
|
||||
"version": "0.14.3",
|
||||
"description": "A browser based code editor",
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user