@codingame/monaco-vscode-issue-service-override 25.1.1 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,20 +20,17 @@ let WebIssueContribution = class WebIssueContribution extends BaseIssueContribut
20
20
  super(productService, configurationService);
21
21
  ( Registry.as(Extensions.Configuration)).registerConfiguration({
22
22
  properties: {
23
- 'issueReporter.experimental.webReporter': {
24
- type: 'boolean',
25
- default: productService.quality !== 'stable',
26
- description: 'Enable experimental issue reporter for web.',
27
- },
23
+ "issueReporter.experimental.webReporter": {
24
+ type: "boolean",
25
+ default: productService.quality !== "stable",
26
+ description: "Enable experimental issue reporter for web."
27
+ }
28
28
  }
29
29
  });
30
30
  }
31
31
  };
32
- WebIssueContribution = ( __decorate([
33
- ( __param(0, IProductService)),
34
- ( __param(1, IConfigurationService))
35
- ], WebIssueContribution));
32
+ WebIssueContribution = ( __decorate([( __param(0, IProductService)), ( __param(1, IConfigurationService))], WebIssueContribution));
36
33
  ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(WebIssueContribution, LifecyclePhase.Restored);
37
- CommandsRegistry.registerCommand('_issues.getSystemStatus', (accessor) => {
38
- return localize(8446, "The --status argument is not yet supported in browsers.");
34
+ CommandsRegistry.registerCommand("_issues.getSystemStatus", accessor => {
35
+ return localize(8753, "The --status argument is not yet supported in browsers.");
39
36
  });
@@ -26,7 +26,15 @@ import * as issueReporter from './media/issueReporter.css';
26
26
 
27
27
  registerCss(issueReporter);
28
28
  let IssueFormService = class IssueFormService {
29
- constructor(instantiationService, auxiliaryWindowService, menuService, contextKeyService, logService, dialogService, hostService) {
29
+ constructor(
30
+ instantiationService,
31
+ auxiliaryWindowService,
32
+ menuService,
33
+ contextKeyService,
34
+ logService,
35
+ dialogService,
36
+ hostService
37
+ ) {
30
38
  this.instantiationService = instantiationService;
31
39
  this.auxiliaryWindowService = auxiliaryWindowService;
32
40
  this.menuService = menuService;
@@ -36,9 +44,9 @@ let IssueFormService = class IssueFormService {
36
44
  this.hostService = hostService;
37
45
  this.issueReporterWindow = null;
38
46
  this.extensionIdentifierSet = ( new ExtensionIdentifierSet());
39
- this.arch = '';
40
- this.release = '';
41
- this.type = '';
47
+ this.arch = "";
48
+ this.release = "";
49
+ this.type = "";
42
50
  }
43
51
  async openReporter(data) {
44
52
  if (this.hasToReload(data)) {
@@ -46,57 +54,62 @@ let IssueFormService = class IssueFormService {
46
54
  }
47
55
  await this.openAuxIssueReporter(data);
48
56
  if (this.issueReporterWindow) {
49
- const issueReporter = this.instantiationService.createInstance(IssueWebReporter, false, data, { type: this.type, arch: this.arch, release: this.release }, product, this.issueReporterWindow);
57
+ const issueReporter = this.instantiationService.createInstance(IssueWebReporter, false, data, {
58
+ type: this.type,
59
+ arch: this.arch,
60
+ release: this.release
61
+ }, product, this.issueReporterWindow);
50
62
  issueReporter.render();
51
63
  }
52
64
  }
53
65
  async openAuxIssueReporter(data, bounds) {
54
- let issueReporterBounds = { width: 700, height: 800 };
66
+ let issueReporterBounds = {
67
+ width: 700,
68
+ height: 800
69
+ };
55
70
  if (bounds && bounds.x && bounds.y) {
56
71
  const centerX = bounds.x + bounds.width / 2;
57
72
  const centerY = bounds.y + bounds.height / 2;
58
- issueReporterBounds = { ...issueReporterBounds, x: centerX - 350, y: centerY - 400 };
73
+ issueReporterBounds = {
74
+ ...issueReporterBounds,
75
+ x: centerX - 350,
76
+ y: centerY - 400
77
+ };
59
78
  }
60
79
  const disposables = ( new DisposableStore());
61
- const auxiliaryWindow = disposables.add(await this.auxiliaryWindowService.open({ mode: AuxiliaryWindowMode.Normal, bounds: issueReporterBounds, nativeTitlebar: true, disableFullscreen: true }));
62
- const platformClass = isWindows ? 'windows' : isLinux ? 'linux' : 'mac';
80
+ const auxiliaryWindow = disposables.add(await this.auxiliaryWindowService.open({
81
+ mode: AuxiliaryWindowMode.Normal,
82
+ bounds: issueReporterBounds,
83
+ nativeTitlebar: true,
84
+ disableFullscreen: true
85
+ }));
86
+ const platformClass = isWindows ? "windows" : isLinux ? "linux" : "mac";
63
87
  if (auxiliaryWindow) {
64
88
  await auxiliaryWindow.whenStylesHaveLoaded;
65
- auxiliaryWindow.window.document.title = 'Issue Reporter';
66
- auxiliaryWindow.window.document.body.classList.add('issue-reporter-body', 'monaco-workbench', platformClass);
89
+ auxiliaryWindow.window.document.title = "Issue Reporter";
90
+ auxiliaryWindow.window.document.body.classList.add("issue-reporter-body", "monaco-workbench", platformClass);
67
91
  auxiliaryWindow.container.remove();
68
92
  if (!Menu.globalStyleSheet) {
69
93
  const menuStyleSheet = createStyleSheet(auxiliaryWindow.window.document.head);
70
94
  menuStyleSheet.textContent = getMenuWidgetCSS(unthemedMenuStyles, false);
71
95
  }
72
- const div = createElement('div');
73
- div.classList.add('monaco-workbench');
96
+ const div = createElement("div");
97
+ div.classList.add("monaco-workbench");
74
98
  auxiliaryWindow.window.document.body.appendChild(div);
75
99
  safeSetInnerHtml(div, BaseHtml(), {
76
100
  allowedTags: {
77
- augment: [
78
- 'input',
79
- 'select',
80
- 'checkbox',
81
- 'textarea',
82
- ]
101
+ augment: ["input", "select", "checkbox", "textarea"]
83
102
  },
84
103
  allowedAttributes: {
85
- augment: [
86
- 'id',
87
- 'class',
88
- 'style',
89
- 'textarea',
90
- ]
104
+ augment: ["id", "class", "style", "textarea"]
91
105
  }
92
106
  });
93
107
  this.issueReporterWindow = auxiliaryWindow.window;
94
- }
95
- else {
96
- console.error('Failed to open auxiliary window');
108
+ } else {
109
+ console.error("Failed to open auxiliary window");
97
110
  disposables.dispose();
98
111
  }
99
- this.issueReporterWindow?.addEventListener('beforeunload', () => {
112
+ this.issueReporterWindow?.addEventListener("beforeunload", () => {
100
113
  auxiliaryWindow.window.close();
101
114
  disposables.dispose();
102
115
  this.issueReporterWindow = null;
@@ -104,15 +117,16 @@ let IssueFormService = class IssueFormService {
104
117
  }
105
118
  async sendReporterMenu(extensionId) {
106
119
  const menu = this.menuService.createMenu(MenuId.IssueReporter, this.contextKeyService);
107
- const actions = menu.getActions({ renderShortTitle: true }).flatMap(entry => entry[1]);
120
+ const actions = menu.getActions({
121
+ renderShortTitle: true
122
+ }).flatMap(entry => entry[1]);
108
123
  for (const action of actions) {
109
124
  try {
110
- if (action.item && 'source' in action.item && action.item.source?.id.toLowerCase() === extensionId.toLowerCase()) {
125
+ if (action.item && "source" in action.item && action.item.source?.id.toLowerCase() === extensionId.toLowerCase()) {
111
126
  this.extensionIdentifierSet.add(extensionId.toLowerCase());
112
127
  await action.run();
113
128
  }
114
- }
115
- catch (error) {
129
+ } catch (error) {
116
130
  console.error(error);
117
131
  }
118
132
  }
@@ -131,9 +145,10 @@ let IssueFormService = class IssueFormService {
131
145
  async reloadWithExtensionsDisabled() {
132
146
  if (this.issueReporterWindow) {
133
147
  try {
134
- await this.hostService.reload({ disableExtensions: true });
135
- }
136
- catch (error) {
148
+ await this.hostService.reload({
149
+ disableExtensions: true
150
+ });
151
+ } catch (error) {
137
152
  this.logService.error(error);
138
153
  }
139
154
  }
@@ -142,22 +157,19 @@ let IssueFormService = class IssueFormService {
142
157
  await this.dialogService.prompt({
143
158
  type: Severity.Warning,
144
159
  message: ( localize(
145
- 8447,
160
+ 8754,
146
161
  "Your input will not be saved. Are you sure you want to close this window?"
147
162
  )),
148
- buttons: [
149
- {
150
- label: ( localize(8448, "&&Yes")),
151
- run: () => {
152
- this.closeReporter();
153
- this.issueReporterWindow = null;
154
- }
155
- },
156
- {
157
- label: ( localize(8449, "Cancel")),
158
- run: () => { }
163
+ buttons: [{
164
+ label: ( localize(8755, "&&Yes")),
165
+ run: () => {
166
+ this.closeReporter();
167
+ this.issueReporterWindow = null;
159
168
  }
160
- ]
169
+ }, {
170
+ label: ( localize(8756, "Cancel")),
171
+ run: () => {}
172
+ }]
161
173
  });
162
174
  }
163
175
  async showClipboardDialog() {
@@ -165,19 +177,20 @@ let IssueFormService = class IssueFormService {
165
177
  await this.dialogService.prompt({
166
178
  type: Severity.Warning,
167
179
  message: ( localize(
168
- 8450,
180
+ 8757,
169
181
  "There is too much data to send to GitHub directly. The data will be copied to the clipboard, please paste it into the GitHub issue page that is opened."
170
182
  )),
171
- buttons: [
172
- {
173
- label: ( localize(8451, "&&OK")),
174
- run: () => { result = true; }
175
- },
176
- {
177
- label: ( localize(8449, "Cancel")),
178
- run: () => { result = false; }
183
+ buttons: [{
184
+ label: ( localize(8758, "&&OK")),
185
+ run: () => {
186
+ result = true;
187
+ }
188
+ }, {
189
+ label: ( localize(8756, "Cancel")),
190
+ run: () => {
191
+ result = false;
179
192
  }
180
- ]
193
+ }]
181
194
  });
182
195
  return result;
183
196
  }
@@ -194,14 +207,6 @@ let IssueFormService = class IssueFormService {
194
207
  return false;
195
208
  }
196
209
  };
197
- IssueFormService = ( __decorate([
198
- ( __param(0, IInstantiationService)),
199
- ( __param(1, IAuxiliaryWindowService)),
200
- ( __param(2, IMenuService)),
201
- ( __param(3, IContextKeyService)),
202
- ( __param(4, ILogService)),
203
- ( __param(5, IDialogService)),
204
- ( __param(6, IHostService))
205
- ], IssueFormService));
210
+ IssueFormService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IAuxiliaryWindowService)), ( __param(2, IMenuService)), ( __param(3, IContextKeyService)), ( __param(4, ILogService)), ( __param(5, IDialogService)), ( __param(6, IHostService))], IssueFormService));
206
211
 
207
212
  export { IssueFormService };
@@ -16,12 +16,15 @@ class IssueReporterModel {
16
16
  allExtensions: []
17
17
  };
18
18
  this._data = initialData ? Object.assign(defaultData, initialData) : defaultData;
19
- mainWindow.addEventListener('message', async (event) => {
20
- if (event.data && event.data.sendChannel === 'vscode:triggerIssueData') {
19
+ mainWindow.addEventListener("message", async event => {
20
+ if (event.data && event.data.sendChannel === "vscode:triggerIssueData") {
21
21
  mainWindow.postMessage({
22
- data: { issueBody: this._data.issueDescription, issueTitle: this._data.issueTitle },
23
- replyChannel: 'vscode:triggerIssueDataResponse'
24
- }, '*');
22
+ data: {
23
+ issueBody: this._data.issueDescription,
24
+ issueTitle: this._data.issueTitle
25
+ },
26
+ replyChannel: "vscode:triggerIssueDataResponse"
27
+ }, "*");
25
28
  }
26
29
  });
27
30
  }
@@ -34,10 +37,10 @@ class IssueReporterModel {
34
37
  serialize() {
35
38
  const modes = [];
36
39
  if (this._data.restrictedMode) {
37
- modes.push('Restricted');
40
+ modes.push("Restricted");
38
41
  }
39
42
  if (this._data.isUnsupported) {
40
- modes.push('Unsupported');
43
+ modes.push("Unsupported");
41
44
  }
42
45
  return `
43
46
  Type: <b>${this.getIssueTypeTitle()}</b>
@@ -46,47 +49,41 @@ ${this._data.issueDescription}
46
49
  ${this.getExtensionVersion()}
47
50
  VS Code version: ${this._data.versionInfo && this._data.versionInfo.vscodeVersion}
48
51
  OS version: ${this._data.versionInfo && this._data.versionInfo.os}
49
- Modes:${modes.length ? ' ' + modes.join(', ') : ''}
52
+ Modes:${modes.length ? " " + modes.join(", ") : ""}
50
53
  ${this.getRemoteOSes()}
51
54
  ${this.getInfos()}
52
55
  <!-- generated by issue reporter -->`;
53
56
  }
54
57
  getRemoteOSes() {
55
58
  if (this._data.systemInfo && this._data.systemInfo.remoteData.length) {
56
- return ( this._data.systemInfo.remoteData
57
- .map(
59
+ return ( this._data.systemInfo.remoteData.map(
58
60
  remote => isRemoteDiagnosticError(remote) ? remote.errorMessage : `Remote OS version: ${remote.machineInfo.os}`
59
- )).join('\n') + '\n';
61
+ )).join("\n") + "\n";
60
62
  }
61
- return '';
63
+ return "";
62
64
  }
63
65
  fileOnExtension() {
64
- const fileOnExtensionSupported = this._data.issueType === IssueType.Bug
65
- || this._data.issueType === IssueType.PerformanceIssue
66
- || this._data.issueType === IssueType.FeatureRequest;
66
+ const fileOnExtensionSupported = this._data.issueType === IssueType.Bug || this._data.issueType === IssueType.PerformanceIssue || this._data.issueType === IssueType.FeatureRequest;
67
67
  return fileOnExtensionSupported && this._data.fileOnExtension;
68
68
  }
69
69
  getExtensionVersion() {
70
70
  if (this.fileOnExtension() && this._data.selectedExtension) {
71
71
  return `\nExtension version: ${this._data.selectedExtension.version}`;
72
- }
73
- else {
74
- return '';
72
+ } else {
73
+ return "";
75
74
  }
76
75
  }
77
76
  getIssueTypeTitle() {
78
77
  if (this._data.issueType === IssueType.Bug) {
79
- return 'Bug';
80
- }
81
- else if (this._data.issueType === IssueType.PerformanceIssue) {
82
- return 'Performance Issue';
83
- }
84
- else {
85
- return 'Feature Request';
78
+ return "Bug";
79
+ } else if (this._data.issueType === IssueType.PerformanceIssue) {
80
+ return "Performance Issue";
81
+ } else {
82
+ return "Feature Request";
86
83
  }
87
84
  }
88
85
  getInfos() {
89
- let info = '';
86
+ let info = "";
90
87
  if (this._data.fileOnMarketplace) {
91
88
  return info;
92
89
  }
@@ -99,7 +96,7 @@ ${this.getInfos()}
99
96
  info += this.generateSystemInfoMd();
100
97
  }
101
98
  if (this._data.includeSystemInfo && this._data.systemInfoWeb) {
102
- info += 'System Info: ' + this._data.systemInfoWeb;
99
+ info += "System Info: " + this._data.systemInfoWeb;
103
100
  }
104
101
  }
105
102
  if (this._data.issueType === IssueType.PerformanceIssue) {
@@ -121,7 +118,7 @@ ${this.getInfos()}
121
118
  return info;
122
119
  }
123
120
  getExtensionData() {
124
- return this._data.extensionData ?? '';
121
+ return this._data.extensionData ?? "";
125
122
  }
126
123
  generateSystemInfoMd() {
127
124
  let md = `<details>
@@ -132,10 +129,10 @@ ${this.getInfos()}
132
129
  `;
133
130
  if (this._data.systemInfo) {
134
131
  md += `|CPUs|${this._data.systemInfo.cpus}|
135
- |GPU Status|${( ( Object.keys(this._data.systemInfo.gpuStatus)).map(key => `${key}: ${this._data.systemInfo.gpuStatus[key]}`)).join('<br>')}|
132
+ |GPU Status|${( ( Object.keys(this._data.systemInfo.gpuStatus)).map(key => `${key}: ${this._data.systemInfo.gpuStatus[key]}`)).join("<br>")}|
136
133
  |Load (avg)|${this._data.systemInfo.load}|
137
134
  |Memory (System)|${this._data.systemInfo.memory}|
138
- |Process Argv|${this._data.systemInfo.processArgs.replace(/\\/g, '\\\\')}|
135
+ |Process Argv|${this._data.systemInfo.processArgs.replace(/\\/g, "\\\\")}|
139
136
  |Screen Reader|${this._data.systemInfo.screenReader}|
140
137
  |VM|${this._data.systemInfo.vmHint}|`;
141
138
  if (this._data.systemInfo.linuxEnv) {
@@ -147,8 +144,7 @@ ${this.getInfos()}
147
144
  this._data.systemInfo.remoteData.forEach(remote => {
148
145
  if (isRemoteDiagnosticError(remote)) {
149
146
  md += `\n\n${remote.errorMessage}`;
150
- }
151
- else {
147
+ } else {
152
148
  md += `
153
149
 
154
150
  |Item|Value|
@@ -161,7 +157,7 @@ ${this.getInfos()}
161
157
  }
162
158
  });
163
159
  }
164
- md += '\n</details>';
160
+ md += "\n</details>";
165
161
  return md;
166
162
  }
167
163
  generateProcessInfoMd() {
@@ -199,17 +195,17 @@ ${this._data.experimentInfo}
199
195
  }
200
196
  generateExtensionsMd() {
201
197
  if (this._data.extensionsDisabled) {
202
- return 'Extensions disabled';
198
+ return "Extensions disabled";
203
199
  }
204
- const themeExclusionStr = this._data.numberOfThemeExtesions ? `\n(${this._data.numberOfThemeExtesions} theme extensions excluded)` : '';
200
+ const themeExclusionStr = this._data.numberOfThemeExtesions ? `\n(${this._data.numberOfThemeExtesions} theme extensions excluded)` : "";
205
201
  if (!this._data.enabledNonThemeExtesions) {
206
- return 'Extensions: none' + themeExclusionStr;
202
+ return "Extensions: none" + themeExclusionStr;
207
203
  }
208
204
  const tableHeader = `Extension|Author (truncated)|Version
209
205
  ---|---|---`;
210
206
  const table = ( this._data.enabledNonThemeExtesions.map(e => {
211
- return `${e.name}|${e.publisher?.substr(0, 3) ?? 'N/A'}|${e.version}`;
212
- })).join('\n');
207
+ return `${e.name}|${e.publisher?.substr(0, 3) ?? "N/A"}|${e.version}`;
208
+ })).join("\n");
213
209
  return `<details><summary>Extensions (${this._data.enabledNonThemeExtesions.length})</summary>
214
210
 
215
211
  ${tableHeader}