mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Merge branch 'master' of https://github.com/Microsoft/vscode
This commit is contained in:
commit
e2d5b4a7a9
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"vscode-css-languageservice": "^3.0.9-next.3",
|
||||
"vscode-emmet-helper": "^1.2.0",
|
||||
"vscode-emmet-helper": "^1.2.4",
|
||||
"vscode-languageserver": "^4.0.0",
|
||||
"vscode-languageserver-protocol-foldingprovider": "^1.0.1"
|
||||
},
|
||||
|
|
|
@ -25,9 +25,9 @@ vscode-css-languageservice@^3.0.9-next.3:
|
|||
vscode-languageserver-types "^3.6.1"
|
||||
vscode-nls "^3.2.1"
|
||||
|
||||
vscode-emmet-helper@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.2.0.tgz#6b9311be065c9c99d5de2dae18ea0730d9cfb734"
|
||||
vscode-emmet-helper@^1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.2.4.tgz#48056974d13036722af019235b9f750a495de728"
|
||||
dependencies:
|
||||
"@emmetio/extract-abbreviation" "0.1.6"
|
||||
jsonc-parser "^1.0.0"
|
||||
|
|
|
@ -439,7 +439,7 @@
|
|||
"@emmetio/html-matcher": "^0.3.3",
|
||||
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
|
||||
"@emmetio/math-expression": "^0.1.1",
|
||||
"vscode-emmet-helper": "^1.2.3",
|
||||
"vscode-emmet-helper": "^1.2.4",
|
||||
"vscode-languageserver-types": "^3.5.0",
|
||||
"image-size": "^0.5.2",
|
||||
"vscode-nls": "3.2.1"
|
||||
|
|
|
@ -2052,9 +2052,9 @@ vinyl@~2.0.1:
|
|||
remove-trailing-separator "^1.0.1"
|
||||
replace-ext "^1.0.0"
|
||||
|
||||
vscode-emmet-helper@^1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.2.3.tgz#395504d4d9b8fb0bf967af83aeef649631d1595e"
|
||||
vscode-emmet-helper@^1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.2.4.tgz#48056974d13036722af019235b9f750a495de728"
|
||||
dependencies:
|
||||
"@emmetio/extract-abbreviation" "0.1.6"
|
||||
jsonc-parser "^1.0.0"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"vscode-css-languageservice": "^3.0.8",
|
||||
"vscode-emmet-helper": "1.2.3",
|
||||
"vscode-emmet-helper": "1.2.4",
|
||||
"vscode-html-languageservice": "^2.1.2",
|
||||
"vscode-languageserver": "^4.0.0",
|
||||
"vscode-languageserver-protocol-foldingprovider": "^1.0.1",
|
||||
|
|
|
@ -25,9 +25,9 @@ vscode-css-languageservice@^3.0.8:
|
|||
vscode-languageserver-types "^3.6.1"
|
||||
vscode-nls "^3.2.1"
|
||||
|
||||
vscode-emmet-helper@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.2.3.tgz#395504d4d9b8fb0bf967af83aeef649631d1595e"
|
||||
vscode-emmet-helper@1.2.4:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.2.4.tgz#48056974d13036722af019235b9f750a495de728"
|
||||
dependencies:
|
||||
"@emmetio/extract-abbreviation" "0.1.6"
|
||||
jsonc-parser "^1.0.0"
|
||||
|
|
|
@ -40,6 +40,7 @@ import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
|
|||
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
|
||||
import { ILogService, getLogLevel } from 'vs/platform/log/common/log';
|
||||
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
import { normalizeGitHubIssuesUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
|
||||
|
||||
const MAX_URL_LENGTH = platform.isWindows ? 2081 : 5400;
|
||||
|
||||
|
@ -209,7 +210,7 @@ export class IssueReporter extends Disposable {
|
|||
});
|
||||
|
||||
const numberOfThemeExtesions = themes && themes.length;
|
||||
this.issueReporterModel.update({ numberOfThemeExtesions, enabledNonThemeExtesions: nonThemes });
|
||||
this.issueReporterModel.update({ numberOfThemeExtesions, enabledNonThemeExtesions: nonThemes, allExtensions: extensions });
|
||||
this.updateExtensionTable(nonThemes, numberOfThemeExtesions);
|
||||
|
||||
if (this.environmentService.disableExtensions || extensions.length === 0) {
|
||||
|
@ -440,6 +441,11 @@ export class IssueReporter extends Disposable {
|
|||
return selectedExtension && selectedExtension.manifest && selectedExtension.manifest.repository && selectedExtension.manifest.repository.url;
|
||||
}
|
||||
|
||||
private getExtensionBugsUrl(): string {
|
||||
const selectedExtension = this.issueReporterModel.getData().selectedExtension;
|
||||
return selectedExtension && selectedExtension.manifest && selectedExtension.manifest.bugs && selectedExtension.manifest.bugs.url;
|
||||
}
|
||||
|
||||
private searchVSCodeIssues(title: string, issueDescription: string): void {
|
||||
if (title || issueDescription) {
|
||||
this.searchDuplicates(title, issueDescription);
|
||||
|
@ -746,10 +752,13 @@ export class IssueReporter extends Disposable {
|
|||
private getIssueUrlWithTitle(issueTitle: string): string {
|
||||
let repositoryUrl = product.reportIssueUrl;
|
||||
if (this.issueReporterModel.getData().fileOnExtension) {
|
||||
const bugsUrl = this.getExtensionBugsUrl();
|
||||
const extensionUrl = this.getExtensionRepositoryUrl();
|
||||
if (extensionUrl) {
|
||||
// Remove '.git' suffix
|
||||
repositoryUrl = `${extensionUrl.indexOf('.git') !== -1 ? extensionUrl.substr(0, extensionUrl.length - 4) : extensionUrl}/issues/new/`;
|
||||
// If given, try to match the extension's bug url
|
||||
if (bugsUrl && bugsUrl.match(/^https?:\/\/github\.com\/(.*)/)) {
|
||||
repositoryUrl = normalizeGitHubIssuesUrl(bugsUrl);
|
||||
} else if (extensionUrl && extensionUrl.match(/^https?:\/\/github\.com\/(.*)/)) {
|
||||
repositoryUrl = normalizeGitHubIssuesUrl(extensionUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -777,7 +786,7 @@ export class IssueReporter extends Disposable {
|
|||
|
||||
this.addEventListener('extension-selector', 'change', (e: Event) => {
|
||||
const selectedExtensionId = (<HTMLInputElement>e.target).value;
|
||||
const extensions = this.issueReporterModel.getData().enabledNonThemeExtesions;
|
||||
const extensions = this.issueReporterModel.getData().allExtensions;
|
||||
const matches = extensions.filter(extension => extension.identifier.id === selectedExtensionId);
|
||||
if (matches.length) {
|
||||
this.issueReporterModel.update({ selectedExtension: matches[0] });
|
||||
|
|
|
@ -26,6 +26,7 @@ export interface IssueReporterData {
|
|||
includeSettingsSearchDetails?: boolean;
|
||||
|
||||
numberOfThemeExtesions?: number;
|
||||
allExtensions?: ILocalExtension[];
|
||||
enabledNonThemeExtesions?: ILocalExtension[];
|
||||
extensionsDisabled?: boolean;
|
||||
fileOnExtension?: boolean;
|
||||
|
|
30
src/vs/code/electron-browser/issue/issueReporterUtil.ts
Normal file
30
src/vs/code/electron-browser/issue/issueReporterUtil.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { endsWith, rtrim } from 'vs/base/common/strings';
|
||||
|
||||
export function normalizeGitHubIssuesUrl(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 the url already ends with issues/new, it's beautiful, return it
|
||||
if (endsWith(url, 'issues/new')) {
|
||||
return url;
|
||||
}
|
||||
|
||||
// Add new segment if it does not exist
|
||||
if (endsWith(url, 'issues')) {
|
||||
return url + '/new';
|
||||
}
|
||||
|
||||
return url + '/issues/new';
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import * as assert from 'assert';
|
||||
import { IssueReporterModel } from 'vs/code/electron-browser/issue/issueReporterModel';
|
||||
import { normalizeGitHubIssuesUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
|
||||
|
||||
suite('IssueReporter', () => {
|
||||
|
||||
|
@ -36,4 +37,18 @@ OS version: undefined
|
|||
|
||||
<!-- generated by issue reporter -->`);
|
||||
});
|
||||
|
||||
test('should normalize GitHub urls', () => {
|
||||
[
|
||||
'https://github.com/repo',
|
||||
'https://github.com/repo/',
|
||||
'https://github.com/repo.git',
|
||||
'https://github.com/repo/issues',
|
||||
'https://github.com/repo/issues/',
|
||||
'https://github.com/repo/issues/new',
|
||||
'https://github.com/repo/issues/new/'
|
||||
].forEach(url => {
|
||||
assert.equal('https://github.com/repo/issues/new', normalizeGitHubIssuesUrl(url));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -120,6 +120,9 @@ export interface IExtensionManifest {
|
|||
repository?: {
|
||||
url: string;
|
||||
};
|
||||
bugs?: {
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IGalleryExtensionProperties {
|
||||
|
|
Loading…
Reference in a new issue