Skip to content

Commit 31d13c8

Browse files
committed
Merge remote-tracking branch 'origin/master' into joao/git-fs-provider
2 parents 9f2592e + 92f6d22 commit 31d13c8

502 files changed

Lines changed: 8772 additions & 6819 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/commands.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
{
9797
type: 'comment',
9898
name: 'confirmationPending',
99-
allowUsers: ['cleidigh', 'usernamehw'],
99+
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
100100
action: 'updateLabels',
101101
addLabel: 'confirmation-pending',
102102
removeLabel: 'confirmed'
@@ -116,6 +116,14 @@
116116
addLabel: 'needs more info',
117117
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
118118
},
119+
{
120+
type: 'label',
121+
name: '~needs more info',
122+
action: 'updateLabels',
123+
addLabel: 'needs more info',
124+
removeLabel: '~needs more info',
125+
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
126+
},
119127
{
120128
type: 'comment',
121129
name: 'a11ymas',

build/builtInExtensions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"name": "ms-vscode.node-debug",
4-
"version": "1.40.1",
4+
"version": "1.41.0",
55
"repo": "https://github.com/Microsoft/vscode-node-debug",
66
"metadata": {
77
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"name": "ms-vscode.node-debug2",
19-
"version": "1.39.3",
19+
"version": "1.41.0",
2020
"repo": "https://github.com/Microsoft/vscode-node-debug2",
2121
"metadata": {
2222
"id": "36d19e17-7569-4841-a001-947eb18602b2",
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"name": "ms-vscode.references-view",
34-
"version": "0.0.31",
34+
"version": "0.0.36",
3535
"repo": "https://github.com/Microsoft/vscode-reference-view",
3636
"metadata": {
3737
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",

build/gulpfile.editor.js

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ var BUNDLED_FILE_HEADER = [
5757
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
5858

5959
const extractEditorSrcTask = task.define('extract-editor-src', () => {
60-
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
6160
const apiusages = monacoapi.execute().usageContent;
6261
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
6362
standalone.extractEditor({
@@ -71,14 +70,6 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
7170
apiusages,
7271
extrausages
7372
],
74-
typings: [
75-
'typings/lib.ie11_safe_es6.d.ts',
76-
'typings/thenable.d.ts',
77-
'typings/es6-promise.d.ts',
78-
'typings/require-monaco.d.ts',
79-
"typings/lib.es2018.promise.d.ts",
80-
'vs/monaco.d.ts'
81-
],
8273
libs: [
8374
`lib.es5.d.ts`,
8475
`lib.dom.d.ts`,
@@ -138,18 +129,70 @@ const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () =>
138129
});
139130

140131
const compileEditorESMTask = task.define('compile-editor-esm', () => {
132+
console.log(`Launching the TS compiler at ${path.join(__dirname, '../out-editor-esm')}...`);
133+
let result;
141134
if (process.platform === 'win32') {
142-
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
135+
result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
143136
cwd: path.join(__dirname, '../out-editor-esm')
144137
});
145-
console.log(result.stdout.toString());
146-
console.log(result.stderr.toString());
147138
} else {
148-
const result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
139+
result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
149140
cwd: path.join(__dirname, '../out-editor-esm')
150141
});
151-
console.log(result.stdout.toString());
152-
console.log(result.stderr.toString());
142+
}
143+
144+
console.log(result.stdout.toString());
145+
console.log(result.stderr.toString());
146+
147+
if (result.status !== 0) {
148+
console.log(`The TS Compilation failed, preparing analysis folder...`);
149+
const destPath = path.join(__dirname, '../../vscode-monaco-editor-esm-analysis');
150+
return util.rimraf(destPath)().then(() => {
151+
fs.mkdirSync(destPath);
152+
153+
// initialize a new repository
154+
cp.spawnSync(`git`, [`init`], {
155+
cwd: destPath
156+
});
157+
158+
// build a list of files to copy
159+
const files = util.rreddir(path.join(__dirname, '../out-editor-esm'));
160+
161+
// copy files from src
162+
for (const file of files) {
163+
const srcFilePath = path.join(__dirname, '../src', file);
164+
const dstFilePath = path.join(destPath, file);
165+
if (fs.existsSync(srcFilePath)) {
166+
util.ensureDir(path.dirname(dstFilePath));
167+
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
168+
fs.writeFileSync(dstFilePath, contents);
169+
}
170+
}
171+
172+
// create an initial commit to diff against
173+
cp.spawnSync(`git`, [`add`, `.`], {
174+
cwd: destPath
175+
});
176+
177+
// create the commit
178+
cp.spawnSync(`git`, [`commit`, `-m`, `"original sources"`, `--no-gpg-sign`], {
179+
cwd: destPath
180+
});
181+
182+
// copy files from esm
183+
for (const file of files) {
184+
const srcFilePath = path.join(__dirname, '../out-editor-esm', file);
185+
const dstFilePath = path.join(destPath, file);
186+
if (fs.existsSync(srcFilePath)) {
187+
util.ensureDir(path.dirname(dstFilePath));
188+
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
189+
fs.writeFileSync(dstFilePath, contents);
190+
}
191+
}
192+
193+
console.log(`Open in VS Code the folder at '${destPath}' and you can alayze the compilation error`);
194+
throw new Error('Standalone Editor compilation failed. If this is the build machine, simply launch `yarn run gulp editor-distro` on your machine to further analyze the compilation problem.');
195+
});
153196
}
154197
});
155198

build/lib/builtInExtensions.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ const ansiColors = require('ansi-colors');
2020
const root = path.dirname(path.dirname(__dirname));
2121
const builtInExtensions = require('../builtInExtensions.json');
2222
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
23+
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
24+
25+
function log() {
26+
if (ENABLE_LOGGING) {
27+
fancyLog.apply(this, arguments);
28+
}
29+
}
2330

2431
function getExtensionPath(extension) {
2532
return path.join(root, '.build', 'builtInExtensions', extension.name);
@@ -44,7 +51,7 @@ function isUpToDate(extension) {
4451

4552
function syncMarketplaceExtension(extension) {
4653
if (isUpToDate(extension)) {
47-
fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
54+
log(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
4855
return es.readArray([]);
4956
}
5057

@@ -53,29 +60,29 @@ function syncMarketplaceExtension(extension) {
5360
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
5461
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
5562
.pipe(vfs.dest('.build/builtInExtensions'))
56-
.on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
63+
.on('end', () => log(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
5764
}
5865

5966
function syncExtension(extension, controlState) {
6067
switch (controlState) {
6168
case 'disabled':
62-
fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
69+
log(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
6370
return es.readArray([]);
6471

6572
case 'marketplace':
6673
return syncMarketplaceExtension(extension);
6774

6875
default:
6976
if (!fs.existsSync(controlState)) {
70-
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
77+
log(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
7178
return es.readArray([]);
7279

7380
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
74-
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
81+
log(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
7582
return es.readArray([]);
7683
}
7784

78-
fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
85+
log(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
7986
return es.readArray([]);
8087
}
8188
}
@@ -94,8 +101,8 @@ function writeControlFile(control) {
94101
}
95102

96103
function main() {
97-
fancyLog('Syncronizing built-in extensions...');
98-
fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
104+
log('Syncronizing built-in extensions...');
105+
log(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
99106

100107
const control = readControlFile();
101108
const streams = [];

build/lib/compilation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function createCompile(src, build, emitError) {
4444
const input = es.through();
4545
const output = input
4646
.pipe(utf8Filter)
47-
.pipe(bom())
47+
.pipe(bom()) // this is required to preserve BOM in test files that loose it otherwise
4848
.pipe(utf8Filter.restore)
4949
.pipe(tsFilter)
5050
.pipe(util.loadSourcemaps())

build/lib/compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean) {
5454
const input = es.through();
5555
const output = input
5656
.pipe(utf8Filter)
57-
.pipe(bom())
57+
.pipe(bom()) // this is required to preserve BOM in test files that loose it otherwise
5858
.pipe(utf8Filter.restore)
5959
.pipe(tsFilter)
6060
.pipe(util.loadSourcemaps())

build/lib/i18n.resources.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
"name": "vs/workbench/contrib/comments",
5151
"project": "vscode-workbench"
5252
},
53+
{
54+
"name": "vs/workbench/contrib/testCustomEditors",
55+
"project": "vscode-workbench"
56+
},
5357
{
5458
"name": "vs/workbench/contrib/debug",
5559
"project": "vscode-workbench"
@@ -139,7 +143,7 @@
139143
"project": "vscode-workbench"
140144
},
141145
{
142-
"name": "vs/workbench/contrib/stats",
146+
"name": "vs/workbench/contrib/tags",
143147
"project": "vscode-workbench"
144148
},
145149
{
@@ -198,6 +202,10 @@
198202
"name": "vs/workbench/services/actions",
199203
"project": "vscode-workbench"
200204
},
205+
{
206+
"name": "vs/workbench/services/authToken",
207+
"project": "vscode-workbench"
208+
},
201209
{
202210
"name": "vs/workbench/services/bulkEdit",
203211
"project": "vscode-workbench"

build/lib/standalone.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ function extractEditor(options) {
4343
compilerOptions.declaration = false;
4444
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
4545
options.compilerOptions = compilerOptions;
46-
console.log(`Running with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
46+
console.log(`Running tree shaker with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
47+
// Take the extra included .d.ts files from `tsconfig.monaco.json`
48+
options.typings = tsConfig.include.filter(includedFile => /\.d\.ts$/.test(includedFile));
4749
let result = tss.shake(options);
4850
for (let fileName in result) {
4951
if (result.hasOwnProperty(fileName)) {

build/lib/standalone.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
5050

5151
options.compilerOptions = compilerOptions;
5252

53-
console.log(`Running with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
53+
console.log(`Running tree shaker with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
54+
55+
// Take the extra included .d.ts files from `tsconfig.monaco.json`
56+
options.typings = (<string[]>tsConfig.include).filter(includedFile => /\.d\.ts$/.test(includedFile));
5457

5558
let result = tss.shake(options);
5659
for (let fileName in result) {

build/lib/treeshaking.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ function toStringShakeLevel(shakeLevel) {
2525
}
2626
}
2727
exports.toStringShakeLevel = toStringShakeLevel;
28-
function printDiagnostics(diagnostics) {
28+
function printDiagnostics(options, diagnostics) {
2929
for (const diag of diagnostics) {
3030
let result = '';
3131
if (diag.file) {
32-
result += `${diag.file.fileName}: `;
32+
result += `${path.join(options.sourcesRoot, diag.file.fileName)}`;
3333
}
3434
if (diag.file && diag.start) {
3535
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
36-
result += `- ${location.line + 1},${location.character} - `;
36+
result += `:${location.line + 1}:${location.character}`;
3737
}
38-
result += JSON.stringify(diag.messageText);
38+
result += ` - ` + JSON.stringify(diag.messageText);
3939
console.log(result);
4040
}
4141
}
@@ -44,17 +44,17 @@ function shake(options) {
4444
const program = languageService.getProgram();
4545
const globalDiagnostics = program.getGlobalDiagnostics();
4646
if (globalDiagnostics.length > 0) {
47-
printDiagnostics(globalDiagnostics);
47+
printDiagnostics(options, globalDiagnostics);
4848
throw new Error(`Compilation Errors encountered.`);
4949
}
5050
const syntacticDiagnostics = program.getSyntacticDiagnostics();
5151
if (syntacticDiagnostics.length > 0) {
52-
printDiagnostics(syntacticDiagnostics);
52+
printDiagnostics(options, syntacticDiagnostics);
5353
throw new Error(`Compilation Errors encountered.`);
5454
}
5555
const semanticDiagnostics = program.getSemanticDiagnostics();
5656
if (semanticDiagnostics.length > 0) {
57-
printDiagnostics(semanticDiagnostics);
57+
printDiagnostics(options, semanticDiagnostics);
5858
throw new Error(`Compilation Errors encountered.`);
5959
}
6060
markNodes(languageService, options);
@@ -358,7 +358,7 @@ function markNodes(languageService, options) {
358358
++step;
359359
let node;
360360
if (step % 100 === 0) {
361-
console.log(`${step}/${step + black_queue.length + gray_queue.length} (${black_queue.length}, ${gray_queue.length})`);
361+
console.log(`Treeshaking - ${Math.floor(100 * step / (step + black_queue.length + gray_queue.length))}% - ${step}/${step + black_queue.length + gray_queue.length} (${black_queue.length}, ${gray_queue.length})`);
362362
}
363363
if (black_queue.length === 0) {
364364
for (let i = 0; i < gray_queue.length; i++) {

0 commit comments

Comments
 (0)