提交 a529259e 编写于 作者: A Adrian 提交者: Benjamin Pasero

Modifying report issues url to include command line options and smarter extensions table (#33225)

* Added arguments to generated issue url

* extensions are disabled message on report issue

* remove arguments from issue report
上级 e070afce
......@@ -897,7 +897,8 @@ export class ReportIssueAction extends Action {
id: string,
label: string,
@IIntegrityService private integrityService: IIntegrityService,
@IExtensionManagementService private extensionManagementService: IExtensionManagementService
@IExtensionManagementService private extensionManagementService: IExtensionManagementService,
@IEnvironmentService private environmentService: IEnvironmentService
) {
super(id, label);
}
......@@ -916,7 +917,7 @@ export class ReportIssueAction extends Action {
public run(): TPromise<boolean> {
return this._optimisticIsPure().then(isPure => {
return this.extensionManagementService.getInstalled(LocalExtensionType.User).then(extensions => {
const issueUrl = this.generateNewIssueUrl(product.reportIssueUrl, pkg.name, pkg.version, product.commit, product.date, isPure, extensions);
const issueUrl = this.generateNewIssueUrl(product.reportIssueUrl, pkg.name, pkg.version, product.commit, product.date, isPure, extensions, this.environmentService.disableExtensions);
window.open(issueUrl);
......@@ -925,14 +926,14 @@ export class ReportIssueAction extends Action {
});
}
private generateNewIssueUrl(baseUrl: string, name: string, version: string, commit: string, date: string, isPure: boolean, extensions: ILocalExtension[]): string {
private generateNewIssueUrl(baseUrl: string, name: string, version: string, commit: string, date: string, isPure: boolean, extensions: ILocalExtension[], areExtensionsDisabled: boolean): string {
// Avoid backticks, these can trigger XSS detectors. (https://github.com/Microsoft/vscode/issues/13098)
const osVersion = `${os.type()} ${os.arch()} ${os.release()}`;
const queryStringPrefix = baseUrl.indexOf('?') === -1 ? '?' : '&';
const body = encodeURIComponent(
`- VSCode Version: ${name} ${version}${isPure ? '' : ' **[Unsupported]**'} (${product.commit || 'Commit unknown'}, ${product.date || 'Date unknown'})
- OS Version: ${osVersion}
- Extensions: ${this.generateExtensionTable(extensions)}
- Extensions: ${areExtensionsDisabled ? 'Extensions are disabled' : this.generateExtensionTable(extensions)}
---
Steps to Reproduce:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册