Update to VS Code 1.52.1

This commit is contained in:
Asher
2021-02-09 16:08:37 +00:00
1351 changed files with 56560 additions and 38990 deletions

View File

@@ -150,6 +150,7 @@ export class IssueReporter extends Disposable {
applyZoom(configuration.data.zoomLevel);
this.applyStyles(configuration.data.styles);
this.handleExtensionData(configuration.data.enabledExtensions);
this.updateExperimentsInfo(configuration.data.experiments);
}
render(): void {
@@ -285,7 +286,7 @@ export class IssueReporter extends Disposable {
this.render();
});
(['includeSystemInfo', 'includeProcessInfo', 'includeWorkspaceInfo', 'includeExtensions', 'includeSearchedExtensions', 'includeSettingsSearchDetails'] as const).forEach(elementId => {
(['includeSystemInfo', 'includeProcessInfo', 'includeWorkspaceInfo', 'includeExtensions', 'includeExperiments'] as const).forEach(elementId => {
this.addEventListener(elementId, 'click', (event: Event) => {
event.stopPropagation();
this.issueReporterModel.update({ [elementId]: !this.issueReporterModel.getData()[elementId] });
@@ -693,8 +694,7 @@ export class IssueReporter extends Disposable {
const processBlock = document.querySelector('.block-process');
const workspaceBlock = document.querySelector('.block-workspace');
const extensionsBlock = document.querySelector('.block-extensions');
const searchedExtensionsBlock = document.querySelector('.block-searchedExtensions');
const settingsSearchResultsBlock = document.querySelector('.block-settingsSearchResults');
const experimentsBlock = document.querySelector('.block-experiments');
const problemSource = this.getElementById('problem-source')!;
const descriptionTitle = this.getElementById('issue-description-label')!;
@@ -707,8 +707,7 @@ export class IssueReporter extends Disposable {
hide(processBlock);
hide(workspaceBlock);
hide(extensionsBlock);
hide(searchedExtensionsBlock);
hide(settingsSearchResultsBlock);
hide(experimentsBlock);
hide(problemSource);
hide(extensionSelector);
@@ -716,6 +715,7 @@ export class IssueReporter extends Disposable {
show(blockContainer);
show(systemBlock);
show(problemSource);
show(experimentsBlock);
if (fileOnExtension) {
show(extensionSelector);
@@ -730,6 +730,7 @@ export class IssueReporter extends Disposable {
show(processBlock);
show(workspaceBlock);
show(problemSource);
show(experimentsBlock);
if (fileOnExtension) {
show(extensionSelector);
@@ -1084,6 +1085,14 @@ export class IssueReporter extends Disposable {
}
}
private updateExperimentsInfo(experimentInfo: string | undefined) {
this.issueReporterModel.update({ experimentInfo });
const target = document.querySelector<HTMLElement>('.block-experiments .block-info');
if (target) {
target.textContent = experimentInfo ? experimentInfo : localize('noCurrentExperiments', "No current experiments.");
}
}
private getExtensionTableHtml(extensions: IssueReporterExtensionData[]): HTMLTableElement {
return $('table', undefined,
$('tr', undefined,

View File

@@ -19,8 +19,7 @@ export interface IssueReporterData {
includeWorkspaceInfo: boolean;
includeProcessInfo: boolean;
includeExtensions: boolean;
includeSearchedExtensions: boolean;
includeSettingsSearchDetails: boolean;
includeExperiments: boolean;
numberOfThemeExtesions?: number;
allExtensions: IssueReporterExtensionData[];
@@ -31,6 +30,7 @@ export interface IssueReporterData {
actualSearchResults?: ISettingSearchResult[];
query?: string;
filterResultCount?: number;
experimentInfo?: string;
}
export class IssueReporterModel {
@@ -43,8 +43,7 @@ export class IssueReporterModel {
includeWorkspaceInfo: true,
includeProcessInfo: true,
includeExtensions: true,
includeSearchedExtensions: true,
includeSettingsSearchDetails: true,
includeExperiments: true,
allExtensions: []
};
@@ -133,6 +132,12 @@ ${this.getInfos()}
}
}
if (this._data.issueType === IssueType.Bug || this._data.issueType === IssueType.PerformanceIssue) {
if (this._data.includeExperiments && this._data.experimentInfo) {
info += this.generateExperimentsInfoMd();
}
}
return info;
}
@@ -150,7 +155,7 @@ ${this.getInfos()}
|GPU Status|${Object.keys(this._data.systemInfo.gpuStatus).map(key => `${key}: ${this._data.systemInfo!.gpuStatus[key]}`).join('<br>')}|
|Load (avg)|${this._data.systemInfo.load}|
|Memory (System)|${this._data.systemInfo.memory}|
|Process Argv|${this._data.systemInfo.processArgs}|
|Process Argv|${this._data.systemInfo.processArgs.replace(/\\/g, '\\\\')}|
|Screen Reader|${this._data.systemInfo.screenReader}|
|VM|${this._data.systemInfo.vmHint}|`;
@@ -203,6 +208,18 @@ ${this._data.processInfo}
${this._data.workspaceInfo};
\`\`\`
</details>
`;
}
private generateExperimentsInfoMd(): string {
return `<details>
<summary>A/B Experiments</summary>
\`\`\`
${this._data.experimentInfo}
\`\`\`
</details>
`;
}

View File

@@ -111,25 +111,15 @@ export default (): string => `
<!-- To be dynamically filled -->
</div>
</div>
<div class="block block-searchedExtensions">
<input class="sendData" type="checkbox" id="includeSearchedExtensions" checked/>
<label class="caption" for="includeSearchedExtensions">${escape(localize({
key: 'sendSearchedExtensions',
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibility of the searched extensions']
}, "Send searched extensions ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
<div class="block-info hidden">
<div class="block block-experiments">
<input class="sendData" type="checkbox" id="includeExperiments" checked/>
<label class="caption" for="includeExperiments">${escape(localize({
key: 'sendExperiments',
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibility of the current experiment information']
}, "Include A/B experiment info ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
<pre class="block-info hidden">
<!-- To be dynamically filled -->
</div>
</div>
<div class="block block-settingsSearchResults">
<input class="sendData" type="checkbox" id="includeSettingsSearchDetails" checked/>
<label class="caption" for="includeSettingsSearchDetails">${escape(localize({
key: 'sendSettingsSearchDetails',
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibility of the search details']
}, "Send settings search details ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
<div class="block-info hidden">
<!-- To be dynamically filled -->
</div>
</pre>
</div>
</div>
</div>`;

View File

@@ -18,8 +18,7 @@ suite('IssueReporter', () => {
includeWorkspaceInfo: true,
includeProcessInfo: true,
includeExtensions: true,
includeSearchedExtensions: true,
includeSettingsSearchDetails: true,
includeExperiments: true,
issueType: 0
});
});
@@ -78,6 +77,58 @@ OS version: undefined
|Screen Reader|no|
|VM|0%|
</details>Extensions: none
<!-- generated by issue reporter -->`);
});
test('serializes experiment info when data is provided', () => {
const issueReporterModel = new IssueReporterModel({
issueType: 0,
systemInfo: {
os: 'Darwin',
cpus: 'Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)',
memory: '16.00GB',
vmHint: '0%',
processArgs: '',
screenReader: 'no',
remoteData: [],
gpuStatus: {
'2d_canvas': 'enabled',
'checker_imaging': 'disabled_off'
}
},
experimentInfo: 'vsliv695:30137379\nvsins829:30139715'
});
assert.equal(issueReporterModel.serialize(),
`
Issue Type: <b>Bug</b>
undefined
VS Code version: undefined
OS version: undefined
<details>
<summary>System Info</summary>
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)|
|GPU Status|2d_canvas: enabled<br>checker_imaging: disabled_off|
|Load (avg)|undefined|
|Memory (System)|16.00GB|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details>Extensions: none<details>
<summary>A/B Experiments</summary>
\`\`\`
vsliv695:30137379
vsins829:30139715
\`\`\`
</details>
<!-- generated by issue reporter -->`);
});
@@ -191,6 +242,45 @@ Remote OS version: Linux x64 4.18.0
<!-- generated by issue reporter -->`);
});
test('escapes backslashes in processArgs', () => {
const issueReporterModel = new IssueReporterModel({
issueType: 0,
systemInfo: {
os: 'Darwin',
cpus: 'Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)',
memory: '16.00GB',
vmHint: '0%',
processArgs: '\\\\HOST\\path',
screenReader: 'no',
remoteData: [],
gpuStatus: {}
}
});
assert.equal(issueReporterModel.serialize(),
`
Issue Type: <b>Bug</b>
undefined
VS Code version: undefined
OS version: undefined
<details>
<summary>System Info</summary>
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 x 2800)|
|GPU Status||
|Load (avg)|undefined|
|Memory (System)|16.00GB|
|Process Argv|\\\\\\\\HOST\\\\path|
|Screen Reader|no|
|VM|0%|
</details>Extensions: none
<!-- generated by issue reporter -->`);
});
test('should normalize GitHub urls', () => {
[
'https://github.com/repo',

View File

@@ -19,6 +19,7 @@ import { DisposableStore } from 'vs/base/common/lifecycle';
import { isRemoteDiagnosticError, IRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
import { MainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
import { CodiconLabel } from 'vs/base/browser/ui/codicons/codiconLabel';
import { ByteSize } from 'vs/platform/files/common/files';
const DEBUG_FLAGS_PATTERN = /\s--(inspect|debug)(-brk|port)?=(\d+)?/;
const DEBUG_PORT_PATTERN = /\s--(inspect|debug)-port=(\d+)/;
@@ -67,18 +68,19 @@ class ProcessExplorer {
private getProcessList(rootProcess: ProcessItem, isLocal: boolean, totalMem: number): FormattedProcessItem[] {
const processes: FormattedProcessItem[] = [];
const handledProcesses = new Set<number>();
if (rootProcess) {
this.getProcessItem(processes, rootProcess, 0, isLocal, totalMem);
this.getProcessItem(processes, rootProcess, 0, isLocal, totalMem, handledProcesses);
}
return processes;
}
private getProcessItem(processes: FormattedProcessItem[], item: ProcessItem, indent: number, isLocal: boolean, totalMem: number): void {
private getProcessItem(processes: FormattedProcessItem[], item: ProcessItem, indent: number, isLocal: boolean, totalMem: number, handledProcesses: Set<number>): void {
const isRoot = (indent === 0);
const MB = 1024 * 1024;
handledProcesses.add(item.pid);
let name = item.name;
if (isRoot) {
@@ -95,7 +97,7 @@ class ProcessExplorer {
const memory = this.data.platform === 'win32' ? item.mem : (totalMem * (item.mem / 100));
processes.push({
cpu: item.load,
memory: (memory / MB),
memory: (memory / ByteSize.MB),
pid: item.pid.toFixed(0),
name,
formattedName,
@@ -105,9 +107,11 @@ class ProcessExplorer {
// Recurse into children if any
if (Array.isArray(item.children)) {
item.children.forEach(child => {
if (child) {
this.getProcessItem(processes, child, indent + 1, isLocal, totalMem);
if (!child || handledProcesses.has(child.pid)) {
return; // prevent loops
}
this.getProcessItem(processes, child, indent + 1, isLocal, totalMem, handledProcesses);
});
}
}

View File

@@ -9,15 +9,12 @@
'use strict';
(function () {
const bootstrapWindow = bootstrapWindowLib();
// Add a perf entry right from the top
const perf = perfLib();
const perf = bootstrapWindow.perfLib();
perf.mark('renderer/started');
// Load environment in parallel to workbench loading to avoid waterfall
const bootstrapWindow = bootstrapWindowLib();
const whenEnvResolved = bootstrapWindow.globals().process.whenEnvResolved();
// Load workbench main JS, CSS and NLS all in parallel. This is an
// optimization to prevent a waterfall of loading to happen, because
// we know for a fact that workbench.desktop.sandbox.main will depend on
@@ -31,12 +28,6 @@
// Mark start of workbench
perf.mark('didLoadWorkbenchMain');
performance.mark('workbench-start');
// Wait for process environment being fully resolved
await whenEnvResolved;
perf.mark('main/startup');
// @ts-ignore
return require('vs/workbench/electron-sandbox/desktop.main').main(configuration);
@@ -58,23 +49,11 @@
//region Helpers
function perfLib() {
globalThis.MonacoPerformanceMarks = globalThis.MonacoPerformanceMarks || [];
return {
/**
* @param {string} name
*/
mark(name) {
globalThis.MonacoPerformanceMarks.push(name, Date.now());
}
};
}
/**
* @returns {{
* load: (modules: string[], resultCallback: (result, configuration: object) => any, options: object) => unknown,
* globals: () => typeof import('../../../base/parts/sandbox/electron-sandbox/globals')
* globals: () => typeof import('../../../base/parts/sandbox/electron-sandbox/globals'),
* perfLib: () => { mark: (name: string) => void }
* }}
*/
function bootstrapWindowLib() {