Merge branch 'master' into rmacfarlane/disable-extensions

This commit is contained in:
Benjamin Pasero
2018-02-21 06:42:11 +01:00
committed by GitHub
488 changed files with 7967 additions and 4536 deletions

View File

@@ -146,6 +146,8 @@ function main() {
// In the bundled version the nls plugin is packaged with the loader so the NLS Plugins
// loads as soon as the loader loads. To be able to have pseudo translation
createScript(rootUrl + '/vs/loader.js', function () {
var define = global.define;
global.define = undefined;
define('fs', ['original-fs'], function (originalFS) { return originalFS; }); // replace the patched electron fs with the original node fs for all AMD code
window.MonacoEnvironment = {};

View File

@@ -66,8 +66,7 @@ export class IssueReporter extends Disposable {
private telemetryService: ITelemetryService;
private logService: ILogService;
private issueReporterModel: IssueReporterModel;
private shouldQueueSearch = true;
private features: IssueReporterFeatures;
private numberOfSearchResultsDisplayed = 0;
private receivedSystemInfo = false;
private receivedPerformanceInfo = false;
@@ -85,8 +84,6 @@ export class IssueReporter extends Disposable {
extensionsDisabled: this.environmentService.disableExtensions,
});
this.features = configuration.features;
ipcRenderer.on('issuePerformanceInfoResponse', (event, info) => {
this.logService.trace('issueReporter: Received performance data');
this.issueReporterModel.update(info);
@@ -187,15 +184,15 @@ export class IssueReporter extends Disposable {
}
if (styles.sliderBackgroundColor) {
content.push(`.issues-container::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb { background-color: ${styles.sliderBackgroundColor}; }`);
content.push(`::-webkit-scrollbar-thumb { background-color: ${styles.sliderBackgroundColor}; }`);
}
if (styles.sliderActiveColor) {
content.push(`.issues-container::-webkit-scrollbar-thumb:active, body::-webkit-scrollbar-thumb:active { background-color: ${styles.sliderActiveColor}; }`);
content.push(`::-webkit-scrollbar-thumb:active { background-color: ${styles.sliderActiveColor}; }`);
}
if (styles.sliderHoverColor) {
content.push(`.issues-container::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background-color: ${styles.sliderHoverColor}; }`);
content.push(`::--webkit-scrollbar-thumb:hover { background-color: ${styles.sliderHoverColor}; }`);
}
styleTag.innerHTML = content.join('\n');
@@ -337,13 +334,23 @@ export class IssueReporter extends Disposable {
const issueDescription = (<HTMLInputElement>event.target).value;
this.issueReporterModel.update({ issueDescription });
if (this.features.useDuplicateSearch) {
const title = (<HTMLInputElement>document.getElementById('issue-title')).value;
const title = (<HTMLInputElement>document.getElementById('issue-title')).value;
if (title || issueDescription) {
this.searchDuplicates(title, issueDescription);
} else {
this.clearSearchResults();
}
});
document.getElementById('issue-title').addEventListener('input', (e) => { this.searchIssues(e); });
document.getElementById('issue-title').addEventListener('input', (e) => {
const description = this.issueReporterModel.getData().issueDescription;
const title = (<HTMLInputElement>event.target).value;
if (title || description) {
this.searchDuplicates(title, description);
} else {
this.clearSearchResults();
}
});
document.getElementById('github-submit-btn').addEventListener('click', () => this.createIssue());
@@ -425,24 +432,10 @@ export class IssueReporter extends Disposable {
return false;
}
@debounce(300)
private searchIssues(event: Event): void {
const title = (<HTMLInputElement>event.target).value;
if (title) {
if (this.features.useDuplicateSearch) {
const description = this.issueReporterModel.getData().issueDescription;
this.searchDuplicates(title, description);
} else {
this.searchGitHub(title);
}
} else {
this.clearSearchResults();
}
}
private clearSearchResults(): void {
const similarIssues = document.getElementById('similar-issues');
similarIssues.innerHTML = '';
this.numberOfSearchResultsDisplayed = 0;
}
@debounce(300)
@@ -476,53 +469,17 @@ export class IssueReporter extends Disposable {
});
}
private searchGitHub(title: string): void {
const query = `is:issue+repo:microsoft/vscode+${title}`;
const similarIssues = document.getElementById('similar-issues');
window.fetch(`https://api.github.com/search/issues?q=${query}`).then((response) => {
response.json().then(result => {
similarIssues.innerHTML = '';
if (result && result.items) {
this.displaySearchResults(result.items);
} else {
// If the items property isn't present, the rate limit has been hit
const message = $('div.list-title');
message.textContent = localize('rateLimited', "GitHub query limit exceeded. Please wait.");
similarIssues.appendChild(message);
const resetTime = response.headers.get('X-RateLimit-Reset');
const timeToWait = parseInt(resetTime) - Math.floor(Date.now() / 1000);
if (this.shouldQueueSearch) {
this.shouldQueueSearch = false;
setTimeout(() => {
this.searchGitHub(title);
this.shouldQueueSearch = true;
}, timeToWait * 1000);
}
throw new Error(result.message);
}
}).catch((error) => {
this.logSearchError(error);
});
}).catch((error) => {
this.logSearchError(error);
});
}
private displaySearchResults(results: SearchResult[]) {
const similarIssues = document.getElementById('similar-issues');
if (results.length) {
const hasIssueState = results.every(result => !!result.state);
const issues = hasIssueState ? $('div.issues-container') : $('ul.issues-container');
const issues = $('div.issues-container');
const issuesText = $('div.list-title');
issuesText.textContent = localize('similarIssues', "Similar issues");
const numResultsToDisplay = results.length < 5 ? results.length : 5;
for (let i = 0; i < numResultsToDisplay; i++) {
this.numberOfSearchResultsDisplayed = results.length < 5 ? results.length : 5;
for (let i = 0; i < this.numberOfSearchResultsDisplayed; i++) {
const issue = results[i];
const link = issue.state ? $('a.issue-link', { href: issue.html_url }) : $('a', { href: issue.html_url });
const link = $('a.issue-link', { href: issue.html_url });
link.textContent = issue.title;
link.title = issue.title;
link.addEventListener('click', (e) => this.openLink(e));
@@ -544,7 +501,7 @@ export class IssueReporter extends Disposable {
issueState.appendChild(issueStateLabel);
}
const item = issue.state ? $('div.issue', {}, issueState, link) : $('li.issue', {}, link);
const item = $('div.issue', {}, issueState, link);
issues.appendChild(item);
}
@@ -561,7 +518,7 @@ export class IssueReporter extends Disposable {
this.logService.warn('issueReporter#search ', error.message);
/* __GDPR__
"issueReporterSearchError" : {
"message" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
"message" : { "classification": "CallstackOrException", "purpose": "PerformanceAndHealth" }
}
*/
this.telemetryService.publicLog('issueReporterSearchError', { message: error.message });
@@ -675,14 +632,13 @@ export class IssueReporter extends Disposable {
return false;
}
if (this.telemetryService) {
/* __GDPR__
"issueReporterSubmit" : {
"issueType" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('issueReporterSubmit', { issueType: this.issueReporterModel.getData().issueType });
}
/* __GDPR__
"issueReporterSubmit" : {
"issueType" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"numSimilarIssuesDisplayed" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('issueReporterSubmit', { issueType: this.issueReporterModel.getData().issueType, numSimilarIssuesDisplayed: this.numberOfSearchResultsDisplayed });
const issueTitle = encodeURIComponent((<HTMLInputElement>document.getElementById('issue-title')).value);
const queryStringPrefix = product.reportIssueUrl.indexOf('?') === -1 ? '?' : '&';
@@ -804,11 +760,9 @@ export class IssueReporter extends Disposable {
shell.openExternal((<HTMLAnchorElement>event.target).href);
/* __GDPR__
"issueReporterViewSimilarIssue" : {
"usingDuplicatesAPI" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
"issueReporterViewSimilarIssue" : { }
*/
this.telemetryService.publicLog('issueReporterViewSimilarIssue', { usingDuplicatesAPI: this.features.useDuplicateSearch });
this.telemetryService.publicLog('issueReporterViewSimilarIssue');
}
}
}

View File

@@ -61,19 +61,15 @@ export class IssueReporterModel {
serialize(): string {
return `
### Issue Type
${this.getIssueTypeTitle()}
### Description
Issue Type: ${this.getIssueTypeTitle()}
${this._data.issueDescription}
### VS Code Info
VS Code version: ${this._data.versionInfo && this._data.versionInfo.vscodeVersion}
OS version: ${this._data.versionInfo && this._data.versionInfo.os}
${this.getInfos()}`;
${this.getInfos()}
<!-- generated by issue reporter -->`;
}
private getIssueTypeTitle(): string {

View File

@@ -116,6 +116,7 @@ html {
body {
margin: 0;
overflow: scroll;
}
.hidden {
@@ -223,16 +224,11 @@ summary {
.include-data {
display: inline-block;
position: relative;
}
.include-data > .caption {
display: inline-block;
font-size: 12px;
position: absolute;
width: 80px;
top: 2px;
left: 30px;
cursor: pointer;
}
@@ -269,6 +265,7 @@ input:disabled {
.workbenchCommand:disabled {
color: #868e96;
cursor: default
}
.block-extensions .block-info {
@@ -306,6 +303,7 @@ button {
#issue-type {
width: calc(100% - 100px);
cursor: pointer;
}
#issue-title-label {
@@ -351,28 +349,25 @@ button {
}
}
.issues-container::-webkit-scrollbar, body::-webkit-scrollbar {
::-webkit-scrollbar {
width: 14px;
}
.issues-container::-webkit-scrollbar, body::-webkit-scrollbar-thumb {
::-webkit-scrollbar-thumb {
min-height: 20px;
}
::-webkit-scrollbar-corner {
display: none;
}
.issues-container {
margin-left: 1.5em;
margin-top: .5em;
height: 108px;
overflow-y: auto;
}
div.issues-container {
margin-left: 1.5em;
}
.issues-container > li.issue {
padding: 1px 0;
}
.issues-container > .issue {
padding: 4px 0;
}
@@ -400,4 +395,4 @@ div.issues-container {
.issues-container > .issue > .issue-state .octicon {
padding-right: 5px;
}
}

View File

@@ -27,18 +27,14 @@ suite('IssueReporter', () => {
const issueReporterModel = new IssueReporterModel();
assert.equal(issueReporterModel.serialize(),
`
### Issue Type
Feature Request
### Description
Issue Type: Feature Request
undefined
### VS Code Info
VS Code version: undefined
OS version: undefined
`);
<!-- generated by issue reporter -->`);
});
});

View File

@@ -131,6 +131,8 @@ function main() {
// In the bundled version the nls plugin is packaged with the loader so the NLS Plugins
// loads as soon as the loader loads. To be able to have pseudo translation
createScript(rootUrl + '/vs/loader.js', function () {
var define = global.define;
global.define = undefined;
define('fs', ['original-fs'], function (originalFS) { return originalFS; }); // replace the patched electron fs with the original node fs for all AMD code
window.MonacoEnvironment = {};

View File

@@ -30,8 +30,6 @@ import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProper
import { TelemetryAppenderChannel } from 'vs/platform/telemetry/common/telemetryIpc';
import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService';
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
import { IChoiceService } from 'vs/platform/message/common/message';
import { ChoiceChannelClient } from 'vs/platform/message/common/messageIpc';
import { IWindowsService } from 'vs/platform/windows/common/windows';
import { WindowsChannelClient } from 'vs/platform/windows/common/windowsIpc';
import { ipcRenderer } from 'electron';
@@ -43,6 +41,8 @@ import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
import { LocalizationsChannel } from 'vs/platform/localizations/common/localizationsIpc';
import { IChoiceService } from 'vs/platform/dialogs/common/dialogs';
import { ChoiceChannelClient } from 'vs/platform/dialogs/common/choiceIpc';
export interface ISharedProcessConfiguration {
readonly machineId: string;