Skip to content

Commit 07ad5d6

Browse files
author
Rachel Macfarlane
committed
Remove unused 'SettingSearch' issue type
1 parent 5c76fc5 commit 07ad5d6

File tree

4 files changed

+8
-136
lines changed

4 files changed

+8
-136
lines changed

src/vs/code/electron-sandbox/issue/issueReporterMain.ts

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { localize } from 'vs/nls';
2323
import { isRemoteDiagnosticError, SystemInfo } from 'vs/platform/diagnostics/common/diagnostics';
2424
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
2525
import { IMainProcessService, MainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
26-
import { ISettingsSearchIssueReporterData, IssueReporterData, IssueReporterExtensionData, IssueReporterFeatures, IssueReporterStyles, IssueType } from 'vs/platform/issue/common/issue';
26+
import { IssueReporterData, IssueReporterExtensionData, IssueReporterFeatures, IssueReporterStyles, IssueType } from 'vs/platform/issue/common/issue';
2727
import { IWindowConfiguration } from 'vs/platform/windows/common/windows';
2828

2929
const MAX_URL_LENGTH = 2045;
@@ -148,10 +148,6 @@ export class IssueReporter extends Disposable {
148148
applyZoom(configuration.data.zoomLevel);
149149
this.applyStyles(configuration.data.styles);
150150
this.handleExtensionData(configuration.data.enabledExtensions);
151-
152-
if (configuration.data.issueType === IssueType.SettingsSearchIssue) {
153-
this.handleSettingsSearchData(<ISettingsSearchIssueReporterData>configuration.data);
154-
}
155151
}
156152

157153
render(): void {
@@ -244,7 +240,7 @@ export class IssueReporter extends Disposable {
244240
content.push(`.monaco-text-button:not(.disabled):hover, .monaco-text-button:focus { background-color: ${styles.buttonHoverBackground} !important; }`);
245241
}
246242

247-
styleTag.innerHTML = content.join('\n');
243+
styleTag.textContent = content.join('\n');
248244
document.head.appendChild(styleTag);
249245
document.body.style.color = styles.color || '';
250246
}
@@ -266,39 +262,6 @@ export class IssueReporter extends Disposable {
266262
this.updateExtensionSelector(installedExtensions);
267263
}
268264

269-
private handleSettingsSearchData(data: ISettingsSearchIssueReporterData): void {
270-
this.issueReporterModel.update({
271-
actualSearchResults: data.actualSearchResults,
272-
query: data.query,
273-
filterResultCount: data.filterResultCount
274-
});
275-
this.updateSearchedExtensionTable(data.enabledExtensions);
276-
this.updateSettingsSearchDetails(data);
277-
}
278-
279-
private updateSettingsSearchDetails(data: ISettingsSearchIssueReporterData): void {
280-
const target = document.querySelector<HTMLElement>('.block-settingsSearchResults .block-info');
281-
if (target) {
282-
const queryDiv = $<HTMLDivElement>('div', undefined, `Query: "${data.query}"` as string);
283-
const countDiv = $<HTMLElement>('div', undefined, `Literal match count: ${data.filterResultCount}` as string);
284-
const detailsDiv = $<HTMLDivElement>('.block-settingsSearchResults-details', undefined, queryDiv, countDiv);
285-
286-
const table = $('table', undefined,
287-
$('tr', undefined,
288-
$('th', undefined, 'Setting'),
289-
$('th', undefined, 'Extension'),
290-
$('th', undefined, 'Score'),
291-
),
292-
...data.actualSearchResults.map(setting => $('tr', undefined,
293-
$('td', undefined, setting.key),
294-
$('td', undefined, setting.extensionId),
295-
$('td', undefined, String(setting.score).slice(0, 5)),
296-
))
297-
);
298-
reset(target, detailsDiv, table);
299-
}
300-
}
301-
302265
private initServices(configuration: IssueReporterConfiguration): void {
303266
const serviceCollection = new ServiceCollection();
304267
const mainProcessService = new MainProcessService(configuration.windowId);
@@ -498,10 +461,6 @@ export class IssueReporter extends Disposable {
498461
return true;
499462
}
500463

501-
if (issueType === IssueType.SettingsSearchIssue) {
502-
return true;
503-
}
504-
505464
return false;
506465
}
507466

@@ -668,16 +627,11 @@ export class IssueReporter extends Disposable {
668627

669628
const typeSelect = this.getElementById('issue-type')! as HTMLSelectElement;
670629
const { issueType } = this.issueReporterModel.getData();
671-
if (issueType === IssueType.SettingsSearchIssue) {
672-
reset(typeSelect, makeOption(IssueType.SettingsSearchIssue, localize('settingsSearchIssue', "Settings Search Issue")));
673-
typeSelect.disabled = true;
674-
} else {
675-
reset(typeSelect,
676-
makeOption(IssueType.Bug, localize('bugReporter', "Bug Report")),
677-
makeOption(IssueType.FeatureRequest, localize('featureRequest', "Feature Request")),
678-
makeOption(IssueType.PerformanceIssue, localize('performanceIssue', "Performance Issue"))
679-
);
680-
}
630+
reset(typeSelect,
631+
makeOption(IssueType.Bug, localize('bugReporter', "Bug Report")),
632+
makeOption(IssueType.FeatureRequest, localize('featureRequest', "Feature Request")),
633+
makeOption(IssueType.PerformanceIssue, localize('performanceIssue', "Performance Issue"))
634+
);
681635

682636
typeSelect.value = issueType.toString();
683637

@@ -791,13 +745,6 @@ export class IssueReporter extends Disposable {
791745
if (fileOnExtension) {
792746
show(extensionSelector);
793747
}
794-
} else if (issueType === IssueType.SettingsSearchIssue) {
795-
show(blockContainer);
796-
show(searchedExtensionsBlock);
797-
show(settingsSearchResultsBlock);
798-
799-
reset(descriptionTitle, localize('expectedResults', "Expected Results"), $('span.required-input', undefined, '*'));
800-
reset(descriptionSubtitle, localize('settingsSearchResultsDescription', "Please list the results that you were expecting to see when you searched with this query. We support GitHub-flavored Markdown. You will be able to edit your issue and add screenshots when we preview it on GitHub."));
801748
}
802749
}
803750

@@ -1135,20 +1082,6 @@ export class IssueReporter extends Disposable {
11351082
}
11361083
}
11371084

