Support 'workbench.action.openIssueReport' command in the web - directly open GitHub

This commit is contained in:
Rachel Macfarlane
2019-10-28 15:16:36 -07:00
parent c2565c31b7
commit bfa915d619
6 changed files with 118 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ import BaseHtml from 'vs/code/electron-browser/issue/issueReporterPage';
import { LoggerChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
import { ILogService, getLogLevel } from 'vs/platform/log/common/log';
import { CodiconLabel } from 'vs/base/browser/ui/codiconLabel/codiconLabel';
import { normalizeGitHubUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
import { normalizeGitHubUrl } from 'vs/code/common/issue/issueReporterUtil';
import { Button } from 'vs/base/browser/ui/button/button';
import { SystemInfo, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
import { SpdLogService } from 'vs/platform/log/node/spdlogService';

View File

@@ -1,26 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { endsWith, rtrim } from 'vs/base/common/strings';
export function normalizeGitHubUrl(url: string): string {
// If the url has a .git suffix, remove it
if (endsWith(url, '.git')) {
url = url.substr(0, url.length - 4);
}
// Remove trailing slash
url = rtrim(url, '/');
if (endsWith(url, '/new')) {
url = rtrim(url, '/new');
}
if (endsWith(url, '/issues')) {
url = rtrim(url, '/issues');
}
return url;
}

View File

@@ -5,7 +5,7 @@
import * as assert from 'assert';
import { IssueReporterModel } from 'vs/code/electron-browser/issue/issueReporterModel';
import { normalizeGitHubUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
import { normalizeGitHubUrl } from 'vs/code/common/issue/issueReporterUtil';
import { IssueType } from 'vs/platform/issue/node/issue';
suite('IssueReporter', () => {