@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.
@@ -33,7 +33,7 @@ import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severit
33
33
 
34
34
  var TroubleshootIssueService_1, IssueTroubleshootUi_1;
35
35
  var TroubleshootStage;
36
- (function (TroubleshootStage) {
36
+ (function(TroubleshootStage) {
37
37
  TroubleshootStage[TroubleshootStage["EXTENSIONS"] = 1] = "EXTENSIONS";
38
38
  TroubleshootStage[TroubleshootStage["WORKBENCH"] = 2] = "WORKBENCH";
39
39
  })(TroubleshootStage || (TroubleshootStage = {}));
@@ -44,12 +44,10 @@ class TroubleShootState {
44
44
  }
45
45
  try {
46
46
  const data = JSON.parse(raw);
47
- if ((data.stage === TroubleshootStage.EXTENSIONS || data.stage === TroubleshootStage.WORKBENCH)
48
- && typeof data.profile === 'string') {
47
+ if ((data.stage === TroubleshootStage.EXTENSIONS || data.stage === TroubleshootStage.WORKBENCH) && typeof data.profile === "string") {
49
48
  return ( new TroubleShootState(data.stage, data.profile));
50
49
  }
51
- }
52
- catch { }
50
+ } catch {}
53
51
  return undefined;
54
52
  }
55
53
  constructor(stage, profile) {
@@ -58,9 +56,28 @@ class TroubleShootState {
58
56
  }
59
57
  }
60
58
  let TroubleshootIssueService = class TroubleshootIssueService extends Disposable {
61
- static { TroubleshootIssueService_1 = this; }
62
- static { this.storageKey = 'issueTroubleshootState'; }
63
- constructor(userDataProfileService, userDataProfilesService, userDataProfileManagementService, userDataProfileImportExportService, dialogService, extensionBisectService, notificationService, extensionManagementService, extensionEnablementService, issueService, productService, hostService, storageService, openerService) {
59
+ static {
60
+ TroubleshootIssueService_1 = this;
61
+ }
62
+ static {
63
+ this.storageKey = "issueTroubleshootState";
64
+ }
65
+ constructor(
66
+ userDataProfileService,
67
+ userDataProfilesService,
68
+ userDataProfileManagementService,
69
+ userDataProfileImportExportService,
70
+ dialogService,
71
+ extensionBisectService,
72
+ notificationService,
73
+ extensionManagementService,
74
+ extensionEnablementService,
75
+ issueService,
76
+ productService,
77
+ hostService,
78
+ storageService,
79
+ openerService
80
+ ) {
64
81
  super();
65
82
  this.userDataProfileService = userDataProfileService;
66
83
  this.userDataProfilesService = userDataProfilesService;
@@ -82,16 +99,16 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
82
99
  }
83
100
  async start() {
84
101
  if (this.isActive()) {
85
- throw ( new Error('invalid state'));
102
+ throw ( new Error("invalid state"));
86
103
  }
87
104
  const res = await this.dialogService.confirm({
88
- message: ( localize(8480, "Troubleshoot Issue")),
105
+ message: ( localize(8787, "Troubleshoot Issue")),
89
106
  detail: ( localize(
90
- 8481,
107
+ 8788,
91
108
  "Issue troubleshooting is a process to help you identify the cause for an issue. The cause for an issue can be a misconfiguration, due to an extension, or be {0} itself.\n\nDuring the process the window reloads repeatedly. Each time you must confirm if you are still seeing the issue.",
92
109
  this.productService.nameLong
93
110
  )),
94
- primaryButton: ( localize(8482, "&&Troubleshoot Issue")),
111
+ primaryButton: ( localize(8789, "&&Troubleshoot Issue")),
95
112
  custom: true
96
113
  });
97
114
  if (!res.confirmed) {
@@ -135,17 +152,17 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
135
152
  return;
136
153
  }
137
154
  const result = await this.askToReproduceIssue(( localize(
138
- 8483,
155
+ 8790,
139
156
  "Issue troubleshooting is active and has temporarily disabled all installed extensions. Check if you can still reproduce the problem and proceed by selecting from these options."
140
157
  )));
141
- if (result === 'good') {
158
+ if (result === "good") {
142
159
  const profile = this.userDataProfilesService.profiles.find(p => p.id === this.state.profile) ?? this.userDataProfilesService.defaultProfile;
143
160
  await this.reproduceIssueWithExtensionsBisect(profile);
144
161
  }
145
- if (result === 'bad') {
162
+ if (result === "bad") {
146
163
  this.state = ( new TroubleShootState(TroubleshootStage.WORKBENCH, this.state.profile));
147
164
  }
148
- if (result === 'stop') {
165
+ if (result === "stop") {
149
166
  await this.stop();
150
167
  }
151
168
  }
@@ -153,21 +170,21 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
153
170
  await this.userDataProfileManagementService.createAndEnterTransientProfile();
154
171
  this.updateState(this.state);
155
172
  const result = await this.askToReproduceIssue(( localize(
156
- 8484,
173
+ 8791,
157
174
  "Issue troubleshooting is active and has temporarily reset your configurations to defaults. Check if you can still reproduce the problem and proceed by selecting from these options."
158
175
  )));
159
- if (result === 'stop') {
176
+ if (result === "stop") {
160
177
  await this.stop();
161
178
  }
162
- if (result === 'good') {
179
+ if (result === "good") {
163
180
  await this.askToReportIssue(( localize(
164
- 8485,
181
+ 8792,
165
182
  "Issue troubleshooting has identified that the issue is caused by your configurations. Please report the issue by exporting your configurations using \"Export Profile\" command and share the file in the issue report."
166
183
  )));
167
184
  }
168
- if (result === 'bad') {
185
+ if (result === "bad") {
169
186
  await this.askToReportIssue(( localize(
170
- 8486,
187
+ 8793,
171
188
  "Issue troubleshooting has identified that the issue is with {0}.",
172
189
  this.productService.nameLong
173
190
  )));
@@ -182,30 +199,33 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
182
199
  askToReproduceIssue(message) {
183
200
  return (new Promise((c, e) => {
184
201
  const goodPrompt = {
185
- label: ( localize(8487, "I Can't Reproduce")),
186
- run: () => c('good')
202
+ label: ( localize(8794, "I Can't Reproduce")),
203
+ run: () => c("good")
187
204
  };
188
205
  const badPrompt = {
189
- label: ( localize(8488, "I Can Reproduce")),
190
- run: () => c('bad')
206
+ label: ( localize(8795, "I Can Reproduce")),
207
+ run: () => c("bad")
191
208
  };
192
209
  const stop = {
193
- label: ( localize(8489, "Stop")),
194
- run: () => c('stop')
210
+ label: ( localize(8796, "Stop")),
211
+ run: () => c("stop")
195
212
  };
196
- this.notificationHandle = this.notificationService.prompt(Severity.Info, message, [goodPrompt, badPrompt, stop], { sticky: true, priority: NotificationPriority.URGENT });
213
+ this.notificationHandle = this.notificationService.prompt(Severity.Info, message, [goodPrompt, badPrompt, stop], {
214
+ sticky: true,
215
+ priority: NotificationPriority.URGENT
216
+ });
197
217
  }));
198
218
  }
199
219
  async askToReportIssue(message) {
200
220
  let isCheckedInInsiders = false;
201
- if (this.productService.quality === 'stable') {
221
+ if (this.productService.quality === "stable") {
202
222
  const res = await this.askToReproduceIssueWithInsiders();
203
- if (res === 'good') {
223
+ if (res === "good") {
204
224
  await this.dialogService.prompt({
205
225
  type: Severity.Info,
206
- message: ( localize(8480, "Troubleshoot Issue")),
226
+ message: ( localize(8787, "Troubleshoot Issue")),
207
227
  detail: ( localize(
208
- 8490,
228
+ 8797,
209
229
  "This likely means that the issue has been addressed already and will be available in an upcoming release. You can safely use {0} insiders until the new stable version is available.",
210
230
  this.productService.nameLong
211
231
  )),
@@ -213,61 +233,61 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
213
233
  });
214
234
  return;
215
235
  }
216
- if (res === 'stop') {
236
+ if (res === "stop") {
217
237
  await this.stop();
218
238
  return;
219
239
  }
220
- if (res === 'bad') {
240
+ if (res === "bad") {
221
241
  isCheckedInInsiders = true;
222
242
  }
223
243
  }
224
244
  await this.issueService.openReporter({
225
- issueBody: `> ${message} ${isCheckedInInsiders ? `It is confirmed that the issue exists in ${this.productService.nameLong} Insiders` : ''}`,
245
+ issueBody: `> ${message} ${isCheckedInInsiders ? `It is confirmed that the issue exists in ${this.productService.nameLong} Insiders` : ""}`
226
246
  });
227
247
  }
228
248
  async askToReproduceIssueWithInsiders() {
229
249
  const confirmRes = await this.dialogService.confirm({
230
- type: 'info',
231
- message: ( localize(8480, "Troubleshoot Issue")),
232
- primaryButton: ( localize(8491, "Download {0} Insiders", this.productService.nameLong)),
233
- cancelButton: ( localize(8492, "Report Issue Anyway")),
250
+ type: "info",
251
+ message: ( localize(8787, "Troubleshoot Issue")),
252
+ primaryButton: ( localize(8798, "Download {0} Insiders", this.productService.nameLong)),
253
+ cancelButton: ( localize(8799, "Report Issue Anyway")),
234
254
  detail: ( localize(
235
- 8493,
255
+ 8800,
236
256
  "Please try to download and reproduce the issue in {0} insiders.",
237
257
  this.productService.nameLong
238
258
  )),
239
259
  custom: {
240
- disableCloseAction: true,
260
+ disableCloseAction: true
241
261
  }
242
262
  });
243
263
  if (!confirmRes.confirmed) {
244
264
  return undefined;
245
265
  }
246
- const opened = await this.openerService.open(( URI.parse('https://aka.ms/vscode-insiders')));
266
+ const opened = await this.openerService.open(( URI.parse("https://aka.ms/vscode-insiders")));
247
267
  if (!opened) {
248
268
  return undefined;
249
269
  }
250
270
  const res = await this.dialogService.prompt({
251
- type: 'info',
252
- message: ( localize(8480, "Troubleshoot Issue")),
271
+ type: "info",
272
+ message: ( localize(8787, "Troubleshoot Issue")),
253
273
  buttons: [{
254
- label: ( localize(8494, "I can't reproduce")),
255
- run: () => 'good'
256
- }, {
257
- label: ( localize(8495, "I can reproduce")),
258
- run: () => 'bad'
259
- }],
274
+ label: ( localize(8801, "I can't reproduce")),
275
+ run: () => "good"
276
+ }, {
277
+ label: ( localize(8802, "I can reproduce")),
278
+ run: () => "bad"
279
+ }],
260
280
  cancelButton: {
261
- label: ( localize(8496, "Stop")),
262
- run: () => 'stop'
281
+ label: ( localize(8803, "Stop")),
282
+ run: () => "stop"
263
283
  },
264
284
  detail: ( localize(
265
- 8497,
285
+ 8804,
266
286
  "Please try to reproduce the issue in {0} insiders and confirm if the issue exists there.",
267
287
  this.productService.nameLong
268
288
  )),
269
289
  custom: {
270
- disableCloseAction: true,
290
+ disableCloseAction: true
271
291
  }
272
292
  });
273
293
  return res.result;
@@ -285,32 +305,25 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
285
305
  }
286
306
  updateState(state) {
287
307
  if (state) {
288
- this.storageService.store(TroubleshootIssueService_1.storageKey, JSON.stringify(state), StorageScope.PROFILE, StorageTarget.MACHINE);
289
- }
290
- else {
308
+ this.storageService.store(
309
+ TroubleshootIssueService_1.storageKey,
310
+ JSON.stringify(state),
311
+ StorageScope.PROFILE,
312
+ StorageTarget.MACHINE
313
+ );
314
+ } else {
291
315
  this.storageService.remove(TroubleshootIssueService_1.storageKey, StorageScope.PROFILE);
292
316
  }
293
317
  }
294
318
  };
295
- TroubleshootIssueService = TroubleshootIssueService_1 = ( __decorate([
296
- ( __param(0, IUserDataProfileService)),
297
- ( __param(1, IUserDataProfilesService)),
298
- ( __param(2, IUserDataProfileManagementService)),
299
- ( __param(3, IUserDataProfileImportExportService)),
300
- ( __param(4, IDialogService)),
301
- ( __param(5, IExtensionBisectService)),
302
- ( __param(6, INotificationService)),
303
- ( __param(7, IExtensionManagementService)),
304
- ( __param(8, IWorkbenchExtensionEnablementService)),
305
- ( __param(9, IWorkbenchIssueService)),
306
- ( __param(10, IProductService)),
307
- ( __param(11, IHostService)),
308
- ( __param(12, IStorageService)),
309
- ( __param(13, IOpenerService))
310
- ], TroubleshootIssueService));
319
+ TroubleshootIssueService = TroubleshootIssueService_1 = ( __decorate([( __param(0, IUserDataProfileService)), ( __param(1, IUserDataProfilesService)), ( __param(2, IUserDataProfileManagementService)), ( __param(3, IUserDataProfileImportExportService)), ( __param(4, IDialogService)), ( __param(5, IExtensionBisectService)), ( __param(6, INotificationService)), ( __param(7, IExtensionManagementService)), ( __param(8, IWorkbenchExtensionEnablementService)), ( __param(9, IWorkbenchIssueService)), ( __param(10, IProductService)), ( __param(11, IHostService)), ( __param(12, IStorageService)), ( __param(13, IOpenerService))], TroubleshootIssueService));
311
320
  let IssueTroubleshootUi = class IssueTroubleshootUi extends Disposable {
312
- static { IssueTroubleshootUi_1 = this; }
313
- static { this.ctxIsTroubleshootActive = ( new RawContextKey('isIssueTroubleshootActive', false)); }
321
+ static {
322
+ IssueTroubleshootUi_1 = this;
323
+ }
324
+ static {
325
+ this.ctxIsTroubleshootActive = ( new RawContextKey("isIssueTroubleshootActive", false));
326
+ }
314
327
  constructor(contextKeyService, troubleshootIssueService, storageService) {
315
328
  super();
316
329
  this.contextKeyService = contextKeyService;
@@ -319,28 +332,26 @@ let IssueTroubleshootUi = class IssueTroubleshootUi extends Disposable {
319
332
  if (troubleshootIssueService.isActive()) {
320
333
  troubleshootIssueService.resume();
321
334
  }
322
- this._register(storageService.onDidChangeValue(StorageScope.PROFILE, TroubleshootIssueService.storageKey, this._store)(() => {
323
- this.updateContext();
324
- }));
335
+ this._register(
336
+ storageService.onDidChangeValue(StorageScope.PROFILE, TroubleshootIssueService.storageKey, this._store)(() => {
337
+ this.updateContext();
338
+ })
339
+ );
325
340
  }
326
341
  updateContext() {
327
342
  IssueTroubleshootUi_1.ctxIsTroubleshootActive.bindTo(this.contextKeyService).set(this.troubleshootIssueService.isActive());
328
343
  }
329
344
  };
330
- IssueTroubleshootUi = IssueTroubleshootUi_1 = ( __decorate([
331
- ( __param(0, IContextKeyService)),
332
- ( __param(1, ITroubleshootIssueService)),
333
- ( __param(2, IStorageService))
334
- ], IssueTroubleshootUi));
345
+ IssueTroubleshootUi = IssueTroubleshootUi_1 = ( __decorate([( __param(0, IContextKeyService)), ( __param(1, ITroubleshootIssueService)), ( __param(2, IStorageService))], IssueTroubleshootUi));
335
346
  ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(IssueTroubleshootUi, LifecyclePhase.Restored);
336
347
  registerAction2(class TroubleshootIssueAction extends Action2 {
337
348
  constructor() {
338
349
  super({
339
- id: 'workbench.action.troubleshootIssue.start',
340
- title: ( localize2(8498, 'Troubleshoot Issue...')),
350
+ id: "workbench.action.troubleshootIssue.start",
351
+ title: ( localize2(8805, "Troubleshoot Issue...")),
341
352
  category: Categories.Help,
342
353
  f1: true,
343
- precondition: ( ContextKeyExpr.and(( IssueTroubleshootUi.ctxIsTroubleshootActive.negate()), ( RemoteNameContext.isEqualTo('')), ( IsWebContext.negate()))),
354
+ precondition: ( ContextKeyExpr.and(( IssueTroubleshootUi.ctxIsTroubleshootActive.negate()), ( RemoteNameContext.isEqualTo("")), ( IsWebContext.negate())))
344
355
  });
345
356
  }
346
357
  run(accessor) {
@@ -350,8 +361,8 @@ registerAction2(class TroubleshootIssueAction extends Action2 {
350
361
  registerAction2(class extends Action2 {
351
362
  constructor() {
352
363
  super({
353
- id: 'workbench.action.troubleshootIssue.stop',
354
- title: ( localize2(8499, 'Stop Troubleshoot Issue')),
364
+ id: "workbench.action.troubleshootIssue.stop",
365
+ title: ( localize2(8806, "Stop Troubleshoot Issue")),
355
366
  category: Categories.Help,
356
367
  f1: true,
357
368
  precondition: IssueTroubleshootUi.ctxIsTroubleshootActive
@@ -80,9 +80,7 @@
80
80
  .issue-reporter-body .monaco-text-button {
81
81
  display: block;
82
82
  width: auto;
83
- padding: 4px 10px;
84
83
  align-self: flex-end;
85
- font-size: 13px;
86
84
  }
87
85
 
88
86
  .issue-reporter-body .monaco-button-dropdown {
@@ -603,10 +601,6 @@ body.issue-reporter-body {
603
601
  line-height: 15px; /* approximate button height for vertical centering */
604
602
  }
605
603
 
606
- .issue-reporter-body .internal-elements .monaco-text-button {
607
- font-size: 10px;
608
- padding: 2px 8px;
609
- }
610
604
 
611
605
  .issue-reporter-body .internal-elements #show-private-repo-name {
612
606
  align-self: flex-end;
@@ -10,50 +10,45 @@ import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/pla
10
10
  import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
11
11
  import { IWorkbenchIssueService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/issue/common/issue.service';
12
12
 
13
- const OpenIssueReporterActionId = 'workbench.action.openIssueReporter';
14
- const OpenIssueReporterApiId = 'vscode.openIssueReporter';
13
+ const OpenIssueReporterActionId = "workbench.action.openIssueReporter";
14
+ const OpenIssueReporterApiId = "vscode.openIssueReporter";
15
15
  const OpenIssueReporterCommandMetadata = {
16
- description: 'Open the issue reporter and optionally prefill part of the form.',
17
- args: [
18
- {
19
- name: 'options',
20
- description: 'Data to use to prefill the issue reporter with.',
21
- isOptional: true,
22
- schema: {
23
- oneOf: [
24
- {
25
- type: 'string',
26
- description: 'The extension id to preselect.'
16
+ description: "Open the issue reporter and optionally prefill part of the form.",
17
+ args: [{
18
+ name: "options",
19
+ description: "Data to use to prefill the issue reporter with.",
20
+ isOptional: true,
21
+ schema: {
22
+ oneOf: [{
23
+ type: "string",
24
+ description: "The extension id to preselect."
25
+ }, {
26
+ type: "object",
27
+ properties: {
28
+ extensionId: {
29
+ type: "string"
27
30
  },
28
- {
29
- type: 'object',
30
- properties: {
31
- extensionId: {
32
- type: 'string'
33
- },
34
- issueTitle: {
35
- type: 'string'
36
- },
37
- issueBody: {
38
- type: 'string'
39
- }
40
- }
31
+ issueTitle: {
32
+ type: "string"
33
+ },
34
+ issueBody: {
35
+ type: "string"
41
36
  }
42
- ]
43
- }
44
- },
45
- ]
37
+ }
38
+ }]
39
+ }
40
+ }]
46
41
  };
47
42
  let BaseIssueContribution = class BaseIssueContribution extends Disposable {
48
43
  constructor(productService, configurationService) {
49
44
  super();
50
- if (!configurationService.getValue('telemetry.feedback.enabled')) {
45
+ if (!configurationService.getValue("telemetry.feedback.enabled")) {
51
46
  this._register(CommandsRegistry.registerCommand({
52
- id: 'workbench.action.openIssueReporter',
53
- handler: function (accessor) {
47
+ id: "workbench.action.openIssueReporter",
48
+ handler: function(accessor) {
54
49
  const data = accessor.get(INotificationService);
55
- data.info('Feedback is disabled.');
56
- },
50
+ data.info("Feedback is disabled.");
51
+ }
57
52
  }));
58
53
  return;
59
54
  }
@@ -62,47 +57,46 @@ let BaseIssueContribution = class BaseIssueContribution extends Disposable {
62
57
  }
63
58
  this._register(CommandsRegistry.registerCommand({
64
59
  id: OpenIssueReporterActionId,
65
- handler: function (accessor, args) {
66
- const data = typeof args === 'string'
67
- ? { extensionId: args }
68
- : Array.isArray(args)
69
- ? { extensionId: args[0] }
70
- : args ?? {};
60
+ handler: function(accessor, args) {
61
+ const data = typeof args === "string" ? {
62
+ extensionId: args
63
+ } : Array.isArray(args) ? {
64
+ extensionId: args[0]
65
+ } : args ?? {};
71
66
  return accessor.get(IWorkbenchIssueService).openReporter(data);
72
67
  },
73
68
  metadata: OpenIssueReporterCommandMetadata
74
69
  }));
75
70
  this._register(CommandsRegistry.registerCommand({
76
71
  id: OpenIssueReporterApiId,
77
- handler: function (accessor, args) {
78
- const data = typeof args === 'string'
79
- ? { extensionId: args }
80
- : Array.isArray(args)
81
- ? { extensionId: args[0] }
82
- : args ?? {};
72
+ handler: function(accessor, args) {
73
+ const data = typeof args === "string" ? {
74
+ extensionId: args
75
+ } : Array.isArray(args) ? {
76
+ extensionId: args[0]
77
+ } : args ?? {};
83
78
  return accessor.get(IWorkbenchIssueService).openReporter(data);
84
79
  },
85
80
  metadata: OpenIssueReporterCommandMetadata
86
81
  }));
87
82
  const reportIssue = {
88
83
  id: OpenIssueReporterActionId,
89
- title: ( localize2(8500, "Report Issue...")),
84
+ title: ( localize2(8807, "Report Issue...")),
90
85
  category: Categories.Help
91
86
  };
92
- this._register(MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: reportIssue }));
87
+ this._register(MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
88
+ command: reportIssue
89
+ }));
93
90
  this._register(MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
94
- group: '3_feedback',
91
+ group: "3_feedback",
95
92
  command: {
96
93
  id: OpenIssueReporterActionId,
97
- title: ( localize(8501, "Report &&Issue"))
94
+ title: ( localize(8808, "Report &&Issue"))
98
95
  },
99
96
  order: 3
100
97
  }));
101
98
  }
102
99
  };
103
- BaseIssueContribution = ( __decorate([
104
- ( __param(0, IProductService)),
105
- ( __param(1, IConfigurationService))
106
- ], BaseIssueContribution));
100
+ BaseIssueContribution = ( __decorate([( __param(0, IProductService)), ( __param(1, IConfigurationService))], BaseIssueContribution));
107
101
 
108
102
  export { BaseIssueContribution };