1138-
private updateSearchedExtensionTable(extensions: IssueReporterExtensionData[]): void {
1139-
const target = document.querySelector<HTMLElement>('.block-searchedExtensions .block-info');
1140-
if (target) {
1141-
if (!extensions.length) {
1142-
target.innerText = 'Extensions: none';
1143-
return;
1144-
}
1145-
1146-
const table = this.getExtensionTableHtml(extensions);
1147-
target.innerText = '';
1148-
target.appendChild(table);
1149-
}
1150-
}
1151-
11521085
private getExtensionTableHtml(extensions: IssueReporterExtensionData[]): HTMLTableElement {
11531086
return $('table', undefined,
11541087
$('tr', undefined,

src/vs/code/electron-sandbox/issue/issueReporterModel.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ ${this.getInfos()}
102102
return 'Bug';
103103
} else if (this._data.issueType === IssueType.PerformanceIssue) {
104104
return 'Performance Issue';
105-
} else if (this._data.issueType === IssueType.SettingsSearchIssue) {
106-
return 'Settings Search Issue';
107105
} else {
108106
return 'Feature Request';
109107
}
@@ -135,17 +133,6 @@ ${this.getInfos()}
135133
}
136134
}
137135

138-
if (this._data.issueType === IssueType.SettingsSearchIssue) {
139-
if (this._data.includeSearchedExtensions) {
140-
info += this.generateExtensionsMd();
141-
}
142-
143-
if (this._data.includeSettingsSearchDetails) {
144-
info += this.generateSettingSearchResultsMd();
145-
info += '\n' + this.generateSettingsSearchResultDetailsMd();
146-
}
147-
}
148-
149136
return info;
150137
}
151138

@@ -243,35 +230,6 @@ ${tableHeader}
243230
${table}
244231
${themeExclusionStr}
245232
246-
</details>`;
247-
}
248-
249-
private generateSettingsSearchResultDetailsMd(): string {
250-
return `
251-
Query: ${this._data.query}
252-
Literal matches: ${this._data.filterResultCount}`;
253-
}
254-
255-
private generateSettingSearchResultsMd(): string {
256-
if (!this._data.actualSearchResults) {
257-
return '';
258-
}
259-
260-
if (!this._data.actualSearchResults.length) {
261-
return `No fuzzy results`;
262-
}
263-
264-
const tableHeader = `Setting|Extension|Score
265-
---|---|---`;
266-
const table = this._data.actualSearchResults.map(setting => {
267-
return `${setting.key}|${setting.extensionId}|${String(setting.score).slice(0, 5)}`;
268-
}).join('\n');
269-
270-
return `<details><summary>Results</summary>
271-
272-
${tableHeader}
273-
${table}
274-
275233
</details>`;
276234
}
277235
}

src/vs/code/electron-sandbox/issue/test/testReporterModel.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,5 @@ Remote OS version: Linux x64 4.18.0
218218

219219
assert.equal(issueReporterModel.fileOnExtension(), true);
220220
});
221-
222-
[
223-
IssueType.SettingsSearchIssue
224-
].forEach(type => {
225-
const issueReporterModel = new IssueReporterModel({
226-
issueType: type,
227-
fileOnExtension: true
228-
});
229-
230-
assert.equal(issueReporterModel.fileOnExtension(), false);
231-
});
232221
});
233222
});

src/vs/platform/issue/common/issue.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export interface WindowData {
1717
export const enum IssueType {
1818
Bug,
1919
PerformanceIssue,
20-
FeatureRequest,
21-
SettingsSearchIssue
20+
FeatureRequest
2221
}
2322

2423
export interface IssueReporterStyles extends WindowStyles {
@@ -66,13 +65,6 @@ export interface ISettingSearchResult {
6665
score: number;
6766
}
6867

69-
export interface ISettingsSearchIssueReporterData extends IssueReporterData {
70-
issueType: IssueType.SettingsSearchIssue;
71-
actualSearchResults: ISettingSearchResult[];
72-
query: string;
73-
filterResultCount: number;
74-
}
75-
7668
export interface IssueReporterFeatures {
7769
}
7870

0 commit comments

Comments
 (0)