mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -87,9 +87,12 @@ export class IssueReporter extends Disposable {
|
||||
extensionsDisabled: !!this.environmentService.disableExtensions,
|
||||
});
|
||||
|
||||
this.previewButton = new Button(document.getElementById('issue-reporter'));
|
||||
const issueReporterElement = this.getElementById('issue-reporter');
|
||||
if (issueReporterElement) {
|
||||
this.previewButton = new Button(issueReporterElement);
|
||||
}
|
||||
|
||||
ipcRenderer.on('vscode:issuePerformanceInfoResponse', (event, info) => {
|
||||
ipcRenderer.on('vscode:issuePerformanceInfoResponse', (_, info) => {
|
||||
this.logService.trace('issueReporter: Received performance data');
|
||||
this.issueReporterModel.update(info);
|
||||
this.receivedPerformanceInfo = true;
|
||||
@@ -100,7 +103,7 @@ export class IssueReporter extends Disposable {
|
||||
this.updatePreviewButtonState();
|
||||
});
|
||||
|
||||
ipcRenderer.on('vscode:issueSystemInfoResponse', (event, info) => {
|
||||
ipcRenderer.on('vscode:issueSystemInfoResponse', (_, info) => {
|
||||
this.logService.trace('issueReporter: Received system data');
|
||||
this.issueReporterModel.update({ systemInfo: info });
|
||||
this.receivedSystemInfo = true;
|
||||
@@ -116,7 +119,7 @@ export class IssueReporter extends Disposable {
|
||||
this.logService.trace('issueReporter: Sent data requests');
|
||||
|
||||
if (window.document.documentElement.lang !== 'en') {
|
||||
show(document.getElementById('english'));
|
||||
show(this.getElementById('english'));
|
||||
}
|
||||
|
||||
this.setUpTypes();
|
||||
@@ -208,7 +211,7 @@ export class IssueReporter extends Disposable {
|
||||
|
||||
styleTag.innerHTML = content.join('\n');
|
||||
document.head.appendChild(styleTag);
|
||||
document.body.style.color = styles.color;
|
||||
document.body.style.color = styles.color || null;
|
||||
}
|
||||
|
||||
private handleExtensionData(extensions: IssueReporterExtensionData[]) {
|
||||
@@ -221,7 +224,7 @@ export class IssueReporter extends Disposable {
|
||||
this.updateExtensionTable(nonThemes, numberOfThemeExtesions);
|
||||
|
||||
if (this.environmentService.disableExtensions || extensions.length === 0) {
|
||||
(<HTMLButtonElement>document.getElementById('disableExtensions')).disabled = true;
|
||||
(<HTMLButtonElement>this.getElementById('disableExtensions')).disabled = true;
|
||||
}
|
||||
|
||||
this.updateExtensionSelector(extensions);
|
||||
@@ -239,32 +242,33 @@ export class IssueReporter extends Disposable {
|
||||
|
||||
private updateSettingsSearchDetails(data: ISettingsSearchIssueReporterData): void {
|
||||
const target = document.querySelector('.block-settingsSearchResults .block-info');
|
||||
|
||||
const details = `
|
||||
if (target) {
|
||||
const details = `
|
||||
<div class='block-settingsSearchResults-details'>
|
||||
<div>Query: "${data.query}"</div>
|
||||
<div>Literal match count: ${data.filterResultCount}</div>
|
||||
</div>
|
||||
`;
|
||||
`;
|
||||
|
||||
let table = `
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th>Extension</th>
|
||||
<th>Score</th>
|
||||
</tr>`;
|
||||
let table = `
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th>Extension</th>
|
||||
<th>Score</th>
|
||||
</tr>`;
|
||||
|
||||
data.actualSearchResults
|
||||
.forEach(setting => {
|
||||
table += `
|
||||
<tr>
|
||||
<td>${setting.key}</td>
|
||||
<td>${setting.extensionId}</td>
|
||||
<td>${String(setting.score).slice(0, 5)}</td>
|
||||
</tr>`;
|
||||
});
|
||||
data.actualSearchResults
|
||||
.forEach(setting => {
|
||||
table += `
|
||||
<tr>
|
||||
<td>${setting.key}</td>
|
||||
<td>${setting.extensionId}</td>
|
||||
<td>${String(setting.score).slice(0, 5)}</td>
|
||||
</tr>`;
|
||||
});
|
||||
|
||||
target.innerHTML = `${details}<table>${table}</table>`;
|
||||
target.innerHTML = `${details}<table>${table}</table>`;
|
||||
}
|
||||
}
|
||||
|
||||
private initServices(configuration: IWindowConfiguration): void {
|
||||
@@ -286,7 +290,7 @@ export class IssueReporter extends Disposable {
|
||||
if (!this.environmentService.isExtensionDevelopment && !this.environmentService.args['disable-telemetry'] && !!product.enableTelemetry) {
|
||||
const channel = getDelayedChannel(sharedProcess.then(c => c.getChannel('telemetryAppender')));
|
||||
const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService));
|
||||
const commonProperties = resolveCommonProperties(product.commit, pkg.version, configuration.machineId, this.environmentService.installSourcePath);
|
||||
const commonProperties = resolveCommonProperties(product.commit || 'Commit unknown', pkg.version, configuration.machineId, this.environmentService.installSourcePath);
|
||||
const piiPaths = [this.environmentService.appRoot, this.environmentService.extensionsPath];
|
||||
const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths };
|
||||
|
||||
@@ -320,27 +324,29 @@ export class IssueReporter extends Disposable {
|
||||
const showInfoElements = document.getElementsByClassName('showInfo');
|
||||
for (let i = 0; i < showInfoElements.length; i++) {
|
||||
const showInfo = showInfoElements.item(i);
|
||||
showInfo.addEventListener('click', (e) => {
|
||||
showInfo!.addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
const label = (<HTMLDivElement>e.target);
|
||||
const containingElement = label.parentElement.parentElement;
|
||||
const info = containingElement.lastElementChild;
|
||||
if (info.classList.contains('hidden')) {
|
||||
show(info);
|
||||
label.textContent = localize('hide', "hide");
|
||||
} else {
|
||||
hide(info);
|
||||
label.textContent = localize('show', "show");
|
||||
if (label) {
|
||||
const containingElement = label.parentElement && label.parentElement.parentElement;
|
||||
const info = containingElement && containingElement.lastElementChild;
|
||||
if (info && info.classList.contains('hidden')) {
|
||||
show(info);
|
||||
label.textContent = localize('hide', "hide");
|
||||
} else {
|
||||
hide(info);
|
||||
label.textContent = localize('show', "show");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.addEventListener('issue-source', 'change', (event: Event) => {
|
||||
const fileOnExtension = JSON.parse((<HTMLInputElement>event.target).value);
|
||||
this.addEventListener('issue-source', 'change', (e: Event) => {
|
||||
const fileOnExtension = JSON.parse((<HTMLInputElement>e.target).value);
|
||||
this.issueReporterModel.update({ fileOnExtension: fileOnExtension, includeExtensions: !fileOnExtension });
|
||||
this.render();
|
||||
|
||||
const title = (<HTMLInputElement>document.getElementById('issue-title')).value;
|
||||
const title = (<HTMLInputElement>this.getElementById('issue-title')).value;
|
||||
if (fileOnExtension) {
|
||||
this.searchExtensionIssues(title);
|
||||
} else {
|
||||
@@ -349,20 +355,20 @@ export class IssueReporter extends Disposable {
|
||||
}
|
||||
});
|
||||
|
||||
this.addEventListener('description', 'input', (event: Event) => {
|
||||
const issueDescription = (<HTMLInputElement>event.target).value;
|
||||
this.addEventListener('description', 'input', (e: Event) => {
|
||||
const issueDescription = (<HTMLInputElement>e.target).value;
|
||||
this.issueReporterModel.update({ issueDescription });
|
||||
|
||||
// Only search for extension issues on title change
|
||||
if (!this.issueReporterModel.fileOnExtension()) {
|
||||
const title = (<HTMLInputElement>document.getElementById('issue-title')).value;
|
||||
const title = (<HTMLInputElement>this.getElementById('issue-title')).value;
|
||||
this.searchVSCodeIssues(title, issueDescription);
|
||||
}
|
||||
});
|
||||
|
||||
this.addEventListener('issue-title', 'input', (e) => {
|
||||
const title = (<HTMLInputElement>event.target).value;
|
||||
const lengthValidationMessage = document.getElementById('issue-title-length-validation-error');
|
||||
this.addEventListener('issue-title', 'input', (e: Event) => {
|
||||
const title = (<HTMLInputElement>e.target).value;
|
||||
const lengthValidationMessage = this.getElementById('issue-title-length-validation-error');
|
||||
if (title && this.getIssueUrlWithTitle(title).length > MAX_URL_LENGTH) {
|
||||
show(lengthValidationMessage);
|
||||
} else {
|
||||
@@ -409,7 +415,7 @@ export class IssueReporter extends Disposable {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
const issueTitle = (<HTMLInputElement>document.getElementById('issue-title'))!.value;
|
||||
const issueTitle = (<HTMLInputElement>this.getElementById('issue-title'))!.value;
|
||||
const { issueDescription } = this.issueReporterModel.getData();
|
||||
if (!this.hasBeenSubmitted && (issueTitle || issueDescription)) {
|
||||
ipcRenderer.send('vscode:issueReporterConfirmClose');
|
||||
@@ -471,17 +477,17 @@ export class IssueReporter extends Disposable {
|
||||
return false;
|
||||
}
|
||||
|
||||
private getExtensionRepositoryUrl(): string {
|
||||
private getExtensionRepositoryUrl(): string | undefined {
|
||||
const selectedExtension = this.issueReporterModel.getData().selectedExtension;
|
||||
return selectedExtension && selectedExtension.repositoryUrl;
|
||||
}
|
||||
|
||||
private getExtensionBugsUrl(): string {
|
||||
private getExtensionBugsUrl(): string | undefined {
|
||||
const selectedExtension = this.issueReporterModel.getData().selectedExtension;
|
||||
return selectedExtension && selectedExtension.bugsUrl;
|
||||
}
|
||||
|
||||
private searchVSCodeIssues(title: string, issueDescription: string): void {
|
||||
private searchVSCodeIssues(title: string, issueDescription?: string): void {
|
||||
if (title) {
|
||||
this.searchDuplicates(title, issueDescription);
|
||||
} else {
|
||||
@@ -510,7 +516,7 @@ export class IssueReporter extends Disposable {
|
||||
}
|
||||
|
||||
private clearSearchResults(): void {
|
||||
const similarIssues = document.getElementById('similar-issues');
|
||||
const similarIssues = this.getElementById('similar-issues')!;
|
||||
similarIssues.innerHTML = '';
|
||||
this.numberOfSearchResultsDisplayed = 0;
|
||||
}
|
||||
@@ -518,7 +524,7 @@ export class IssueReporter extends Disposable {
|
||||
@debounce(300)
|
||||
private searchGitHub(repo: string, title: string): void {
|
||||
const query = `is:issue+repo:${repo}+${title}`;
|
||||
const similarIssues = document.getElementById('similar-issues');
|
||||
const similarIssues = this.getElementById('similar-issues')!;
|
||||
|
||||
window.fetch(`https://api.github.com/search/issues?q=${query}`).then((response) => {
|
||||
response.json().then(result => {
|
||||
@@ -532,7 +538,7 @@ export class IssueReporter extends Disposable {
|
||||
similarIssues.appendChild(message);
|
||||
|
||||
const resetTime = response.headers.get('X-RateLimit-Reset');
|
||||
const timeToWait = parseInt(resetTime) - Math.floor(Date.now() / 1000);
|
||||
const timeToWait = resetTime ? parseInt(resetTime) - Math.floor(Date.now() / 1000) : 1;
|
||||
if (this.shouldQueueSearch) {
|
||||
this.shouldQueueSearch = false;
|
||||
setTimeout(() => {
|
||||
@@ -550,7 +556,7 @@ export class IssueReporter extends Disposable {
|
||||
}
|
||||
|
||||
@debounce(300)
|
||||
private searchDuplicates(title: string, body: string): void {
|
||||
private searchDuplicates(title: string, body?: string): void {
|
||||
const url = 'https://vscode-probot.westus.cloudapp.azure.com:7890/duplicate_candidates';
|
||||
const init = {
|
||||
method: 'POST',
|
||||
@@ -582,7 +588,7 @@ export class IssueReporter extends Disposable {
|
||||
}
|
||||
|
||||
private displaySearchResults(results: SearchResult[]) {
|
||||
const similarIssues = document.getElementById('similar-issues');
|
||||
const similarIssues = this.getElementById('similar-issues')!;
|
||||
if (results.length) {
|
||||
const issues = $('div.issues-container');
|
||||
const issuesText = $('div.list-title');
|
||||
@@ -598,6 +604,7 @@ export class IssueReporter extends Disposable {
|
||||
link.addEventListener('auxclick', (e) => this.openLink(<MouseEvent>e));
|
||||
|
||||
let issueState: HTMLElement;
|
||||
let item: HTMLElement;
|
||||
if (issue.state) {
|
||||
issueState = $('span.issue-state');
|
||||
|
||||
@@ -611,9 +618,12 @@ export class IssueReporter extends Disposable {
|
||||
issueState.title = issue.state === 'open' ? localize('open', "Open") : localize('closed', "Closed");
|
||||
issueState.appendChild(issueIcon);
|
||||
issueState.appendChild(issueStateLabel);
|
||||
|
||||
item = $('div.issue', {}, issueState, link);
|
||||
} else {
|
||||
item = $('div.issue', {}, link);
|
||||
}
|
||||
|
||||
const item = $('div.issue', {}, issueState, link);
|
||||
issues.appendChild(item);
|
||||
}
|
||||
|
||||
@@ -639,7 +649,7 @@ export class IssueReporter extends Disposable {
|
||||
private setUpTypes(): void {
|
||||
const makeOption = (issueType: IssueType, description: string) => `<option value="${issueType.valueOf()}">${escape(description)}</option>`;
|
||||
|
||||
const typeSelect = (<HTMLSelectElement>document.getElementById('issue-type'));
|
||||
const typeSelect = this.getElementById('issue-type')! as HTMLSelectElement;
|
||||
const { issueType } = this.issueReporterModel.getData();
|
||||
if (issueType === IssueType.SettingsSearchIssue) {
|
||||
typeSelect.innerHTML = makeOption(IssueType.SettingsSearchIssue, localize('settingsSearchIssue', "Settings Search Issue"));
|
||||
@@ -658,7 +668,7 @@ export class IssueReporter extends Disposable {
|
||||
private renderBlocks(): void {
|
||||
// Depending on Issue Type, we render different blocks and text
|
||||
const { issueType, fileOnExtension } = this.issueReporterModel.getData();
|
||||
const blockContainer = document.getElementById('block-container');
|
||||
const blockContainer = this.getElementById('block-container');
|
||||
const systemBlock = document.querySelector('.block-system');
|
||||
const processBlock = document.querySelector('.block-process');
|
||||
const workspaceBlock = document.querySelector('.block-workspace');
|
||||
@@ -666,11 +676,11 @@ export class IssueReporter extends Disposable {
|
||||
const searchedExtensionsBlock = document.querySelector('.block-searchedExtensions');
|
||||
const settingsSearchResultsBlock = document.querySelector('.block-settingsSearchResults');
|
||||
|
||||
const problemSource = document.getElementById('problem-source');
|
||||
const problemSourceHelpText = document.getElementById('problem-source-help-text');
|
||||
const descriptionTitle = document.getElementById('issue-description-label');
|
||||
const descriptionSubtitle = document.getElementById('issue-description-subtitle');
|
||||
const extensionSelector = document.getElementById('extension-selection');
|
||||
const problemSource = this.getElementById('problem-source')!;
|
||||
const problemSourceHelpText = this.getElementById('problem-source-help-text')!;
|
||||
const descriptionTitle = this.getElementById('issue-description-label')!;
|
||||
const descriptionSubtitle = this.getElementById('issue-description-subtitle')!;
|
||||
const extensionSelector = this.getElementById('extension-selection')!;
|
||||
|
||||
// Hide all by default
|
||||
hide(blockContainer);
|
||||
@@ -733,7 +743,7 @@ export class IssueReporter extends Disposable {
|
||||
}
|
||||
|
||||
private validateInput(inputId: string): boolean {
|
||||
const inputElement = (<HTMLInputElement>document.getElementById(inputId));
|
||||
const inputElement = (<HTMLInputElement>this.getElementById(inputId));
|
||||
if (!inputElement.value) {
|
||||
inputElement.classList.add('invalid-input');
|
||||
return false;
|
||||
@@ -765,16 +775,16 @@ export class IssueReporter extends Disposable {
|
||||
(<HTMLInputElement>invalidInput[0]).focus();
|
||||
}
|
||||
|
||||
document.getElementById('issue-title').addEventListener('input', (event) => {
|
||||
this.addEventListener('issue-title', 'input', _ => {
|
||||
this.validateInput('issue-title');
|
||||
});
|
||||
|
||||
document.getElementById('description').addEventListener('input', (event) => {
|
||||
this.addEventListener('description', 'input', _ => {
|
||||
this.validateInput('description');
|
||||
});
|
||||
|
||||
if (this.issueReporterModel.fileOnExtension()) {
|
||||
document.getElementById('extension-selector').addEventListener('change', (event) => {
|
||||
this.addEventListener('extension-selector', 'change', _ => {
|
||||
this.validateInput('extension-selector');
|
||||
});
|
||||
}
|
||||
@@ -791,7 +801,7 @@ export class IssueReporter extends Disposable {
|
||||
this.telemetryService.publicLog('issueReporterSubmit', { issueType: this.issueReporterModel.getData().issueType, numSimilarIssuesDisplayed: this.numberOfSearchResultsDisplayed });
|
||||
this.hasBeenSubmitted = true;
|
||||
|
||||
const baseUrl = this.getIssueUrlWithTitle((<HTMLInputElement>document.getElementById('issue-title')).value);
|
||||
const baseUrl = this.getIssueUrlWithTitle((<HTMLInputElement>this.getElementById('issue-title')).value);
|
||||
const issueBody = this.issueReporterModel.serialize();
|
||||
let url = baseUrl + `&body=${encodeURIComponent(issueBody)}`;
|
||||
|
||||
@@ -834,19 +844,21 @@ export class IssueReporter extends Disposable {
|
||||
|
||||
private updateSystemInfo = (state) => {
|
||||
const target = document.querySelector('.block-system .block-info');
|
||||
let tableHtml = '';
|
||||
Object.keys(state.systemInfo).forEach(k => {
|
||||
const data = typeof state.systemInfo[k] === 'object'
|
||||
? Object.keys(state.systemInfo[k]).map(key => `${key}: ${state.systemInfo[k][key]}`).join('<br>')
|
||||
: state.systemInfo[k];
|
||||
if (target) {
|
||||
let tableHtml = '';
|
||||
Object.keys(state.systemInfo).forEach(k => {
|
||||
const data = typeof state.systemInfo[k] === 'object'
|
||||
? Object.keys(state.systemInfo[k]).map(key => `${key}: ${state.systemInfo[k][key]}`).join('<br>')
|
||||
: state.systemInfo[k];
|
||||
|
||||
tableHtml += `
|
||||
<tr>
|
||||
<td>${k}</td>
|
||||
<td>${data}</td>
|
||||
</tr>`;
|
||||
});
|
||||
target.innerHTML = `<table>${tableHtml}</table>`;
|
||||
tableHtml += `
|
||||
<tr>
|
||||
<td>${k}</td>
|
||||
<td>${data}</td>
|
||||
</tr>`;
|
||||
});
|
||||
target.innerHTML = `<table>${tableHtml}</table>`;
|
||||
}
|
||||
}
|
||||
|
||||
private updateExtensionSelector(extensions: IssueReporterExtensionData[]): void {
|
||||
@@ -878,64 +890,70 @@ export class IssueReporter extends Disposable {
|
||||
});
|
||||
|
||||
const makeOption = (extension: IOption) => `<option value="${extension.id}">${escape(extension.name)}</option>`;
|
||||
const extensionsSelector = document.getElementById('extension-selector');
|
||||
extensionsSelector.innerHTML = '<option></option>' + extensionOptions.map(makeOption).join('\n');
|
||||
const extensionsSelector = this.getElementById('extension-selector');
|
||||
if (extensionsSelector) {
|
||||
extensionsSelector.innerHTML = '<option></option>' + extensionOptions.map(makeOption).join('\n');
|
||||
|
||||
this.addEventListener('extension-selector', 'change', (e: Event) => {
|
||||
const selectedExtensionId = (<HTMLInputElement>e.target).value;
|
||||
const extensions = this.issueReporterModel.getData().allExtensions;
|
||||
const matches = extensions.filter(extension => extension.id === selectedExtensionId);
|
||||
if (matches.length) {
|
||||
this.issueReporterModel.update({ selectedExtension: matches[0] });
|
||||
this.addEventListener('extension-selector', 'change', (e: Event) => {
|
||||
const selectedExtensionId = (<HTMLInputElement>e.target).value;
|
||||
const extensions = this.issueReporterModel.getData().allExtensions;
|
||||
const matches = extensions.filter(extension => extension.id === selectedExtensionId);
|
||||
if (matches.length) {
|
||||
this.issueReporterModel.update({ selectedExtension: matches[0] });
|
||||
|
||||
const title = (<HTMLInputElement>document.getElementById('issue-title')).value;
|
||||
this.searchExtensionIssues(title);
|
||||
} else {
|
||||
this.issueReporterModel.update({ selectedExtension: null });
|
||||
this.clearSearchResults();
|
||||
}
|
||||
});
|
||||
const title = (<HTMLInputElement>this.getElementById('issue-title')).value;
|
||||
this.searchExtensionIssues(title);
|
||||
} else {
|
||||
this.issueReporterModel.update({ selectedExtension: undefined });
|
||||
this.clearSearchResults();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private updateProcessInfo = (state) => {
|
||||
const target = document.querySelector('.block-process .block-info');
|
||||
target.innerHTML = `<code>${state.processInfo}</code>`;
|
||||
if (target) {
|
||||
target.innerHTML = `<code>${state.processInfo}</code>`;
|
||||
}
|
||||
}
|
||||
|
||||
private updateWorkspaceInfo = (state) => {
|
||||
document.querySelector('.block-workspace .block-info code').textContent = '\n' + state.workspaceInfo;
|
||||
document.querySelector('.block-workspace .block-info code')!.textContent = '\n' + state.workspaceInfo;
|
||||
}
|
||||
|
||||
private updateExtensionTable(extensions: IssueReporterExtensionData[], numThemeExtensions: number): void {
|
||||
const target = document.querySelector('.block-extensions .block-info');
|
||||
if (target) {
|
||||
if (this.environmentService.disableExtensions) {
|
||||
target.innerHTML = localize('disabledExtensions', "Extensions are disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.environmentService.disableExtensions) {
|
||||
target.innerHTML = localize('disabledExtensions', "Extensions are disabled");
|
||||
return;
|
||||
const themeExclusionStr = numThemeExtensions ? `\n(${numThemeExtensions} theme extensions excluded)` : '';
|
||||
extensions = extensions || [];
|
||||
|
||||
if (!extensions.length) {
|
||||
target.innerHTML = 'Extensions: none' + themeExclusionStr;
|
||||
return;
|
||||
}
|
||||
|
||||
const table = this.getExtensionTableHtml(extensions);
|
||||
target.innerHTML = `<table>${table}</table>${themeExclusionStr}`;
|
||||
}
|
||||
|
||||
const themeExclusionStr = numThemeExtensions ? `\n(${numThemeExtensions} theme extensions excluded)` : '';
|
||||
extensions = extensions || [];
|
||||
|
||||
if (!extensions.length) {
|
||||
target.innerHTML = 'Extensions: none' + themeExclusionStr;
|
||||
return;
|
||||
}
|
||||
|
||||
const table = this.getExtensionTableHtml(extensions);
|
||||
target.innerHTML = `<table>${table}</table>${themeExclusionStr}`;
|
||||
}
|
||||
|
||||
private updateSearchedExtensionTable(extensions: IssueReporterExtensionData[]): void {
|
||||
const target = document.querySelector('.block-searchedExtensions .block-info');
|
||||
if (target) {
|
||||
if (!extensions.length) {
|
||||
target.innerHTML = 'Extensions: none';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!extensions.length) {
|
||||
target.innerHTML = 'Extensions: none';
|
||||
return;
|
||||
const table = this.getExtensionTableHtml(extensions);
|
||||
target.innerHTML = `<table>${table}</table>`;
|
||||
}
|
||||
|
||||
const table = this.getExtensionTableHtml(extensions);
|
||||
target.innerHTML = `<table>${table}</table>`;
|
||||
}
|
||||
|
||||
private getExtensionTableHtml(extensions: IssueReporterExtensionData[]): string {
|
||||
@@ -972,19 +990,28 @@ export class IssueReporter extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private addEventListener(elementId: string, eventType: string, handler: (event: Event) => void): void {
|
||||
private getElementById(elementId: string): HTMLElement | undefined {
|
||||
const element = document.getElementById(elementId);
|
||||
if (element) {
|
||||
element.addEventListener(eventType, handler);
|
||||
return element;
|
||||
} else {
|
||||
const error = new Error(`${elementId} not found.`);
|
||||
this.logService.error(error);
|
||||
/* __GDPR__
|
||||
"issueReporterAddEventListenerError" : {
|
||||
"issueReporterGetElementError" : {
|
||||
"message" : { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('issueReporterAddEventListenerError', { message: error.message });
|
||||
this.telemetryService.publicLog('issueReporterGetElementError', { message: error.message });
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
private addEventListener(elementId: string, eventType: string, handler: (event: Event) => void): void {
|
||||
const element = this.getElementById(elementId);
|
||||
if (element) {
|
||||
element.addEventListener(eventType, handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { assign } from 'vs/base/common/objects';
|
||||
import { IssueType, ISettingSearchResult, IssueReporterExtensionData } from 'vs/platform/issue/common/issue';
|
||||
|
||||
export interface IssueReporterData {
|
||||
issueType?: IssueType;
|
||||
issueType: IssueType;
|
||||
issueDescription?: string;
|
||||
|
||||
versionInfo?: any;
|
||||
@@ -15,15 +15,15 @@ export interface IssueReporterData {
|
||||
processInfo?: any;
|
||||
workspaceInfo?: any;
|
||||
|
||||
includeSystemInfo?: boolean;
|
||||
includeWorkspaceInfo?: boolean;
|
||||
includeProcessInfo?: boolean;
|
||||
includeExtensions?: boolean;
|
||||
includeSearchedExtensions?: boolean;
|
||||
includeSettingsSearchDetails?: boolean;
|
||||
includeSystemInfo: boolean;
|
||||
includeWorkspaceInfo: boolean;
|
||||
includeProcessInfo: boolean;
|
||||
includeExtensions: boolean;
|
||||
includeSearchedExtensions: boolean;
|
||||
includeSettingsSearchDetails: boolean;
|
||||
|
||||
numberOfThemeExtesions?: number;
|
||||
allExtensions?: IssueReporterExtensionData[];
|
||||
allExtensions: IssueReporterExtensionData[];
|
||||
enabledNonThemeExtesions?: IssueReporterExtensionData[];
|
||||
extensionsDisabled?: boolean;
|
||||
fileOnExtension?: boolean;
|
||||
@@ -36,14 +36,16 @@ export interface IssueReporterData {
|
||||
export class IssueReporterModel {
|
||||
private _data: IssueReporterData;
|
||||
|
||||
constructor(initialData?: IssueReporterData) {
|
||||
constructor(initialData?: Partial<IssueReporterData>) {
|
||||
const defaultData = {
|
||||
issueType: IssueType.Bug,
|
||||
includeSystemInfo: true,
|
||||
includeWorkspaceInfo: true,
|
||||
includeProcessInfo: true,
|
||||
includeExtensions: true,
|
||||
includeSearchedExtensions: true,
|
||||
includeSettingsSearchDetails: true
|
||||
includeSettingsSearchDetails: true,
|
||||
allExtensions: []
|
||||
};
|
||||
|
||||
this._data = initialData ? assign(defaultData, initialData) : defaultData;
|
||||
@@ -53,7 +55,7 @@ export class IssueReporterModel {
|
||||
return this._data;
|
||||
}
|
||||
|
||||
update(newData: IssueReporterData): void {
|
||||
update(newData: Partial<IssueReporterData>): void {
|
||||
assign(this._data, newData);
|
||||
}
|
||||
|
||||
@@ -103,7 +105,7 @@ ${this.getInfos()}
|
||||
let info = '';
|
||||
|
||||
if (this._data.issueType === IssueType.Bug || this._data.issueType === IssueType.PerformanceIssue) {
|
||||
if (this._data.includeSystemInfo) {
|
||||
if (this._data.includeSystemInfo && this._data.systemInfo) {
|
||||
info += this.generateSystemInfoMd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,9 +64,9 @@ export default (): string => `
|
||||
<div class="block block-system">
|
||||
<input class="sendData" type="checkbox" id="includeSystemInfo" checked/>
|
||||
<label class="caption" for="includeSystemInfo">${escape(localize({
|
||||
key: 'sendSystemInfo',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the system information']
|
||||
}, "Include my system information ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
key: 'sendSystemInfo',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the system information']
|
||||
}, "Include my system information ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
<div class="block-info hidden">
|
||||
<!-- To be dynamically filled -->
|
||||
</div>
|
||||
@@ -74,9 +74,9 @@ export default (): string => `
|
||||
<div class="block block-process">
|
||||
<input class="sendData" type="checkbox" id="includeProcessInfo" checked/>
|
||||
<label class="caption" for="includeProcessInfo">${escape(localize({
|
||||
key: 'sendProcessInfo',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the process info']
|
||||
}, "Include my currently running processes ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
key: 'sendProcessInfo',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the process info']
|
||||
}, "Include my currently running processes ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
<pre class="block-info hidden">
|
||||
<code>
|
||||
<!-- To be dynamically filled -->
|
||||
@@ -86,9 +86,9 @@ export default (): string => `
|
||||
<div class="block block-workspace">
|
||||
<input class="sendData" type="checkbox" id="includeWorkspaceInfo" checked/>
|
||||
<label class="caption" for="includeWorkspaceInfo">${escape(localize({
|
||||
key: 'sendWorkspaceInfo',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the workspace information']
|
||||
}, "Include my workspace metadata ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
key: 'sendWorkspaceInfo',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the workspace information']
|
||||
}, "Include my workspace metadata ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
<pre id="systemInfo" class="block-info hidden">
|
||||
<code>
|
||||
<!-- To be dynamically filled -->
|
||||
@@ -98,9 +98,9 @@ export default (): string => `
|
||||
<div class="block block-extensions">
|
||||
<input class="sendData" type="checkbox" id="includeExtensions" checked/>
|
||||
<label class="caption" for="includeExtensions">${escape(localize({
|
||||
key: 'sendExtensions',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the enabled extensions list']
|
||||
}, "Include my enabled extensions ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
key: 'sendExtensions',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty of the enabled extensions list']
|
||||
}, "Include my enabled extensions ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
<div id="systemInfo" class="block-info hidden">
|
||||
<!-- To be dynamically filled -->
|
||||
</div>
|
||||
@@ -108,9 +108,9 @@ export default (): string => `
|
||||
<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 visibililty of the searched extensions']
|
||||
}, "Send searched extensions ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
key: 'sendSearchedExtensions',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty 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">
|
||||
<!-- To be dynamically filled -->
|
||||
</div>
|
||||
@@ -118,9 +118,9 @@ export default (): string => `
|
||||
<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 visibililty of the search details']
|
||||
}, "Send settings search details ({0})")).replace('{0}', `<a href="#" class="showInfo">${escape(localize('show', "show"))}</a>`)}</label>
|
||||
key: 'sendSettingsSearchDetails',
|
||||
comment: ['{0} is either "show" or "hide" and is a button to toggle the visibililty 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>
|
||||
|
||||
@@ -86,16 +86,32 @@ select {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
textarea {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif;
|
||||
textarea, input, select {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
|
||||
color: #CCCCCC;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
html:lang(zh-Hans) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(zh-Hant) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(ja) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(ko) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
overflow-y: scroll;
|
||||
@@ -112,7 +128,6 @@ body {
|
||||
|
||||
.block .block-info {
|
||||
width: 100%;
|
||||
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
overflow-wrap: break-word;
|
||||
@@ -120,10 +135,6 @@ body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
pre code {
|
||||
font-family: Monaco, Menlo, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";
|
||||
}
|
||||
|
||||
#issue-reporter {
|
||||
max-width: 85vw;
|
||||
margin-left: auto;
|
||||
|
||||
@@ -13,28 +13,30 @@ suite('IssueReporter', () => {
|
||||
test('sets defaults to include all data', () => {
|
||||
const issueReporterModel = new IssueReporterModel();
|
||||
assert.deepEqual(issueReporterModel.getData(), {
|
||||
allExtensions: [],
|
||||
includeSystemInfo: true,
|
||||
includeWorkspaceInfo: true,
|
||||
includeProcessInfo: true,
|
||||
includeExtensions: true,
|
||||
includeSearchedExtensions: true,
|
||||
includeSettingsSearchDetails: true
|
||||
includeSettingsSearchDetails: true,
|
||||
issueType: 0
|
||||
});
|
||||
});
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
test('serializes model skeleton when no data is provided', () => {
|
||||
const issueReporterModel = new IssueReporterModel();
|
||||
const issueReporterModel = new IssueReporterModel({});
|
||||
assert.equal(issueReporterModel.serialize(),
|
||||
`
|
||||
Issue Type: <b>Feature Request</b>
|
||||
Issue Type: <b>Bug</b>
|
||||
|
||||
undefined
|
||||
|
||||
Azure Data Studio version: undefined
|
||||
OS version: undefined
|
||||
|
||||
|
||||
Extensions: none
|
||||
<!-- generated by issue reporter -->`);
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,27 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
html,
|
||||
html {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
html:lang(zh-Hans) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(zh-Hant) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(ja) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(ko) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -12,8 +32,6 @@ body {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
@@ -38,7 +56,7 @@ table {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
}
|
||||
th {
|
||||
th[scope='col'] {
|
||||
vertical-align: bottom;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
padding: .5rem;
|
||||
@@ -62,6 +80,9 @@ td {
|
||||
.data {
|
||||
white-space: pre;
|
||||
padding-left: .5rem;
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
tbody > tr:hover {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
|
||||
<body aria-label="">
|
||||
<table id="process-list" aria-live="polite"></table>
|
||||
<table id="process-list"></table>
|
||||
</body>
|
||||
|
||||
<!-- Startup via processExplorer.js -->
|
||||
|
||||
@@ -96,7 +96,7 @@ function attachTo(item: ProcessItem) {
|
||||
config.port = parseInt(matches[2]);
|
||||
}
|
||||
|
||||
ipcRenderer.send('vscode:workbenchCommand', { id: 'workbench.action.debug.start', from: 'processExplorer', args: [config] });
|
||||
ipcRenderer.send('vscode:workbenchCommand', { id: 'debug.startFromConfig', from: 'processExplorer', args: [config] });
|
||||
}
|
||||
|
||||
function getProcessIdWithHighestProperty(processList, propertyName: string) {
|
||||
@@ -113,42 +113,56 @@ function getProcessIdWithHighestProperty(processList, propertyName: string) {
|
||||
}
|
||||
|
||||
function updateProcessInfo(processList): void {
|
||||
const target = document.getElementById('process-list');
|
||||
if (!target) {
|
||||
const container = document.getElementById('process-list');
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
|
||||
container.innerHTML = '';
|
||||
const highestCPUProcess = getProcessIdWithHighestProperty(processList, 'cpu');
|
||||
const highestMemoryProcess = getProcessIdWithHighestProperty(processList, 'memory');
|
||||
|
||||
let tableHtml = `
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="cpu">${localize('cpu', "CPU %")}</th>
|
||||
<th scope="col" class="memory">${localize('memory', "Memory (MB)")}</th>
|
||||
<th scope="col" class="pid">${localize('pid', "pid")}</th>
|
||||
<th scope="col" class="nameLabel">${localize('name', "Name")}</th>
|
||||
</tr>
|
||||
</thead>`;
|
||||
const tableHead = document.createElement('thead');
|
||||
tableHead.innerHTML = `<tr>
|
||||
<th scope="col" class="cpu">${localize('cpu', "CPU %")}</th>
|
||||
<th scope="col" class="memory">${localize('memory', "Memory (MB)")}</th>
|
||||
<th scope="col" class="pid">${localize('pid', "pid")}</th>
|
||||
<th scope="col" class="nameLabel">${localize('name', "Name")}</th>
|
||||
</tr>`;
|
||||
|
||||
tableHtml += `<tbody>`;
|
||||
const tableBody = document.createElement('tbody');
|
||||
|
||||
processList.forEach(p => {
|
||||
const cpuClass = p.pid === highestCPUProcess ? 'highest' : '';
|
||||
const memoryClass = p.pid === highestMemoryProcess ? 'highest' : '';
|
||||
const row = document.createElement('tr');
|
||||
row.id = p.pid;
|
||||
|
||||
tableHtml += `
|
||||
<tr id=${p.pid}>
|
||||
<td class="centered ${cpuClass}">${p.cpu}</td>
|
||||
<td class="centered ${memoryClass}">${p.memory}</td>
|
||||
<td class="centered">${p.pid}</td>
|
||||
<td title="${p.name}" class="data">${p.formattedName}</td>
|
||||
</tr>`;
|
||||
const cpu = document.createElement('td');
|
||||
p.pid === highestCPUProcess
|
||||
? cpu.classList.add('centered', 'highest')
|
||||
: cpu.classList.add('centered');
|
||||
cpu.textContent = p.cpu;
|
||||
|
||||
const memory = document.createElement('td');
|
||||
p.pid === highestMemoryProcess
|
||||
? memory.classList.add('centered', 'highest')
|
||||
: memory.classList.add('centered');
|
||||
memory.textContent = p.memory;
|
||||
|
||||
const pid = document.createElement('td');
|
||||
pid.classList.add('centered');
|
||||
pid.textContent = p.pid;
|
||||
|
||||
const name = document.createElement('th');
|
||||
name.scope = 'row';
|
||||
name.classList.add('data');
|
||||
name.title = p.cmd;
|
||||
name.textContent = p.formattedName;
|
||||
|
||||
row.append(cpu, memory, pid, name);
|
||||
tableBody.appendChild(row);
|
||||
});
|
||||
|
||||
tableHtml += `</tbody>`;
|
||||
|
||||
target.innerHTML = tableHtml;
|
||||
container.append(tableHead, tableBody);
|
||||
}
|
||||
|
||||
function applyStyles(styles: ProcessExplorerStyles): void {
|
||||
@@ -171,7 +185,9 @@ function applyStyles(styles: ProcessExplorerStyles): void {
|
||||
if (document.head) {
|
||||
document.head.appendChild(styleTag);
|
||||
}
|
||||
document.body.style.color = styles.color;
|
||||
if (styles.color) {
|
||||
document.body.style.color = styles.color;
|
||||
}
|
||||
}
|
||||
|
||||
function applyZoom(zoomLevel: number): void {
|
||||
@@ -297,4 +313,4 @@ export function startup(data: ProcessExplorerData): void {
|
||||
applyZoom(webFrame.getZoomLevel() - 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback";
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
|
||||
font-size: 10pt;
|
||||
background-color: #F3F3F3;
|
||||
}
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
|
||||
input {
|
||||
font-family: "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback" !important;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -8,11 +8,13 @@ import { LanguagePackCachedDataCleaner } from 'vs/code/electron-browser/sharedPr
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
import { StorageDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner';
|
||||
import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner';
|
||||
|
||||
export function createSharedProcessContributions(service: IInstantiationService): IDisposable {
|
||||
return combinedDisposable([
|
||||
service.createInstance(NodeCachedDataCleaner),
|
||||
service.createInstance(LanguagePackCachedDataCleaner),
|
||||
service.createInstance(StorageDataCleaner)
|
||||
service.createInstance(StorageDataCleaner),
|
||||
service.createInstance(LogsDataCleaner)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ export class LanguagePackCachedDataCleaner {
|
||||
|
||||
this._disposables.push({
|
||||
dispose() {
|
||||
if (handle !== void 0) {
|
||||
if (handle !== undefined) {
|
||||
clearTimeout(handle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { join, dirname, basename } from 'path';
|
||||
import { readdir, rimraf } from 'vs/base/node/pfs';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class LogsDataCleaner extends Disposable {
|
||||
|
||||
constructor(
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService
|
||||
) {
|
||||
super();
|
||||
|
||||
this.cleanUpOldLogsSoon();
|
||||
}
|
||||
|
||||
private cleanUpOldLogsSoon(): void {
|
||||
let handle: any = setTimeout(() => {
|
||||
handle = undefined;
|
||||
|
||||
const currentLog = basename(this.environmentService.logsPath);
|
||||
const logsRoot = dirname(this.environmentService.logsPath);
|
||||
|
||||
readdir(logsRoot).then(children => {
|
||||
const allSessions = children.filter(name => /^\d{8}T\d{6}$/.test(name));
|
||||
const oldSessions = allSessions.sort().filter((d, i) => d !== currentLog);
|
||||
const toDelete = oldSessions.slice(0, Math.max(0, oldSessions.length - 9));
|
||||
|
||||
return Promise.all(toDelete.map(name => rimraf(join(logsRoot, name))));
|
||||
}).then(null, onUnexpectedError);
|
||||
}, 10 * 1000);
|
||||
|
||||
this._register(toDisposable(() => clearTimeout(handle)));
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export class NodeCachedDataCleaner {
|
||||
readdir(nodeCachedDataRootDir).then(entries => {
|
||||
|
||||
const now = Date.now();
|
||||
const deletes: Thenable<any>[] = [];
|
||||
const deletes: Promise<any>[] = [];
|
||||
|
||||
entries.forEach(entry => {
|
||||
// name check
|
||||
|
||||
@@ -16,7 +16,7 @@ export class StorageDataCleaner extends Disposable {
|
||||
private static NON_EMPTY_WORKSPACE_ID_LENGTH = 128 / 4;
|
||||
|
||||
constructor(
|
||||
@IEnvironmentService private environmentService: IEnvironmentService
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -25,7 +25,7 @@ export class StorageDataCleaner extends Disposable {
|
||||
|
||||
private cleanUpStorageSoon(): void {
|
||||
let handle: any = setTimeout(() => {
|
||||
handle = void 0;
|
||||
handle = undefined;
|
||||
|
||||
// Leverage the backup workspace file to find out which empty workspace is currently in use to
|
||||
// determine which empty workspace storage can safely be deleted
|
||||
|
||||
@@ -43,7 +43,6 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { DownloadService } from 'vs/platform/download/node/downloadService';
|
||||
import { IDownloadService } from 'vs/platform/download/common/download';
|
||||
import { StaticRouter } from 'vs/base/parts/ipc/node/ipc';
|
||||
import { DefaultURITransformer } from 'vs/base/common/uriIpc';
|
||||
|
||||
export interface ISharedProcessConfiguration {
|
||||
readonly machineId: string;
|
||||
@@ -124,7 +123,7 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
|
||||
}
|
||||
server.registerChannel('telemetryAppender', new TelemetryAppenderChannel(appInsightsAppender));
|
||||
|
||||
services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService));
|
||||
services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService, [false]));
|
||||
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService));
|
||||
services.set(ILocalizationsService, new SyncDescriptor(LocalizationsService));
|
||||
|
||||
@@ -133,7 +132,7 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
|
||||
instantiationService2.invokeFunction(accessor => {
|
||||
|
||||
const extensionManagementService = accessor.get(IExtensionManagementService);
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, () => DefaultURITransformer);
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, () => null);
|
||||
server.registerChannel('extensions', channel);
|
||||
|
||||
// clean up deprecated extensions
|
||||
@@ -149,8 +148,8 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
|
||||
});
|
||||
}
|
||||
|
||||
function setupIPC(hook: string): Thenable<Server> {
|
||||
function setup(retry: boolean): Thenable<Server> {
|
||||
function setupIPC(hook: string): Promise<Server> {
|
||||
function setup(retry: boolean): Promise<Server> {
|
||||
return serve(hook).then(null, err => {
|
||||
if (!retry || platform.isWindows || err.code !== 'EADDRINUSE') {
|
||||
return Promise.reject(err);
|
||||
|
||||
@@ -50,7 +50,7 @@ bootstrapWindow.load([
|
||||
showPartsSplash(windowConfig);
|
||||
},
|
||||
beforeLoaderConfig: function (windowConfig, loaderConfig) {
|
||||
loaderConfig.recordStats = !!windowConfig.performance;
|
||||
loaderConfig.recordStats = !!windowConfig['prof-modules'];
|
||||
if (loaderConfig.nodeCachedData) {
|
||||
const onNodeCachedData = window['MonacoEnvironment'].onNodeCachedData = [];
|
||||
loaderConfig.nodeCachedData.onData = function () {
|
||||
@@ -72,15 +72,7 @@ function showPartsSplash(configuration) {
|
||||
|
||||
let data;
|
||||
try {
|
||||
if (!process.env['VSCODE_TEST_STORAGE_MIGRATION']) {
|
||||
// TODO@Ben remove me after a while
|
||||
perf.mark('willReadLocalStorage');
|
||||
let raw = window.localStorage.getItem('storage://global/parts-splash-data');
|
||||
perf.mark('didReadLocalStorage');
|
||||
data = JSON.parse(raw);
|
||||
} else {
|
||||
data = JSON.parse(configuration.partsSplashData);
|
||||
}
|
||||
data = JSON.parse(configuration.partsSplashData);
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user