@codingame/monaco-vscode-issue-service-override 38.1.3 → 39.0.1

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.
@@ -0,0 +1,38 @@
1
+
2
+ import '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
3
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
5
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
6
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import { getMediaMime, Mimes, getExtensionForMimeType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/mime';
8
+ import { extname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
9
+
10
+ const MAX_ISSUE_IMAGE_BYTES = 10 * 1024 * 1024;
11
+ const MAX_ISSUE_VIDEO_BYTES = 100 * 1024 * 1024;
12
+ const MAX_ISSUE_FILE_BYTES = 25 * 1024 * 1024;
13
+ function getIssueReporterMediaFormat(name, type = "") {
14
+ const inferredType = getMediaMime(name);
15
+ const declaredType = type.split(";", 1)[0].trim().toLowerCase();
16
+ const mimeType = declaredType && declaredType !== Mimes.binary ? type : (inferredType === "image/jpg" ? "image/jpeg" : inferredType) || Mimes.binary;
17
+ const mediaType = mimeType.split(";", 1)[0].trim().toLowerCase();
18
+ const kind = mediaType.startsWith("image/") ? "image" : mediaType.startsWith("video/") ? "video" : "file";
19
+ const originalExtension = extname(name).slice(1).toLowerCase();
20
+ const inferredExtension = mediaType === "image/jpeg" || mediaType === "image/jpg" ? "jpg" : getExtensionForMimeType(mediaType)?.slice(1);
21
+ return {
22
+ kind,
23
+ mimeType,
24
+ extension: /^[a-z0-9][a-z0-9_+-]*$/.test(originalExtension) ? originalExtension : inferredExtension || "bin",
25
+ maxBytes: kind === "image" ? MAX_ISSUE_IMAGE_BYTES : kind === "video" ? MAX_ISSUE_VIDEO_BYTES : MAX_ISSUE_FILE_BYTES
26
+ };
27
+ }
28
+ function getIssueReporterScreenshotFile(screenshot, screenshotNumber) {
29
+ const dataUrl = screenshot.annotatedDataUrl ?? screenshot.dataUrl;
30
+ const format = getIssueReporterMediaFormat("", dataUrl.slice(5, ( dataUrl.indexOf(","))).split(";", 1)[0]);
31
+ return {
32
+ dataUrl,
33
+ name: `screenshot-${screenshotNumber}.${format.extension}`,
34
+ format
35
+ };
36
+ }
37
+
38
+ export { MAX_ISSUE_FILE_BYTES, MAX_ISSUE_IMAGE_BYTES, MAX_ISSUE_VIDEO_BYTES, getIssueReporterMediaFormat, getIssueReporterScreenshotFile };
@@ -2,18 +2,18 @@
2
2
  import { escape } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
3
3
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
4
4
 
5
- const sendSystemInfoLabel = escape(( localize(18084, "Include my system information")));
6
- const sendProcessInfoLabel = escape(( localize(18085, "Include my currently running processes")));
7
- const sendWorkspaceInfoLabel = escape(( localize(18086, "Include my workspace metadata")));
8
- const sendExtensionsLabel = escape(( localize(18087, "Include my enabled extensions")));
9
- const sendExperimentsLabel = escape(( localize(18088, "Include A/B experiment info")));
10
- const sendExtensionData = escape(( localize(18089, "Include additional extension info")));
5
+ const sendSystemInfoLabel = escape(( localize(20899, "Include my system information")));
6
+ const sendProcessInfoLabel = escape(( localize(20900, "Include my currently running processes")));
7
+ const sendWorkspaceInfoLabel = escape(( localize(20901, "Include my workspace metadata")));
8
+ const sendExtensionsLabel = escape(( localize(20902, "Include my enabled extensions")));
9
+ const sendExperimentsLabel = escape(( localize(20903, "Include A/B experiment info")));
10
+ const sendExtensionData = escape(( localize(20904, "Include additional extension info")));
11
11
  const acknowledgementsLabel = escape(( localize(
12
- 18090,
12
+ 20905,
13
13
  "I acknowledge that my VS Code version is not updated and this issue may be closed."
14
14
  )));
15
15
  const reviewGuidanceLabel = ( localize(
16
- 18091,
16
+ 20906,
17
17
  "Before you report an issue here please <a href=\"https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions\" target=\"_blank\">review the guidance we provide</a>. Please complete the form in English."
18
18
  ));
19
19
  var BaseHtml = () => `
@@ -23,40 +23,40 @@ var BaseHtml = () => `
23
23
  </span>
24
24
  </div>
25
25
  <div class="issue-reporter" id="issue-reporter">
26
- <div id="english" class="input-group hidden">${escape(( localize(18092, "Please complete the form in English.")))}</div>
26
+ <div id="english" class="input-group hidden">${escape(( localize(20907, "Please complete the form in English.")))}</div>
27
27
 
28
28
  <div id="review-guidance-help-text" class="input-group">${reviewGuidanceLabel}</div>
29
29
 
30
30
  <div class="section">
31
31
  <div class="input-group">
32
- <label class="inline-label" for="issue-type">${escape(( localize(18093, "This is a")))}</label>
32
+ <label class="inline-label" for="issue-type">${escape(( localize(20908, "This is a")))}</label>
33
33
  <select id="issue-type" class="inline-form-control">
34
34
  <!-- To be dynamically filled -->
35
35
  </select>
36
36
  </div>
37
37
 
38
38
  <div class="input-group" id="problem-source">
39
- <label class="inline-label" for="issue-source">${escape(( localize(18094, "For")))} <span class="required-input">*</span></label>
39
+ <label class="inline-label" for="issue-source">${escape(( localize(20909, "For")))} <span class="required-input">*</span></label>
40
40
  <select id="issue-source" class="inline-form-control" required>
41
41
  <!-- To be dynamically filled -->
42
42
  </select>
43
- <div id="issue-source-empty-error" class="validation-error hidden" role="alert">${escape(( localize(18095, "An issue source is required.")))}</div>
43
+ <div id="issue-source-empty-error" class="validation-error hidden" role="alert">${escape(( localize(20910, "An issue source is required.")))}</div>
44
44
  <div id="problem-source-help-text" class="instructions hidden">${escape(( localize(
45
- 18096,
45
+ 20911,
46
46
  "Try to reproduce the problem after {0}. If the problem only reproduces when extensions are active, it is likely an issue with an extension."
47
47
  ))).replace(
48
48
  "{0}",
49
- () => `<span tabIndex=0 role="button" id="disableExtensions" class="workbenchCommand">${escape(( localize(18097, "disabling all extensions and reloading the window")))}</span>`
49
+ () => `<span tabIndex=0 role="button" id="disableExtensions" class="workbenchCommand">${escape(( localize(20912, "disabling all extensions and reloading the window")))}</span>`
50
50
  )}
51
51
  </div>
52
52
 
53
53
  <div id="extension-selection">
54
- <label class="inline-label" for="extension-selector">${escape(( localize(18098, "Extension")))} <span class="required-input">*</span></label>
54
+ <label class="inline-label" for="extension-selector">${escape(( localize(20913, "Extension")))} <span class="required-input">*</span></label>
55
55
  <select id="extension-selector" class="inline-form-control">
56
56
  <!-- To be dynamically filled -->
57
57
  </select>
58
58
  <div id="extension-selection-validation-error" class="validation-error hidden" role="alert">${escape(( localize(
59
- 18099,
59
+ 20914,
60
60
  "The issue reporter is unable to create issues for this extension. Please visit {0} to report an issue."
61
61
  ))).replace(
62
62
  "{0}",
@@ -64,7 +64,7 @@ var BaseHtml = () => `
64
64
  )}</div>
65
65
  <div id="extension-selection-validation-error-no-url" class="validation-error hidden" role="alert">
66
66
  ${escape(( localize(
67
- 18100,
67
+ 20915,
68
68
  "The issue reporter is unable to create issues for this extension, as it does not specify a URL for reporting issues. Please check the marketplace page of this extension to see if other instructions are available."
69
69
  )))}
70
70
  </div>
@@ -72,10 +72,10 @@ var BaseHtml = () => `
72
72
  </div>
73
73
 
74
74
  <div id="issue-title-container" class="input-group">
75
- <label class="inline-label" for="issue-title">${escape(( localize(18101, "Title")))} <span class="required-input">*</span></label>
76
- <input id="issue-title" type="text" class="inline-form-control" placeholder="${escape(( localize(18102, "Please enter a title.")))}" required>
77
- <div id="issue-title-empty-error" class="validation-error hidden" role="alert">${escape(( localize(18103, "A title is required.")))}</div>
78
- <div id="issue-title-length-validation-error" class="validation-error hidden" role="alert">${escape(( localize(18104, "The title is too long.")))}</div>
75
+ <label class="inline-label" for="issue-title">${escape(( localize(20916, "Title")))} <span class="required-input">*</span></label>
76
+ <input id="issue-title" type="text" class="inline-form-control" placeholder="${escape(( localize(20917, "Please enter a title.")))}" required>
77
+ <div id="issue-title-empty-error" class="validation-error hidden" role="alert">${escape(( localize(20918, "A title is required.")))}</div>
78
+ <div id="issue-title-length-validation-error" class="validation-error hidden" role="alert">${escape(( localize(20919, "The title is too long.")))}</div>
79
79
  <small id="similar-issues">
80
80
  <!-- To be dynamically filled -->
81
81
  </small>
@@ -91,10 +91,10 @@ var BaseHtml = () => `
91
91
  <!-- To be dynamically filled -->
92
92
  </div>
93
93
  <div class="block-info-text">
94
- <textarea name="description" id="description" placeholder="${escape(( localize(18105, "Please enter details.")))}" required></textarea>
94
+ <textarea name="description" id="description" placeholder="${escape(( localize(20920, "Please enter details.")))}" required></textarea>
95
95
  </div>
96
- <div id="description-empty-error" class="validation-error hidden" role="alert">${escape(( localize(18106, "A description is required.")))}</div>
97
- <div id="description-short-error" class="validation-error hidden" role="alert">${escape(( localize(18107, "Please provide a longer description.")))}</div>
96
+ <div id="description-empty-error" class="validation-error hidden" role="alert">${escape(( localize(20921, "A description is required.")))}</div>
97
+ <div id="description-short-error" class="validation-error hidden" role="alert">${escape(( localize(20922, "Please provide a longer description.")))}</div>
98
98
  </div>
99
99
 
100
100
  <div class="system-info" id="block-container">
@@ -103,10 +103,10 @@ var BaseHtml = () => `
103
103
  <label class="extension-caption" id="extension-caption" for="includeExtensionData">
104
104
  ${sendExtensionData}
105
105
  <span id="ext-loading" hidden></span>
106
- <span class="ext-parens" hidden>(</span><a href="#" class="showInfo" id="extension-id">${escape(( localize(18108, "show")))}</a><span class="ext-parens" hidden>)</span>
107
- <a id="extension-data-download">${escape(( localize(18109, "Download Extension Data")))}</a>
106
+ <span class="ext-parens" hidden>(</span><a href="#" class="showInfo" id="extension-id">${escape(( localize(20923, "show")))}</a><span class="ext-parens" hidden>)</span>
107
+ <a id="extension-data-download">${escape(( localize(20924, "Download Extension Data")))}</a>
108
108
  </label>
109
- <pre class="block-info" id="extension-data" placeholder="${escape(( localize(18110, "Extension does not have additional data to include.")))}" style="white-space: pre-wrap; user-select: text;">
109
+ <pre class="block-info" id="extension-data" placeholder="${escape(( localize(20925, "Extension does not have additional data to include.")))}" style="white-space: pre-wrap; user-select: text;">
110
110
  <!-- To be dynamically filled -->
111
111
  </pre>
112
112
  </div>
@@ -115,7 +115,7 @@ var BaseHtml = () => `
115
115
  <input class="sendData" aria-label="${sendSystemInfoLabel}" type="checkbox" id="includeSystemInfo" checked/>
116
116
  <label class="caption" for="includeSystemInfo">
117
117
  ${sendSystemInfoLabel}
118
- (<a href="#" class="showInfo">${escape(( localize(18108, "show")))}</a>)
118
+ (<a href="#" class="showInfo">${escape(( localize(20923, "show")))}</a>)
119
119
  </label>
120
120
  <div class="block-info hidden" style="user-select: text;">
121
121
  <!-- To be dynamically filled -->
@@ -125,7 +125,7 @@ var BaseHtml = () => `
125
125
  <input class="sendData" aria-label="${sendProcessInfoLabel}" type="checkbox" id="includeProcessInfo" checked/>
126
126
  <label class="caption" for="includeProcessInfo">
127
127
  ${sendProcessInfoLabel}
128
- (<a href="#" class="showInfo">${escape(( localize(18108, "show")))}</a>)
128
+ (<a href="#" class="showInfo">${escape(( localize(20923, "show")))}</a>)
129
129
  </label>
130
130
  <pre class="block-info hidden" style="user-select: text;">
131
131
  <code>
@@ -137,7 +137,7 @@ var BaseHtml = () => `
137
137
  <input class="sendData" aria-label="${sendWorkspaceInfoLabel}" type="checkbox" id="includeWorkspaceInfo" checked/>
138
138
  <label class="caption" for="includeWorkspaceInfo">
139
139
  ${sendWorkspaceInfoLabel}
140
- (<a href="#" class="showInfo">${escape(( localize(18108, "show")))}</a>)
140
+ (<a href="#" class="showInfo">${escape(( localize(20923, "show")))}</a>)
141
141
  </label>
142
142
  <pre id="systemInfo" class="block-info hidden" style="user-select: text;">
143
143
  <code>
@@ -149,7 +149,7 @@ var BaseHtml = () => `
149
149
  <input class="sendData" aria-label="${sendExtensionsLabel}" type="checkbox" id="includeExtensions" checked/>
150
150
  <label class="caption" for="includeExtensions">
151
151
  ${sendExtensionsLabel}
152
- (<a href="#" class="showInfo">${escape(( localize(18108, "show")))}</a>)
152
+ (<a href="#" class="showInfo">${escape(( localize(20923, "show")))}</a>)
153
153
  </label>
154
154
  <div id="systemInfo" class="block-info hidden" style="user-select: text;">
155
155
  <!-- To be dynamically filled -->
@@ -159,7 +159,7 @@ var BaseHtml = () => `
159
159
  <input class="sendData" aria-label="${sendExperimentsLabel}" type="checkbox" id="includeExperiments" checked/>
160
160
  <label class="caption" for="includeExperiments">
161
161
  ${sendExperimentsLabel}
162
- (<a href="#" class="showInfo">${escape(( localize(18108, "show")))}</a>)
162
+ (<a href="#" class="showInfo">${escape(( localize(20923, "show")))}</a>)
163
163
  </label>
164
164
  <pre class="block-info hidden" style="user-select: text;">
165
165
  <!-- To be dynamically filled -->
@@ -64,7 +64,7 @@ let IssueWebReporter = class IssueWebReporter extends BaseIssueReporterService {
64
64
  });
65
65
  const descriptionTextArea = this.getElementById("issue-title");
66
66
  if (descriptionTextArea) {
67
- descriptionTextArea.placeholder = ( localize(18111, "Please enter a title"));
67
+ descriptionTextArea.placeholder = ( localize(20926, "Please enter a title"));
68
68
  }
69
69
  this.updateButtonStates();
70
70
  this.setSourceOptions();
@@ -13,6 +13,7 @@ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform
13
13
  import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
14
14
  import { textLinkActiveForeground, textLinkForeground, foreground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
15
15
  import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
16
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/confettiColors';
16
17
  import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
17
18
  import { buttonHoverBackground, buttonForeground, buttonBackground, inputValidationErrorForeground, inputValidationErrorBackground, inputValidationErrorBorder, inputActiveOptionBorder, inputBorder, inputForeground, inputBackground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
18
19
  import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
@@ -102,13 +102,13 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
102
102
  throw ( new Error("invalid state"));
103
103
  }
104
104
  const res = await this.dialogService.confirm({
105
- message: ( localize(18112, "Troubleshoot Issue")),
105
+ message: ( localize(20927, "Troubleshoot Issue")),
106
106
  detail: ( localize(
107
- 18113,
107
+ 20928,
108
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.",
109
109
  this.productService.nameLong
110
110
  )),
111
- primaryButton: ( localize(18114, "&&Troubleshoot Issue")),
111
+ primaryButton: ( localize(20929, "&&Troubleshoot Issue")),
112
112
  custom: true
113
113
  });
114
114
  if (!res.confirmed) {
@@ -152,7 +152,7 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
152
152
  return;
153
153
  }
154
154
  const result = await this.askToReproduceIssue(( localize(
155
- 18115,
155
+ 20930,
156
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."
157
157
  )));
158
158
  if (result === "good") {
@@ -170,7 +170,7 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
170
170
  await this.userDataProfileManagementService.createAndEnterTransientProfile();
171
171
  this.updateState(this.state);
172
172
  const result = await this.askToReproduceIssue(( localize(
173
- 18116,
173
+ 20931,
174
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."
175
175
  )));
176
176
  if (result === "stop") {
@@ -178,13 +178,13 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
178
178
  }
179
179
  if (result === "good") {
180
180
  await this.askToReportIssue(( localize(
181
- 18117,
181
+ 20932,
182
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."
183
183
  )));
184
184
  }
185
185
  if (result === "bad") {
186
186
  await this.askToReportIssue(( localize(
187
- 18118,
187
+ 20933,
188
188
  "Issue troubleshooting has identified that the issue is with {0}.",
189
189
  this.productService.nameLong
190
190
  )));
@@ -199,15 +199,15 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
199
199
  askToReproduceIssue(message) {
200
200
  return (new Promise((c, e) => {
201
201
  const goodPrompt = {
202
- label: ( localize(18119, "I Can't Reproduce")),
202
+ label: ( localize(20934, "I Can't Reproduce")),
203
203
  run: () => c("good")
204
204
  };
205
205
  const badPrompt = {
206
- label: ( localize(18120, "I Can Reproduce")),
206
+ label: ( localize(20935, "I Can Reproduce")),
207
207
  run: () => c("bad")
208
208
  };
209
209
  const stop = {
210
- label: ( localize(18121, "Stop")),
210
+ label: ( localize(20936, "Stop")),
211
211
  run: () => c("stop")
212
212
  };
213
213
  this.notificationHandle = this.notificationService.prompt(Severity.Info, message, [goodPrompt, badPrompt, stop], {
@@ -223,9 +223,9 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
223
223
  if (res === "good") {
224
224
  await this.dialogService.prompt({
225
225
  type: Severity.Info,
226
- message: ( localize(18112, "Troubleshoot Issue")),
226
+ message: ( localize(20927, "Troubleshoot Issue")),
227
227
  detail: ( localize(
228
- 18122,
228
+ 20937,
229
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.",
230
230
  this.productService.nameLong
231
231
  )),
@@ -248,11 +248,11 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
248
248
  async askToReproduceIssueWithInsiders() {
249
249
  const confirmRes = await this.dialogService.confirm({
250
250
  type: "info",
251
- message: ( localize(18112, "Troubleshoot Issue")),
252
- primaryButton: ( localize(18123, "Download {0} Insiders", this.productService.nameLong)),
253
- cancelButton: ( localize(18124, "Report Issue Anyway")),
251
+ message: ( localize(20927, "Troubleshoot Issue")),
252
+ primaryButton: ( localize(20938, "Download {0} Insiders", this.productService.nameLong)),
253
+ cancelButton: ( localize(20939, "Report Issue Anyway")),
254
254
  detail: ( localize(
255
- 18125,
255
+ 20940,
256
256
  "Please try to download and reproduce the issue in {0} insiders.",
257
257
  this.productService.nameLong
258
258
  )),
@@ -269,20 +269,20 @@ let TroubleshootIssueService = class TroubleshootIssueService extends Disposable
269
269
  }
270
270
  const res = await this.dialogService.prompt({
271
271
  type: "info",
272
- message: ( localize(18112, "Troubleshoot Issue")),
272
+ message: ( localize(20927, "Troubleshoot Issue")),
273
273
  buttons: [{
274
- label: ( localize(18126, "I can't reproduce")),
274
+ label: ( localize(20941, "I can't reproduce")),
275
275
  run: () => "good"
276
276
  }, {
277
- label: ( localize(18127, "I can reproduce")),
277
+ label: ( localize(20942, "I can reproduce")),
278
278
  run: () => "bad"
279
279
  }],
280
280
  cancelButton: {
281
- label: ( localize(18128, "Stop")),
281
+ label: ( localize(20943, "Stop")),
282
282
  run: () => "stop"
283
283
  },
284
284
  detail: ( localize(
285
- 18129,
285
+ 20944,
286
286
  "Please try to reproduce the issue in {0} insiders and confirm if the issue exists there.",
287
287
  this.productService.nameLong
288
288
  )),
@@ -348,7 +348,7 @@ registerAction2(class TroubleshootIssueAction extends Action2 {
348
348
  constructor() {
349
349
  super({
350
350
  id: "workbench.action.troubleshootIssue.start",
351
- title: ( localize2(18130, "Troubleshoot Issue...")),
351
+ title: ( localize2(20945, "Troubleshoot Issue...")),
352
352
  category: Categories.Help,
353
353
  f1: true,
354
354
  precondition: ( ContextKeyExpr.and(( IssueTroubleshootUi.ctxIsTroubleshootActive.negate()), ( RemoteNameContext.isEqualTo("")), ( IsWebContext.negate())))
@@ -362,7 +362,7 @@ registerAction2(class extends Action2 {
362
362
  constructor() {
363
363
  super({
364
364
  id: "workbench.action.troubleshootIssue.stop",
365
- title: ( localize2(18131, "Stop Troubleshoot Issue")),
365
+ title: ( localize2(20946, "Stop Troubleshoot Issue")),
366
366
  category: Categories.Help,
367
367
  f1: true,
368
368
  precondition: IssueTroubleshootUi.ctxIsTroubleshootActive
@@ -81,7 +81,7 @@ let BaseIssueContribution = class BaseIssueContribution extends Disposable {
81
81
  }));
82
82
  const reportIssue = {
83
83
  id: OpenIssueReporterActionId,
84
- title: ( localize2(18132, "Report Issue...")),
84
+ title: ( localize2(20947, "Report Issue...")),
85
85
  category: Categories.Help
86
86
  };
87
87
  this._register(MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
@@ -91,7 +91,7 @@ let BaseIssueContribution = class BaseIssueContribution extends Disposable {
91
91
  group: "3_feedback",
92
92
  command: {
93
93
  id: OpenIssueReporterActionId,
94
- title: ( localize(18133, "Report &&Issue"))
94
+ title: ( localize(20948, "Report &&Issue"))
95
95
  },
96
96
  order: 3
97
97
  }));
@@ -50,6 +50,7 @@ export interface IssueReporterExtensionData {
50
50
  extensionTemplate?: string;
51
51
  data?: string;
52
52
  uri?: UriComponents;
53
+ /** An optional internal destination, not the default destination. */
53
54
  privateUri?: UriComponents;
54
55
  }
55
56
  export interface IssueReporterData extends WindowData {
@@ -57,13 +58,13 @@ export interface IssueReporterData extends WindowData {
57
58
  enabledExtensions: IssueReporterExtensionData[];
58
59
  /**
59
60
  * Resolves once `enabledExtensions` has been populated (or failed to populate).
60
- * Lets the wizard pane wait for the async extension enumeration in
61
+ * Lets the reporter pane wait for the async extension enumeration in
61
62
  * `NativeIssueService` to finish before rendering the extensions section.
62
63
  */
63
64
  whenExtensionsLoaded?: Promise<void>;
64
65
  /**
65
66
  * Resolves once all async data (extensions, token, integrity, experiments)
66
- * has been populated. Lets the wizard pane forward late-arriving values
67
+ * has been populated. Lets the reporter pane forward late-arriving values
67
68
  * like `isInstallationPure` and `githubAccessToken` into the overlay model.
68
69
  */
69
70
  whenDataComplete?: Promise<void>;
@@ -75,33 +76,55 @@ export interface IssueReporterData extends WindowData {
75
76
  isInstallationPure: boolean;
76
77
  isSessionsWindow: boolean;
77
78
  githubAccessToken: string;
79
+ /** Refreshes an automatically selected GitHub session before a new reporter preview. */
80
+ getGitHubAccessToken?: () => Promise<string>;
78
81
  issueTitle?: string;
79
82
  issueBody?: string;
80
83
  data?: string;
81
84
  uri?: UriComponents;
85
+ /** An optional internal destination, not the default destination. */
82
86
  privateUri?: UriComponents;
87
+ /** Additional product-report destinations, in owner/repo form. */
88
+ additionalRepositories?: readonly string[];
89
+ /** The user's repository choice, independent of the issue source. */
90
+ issueRepository?: string;
83
91
  }
84
92
  export interface ISettingSearchResult {
85
93
  extensionId: string;
86
94
  key: string;
87
95
  score: number;
88
96
  }
89
- /**
90
- * Narrow surface of the issue reporter wizard that `IIssueFormService.submitIssue`
91
- * relies on. Keeping this in `common/` (rather than depending on the browser-side
92
- * `IssueReporterOverlay` class) lets the service interface be implemented and
93
- * consumed cleanly across layers.
94
- */
97
+ export interface IIssueReporterFileAttachment {
98
+ readonly filePath: string;
99
+ readonly name: string;
100
+ readonly mimeType: string;
101
+ readonly thumbnailDataUrl?: string;
102
+ readonly durationMs?: number;
103
+ }
104
+ export interface IIssueReporterScreenshot {
105
+ readonly dataUrl: string;
106
+ readonly annotatedDataUrl?: string;
107
+ }
108
+ export interface IIssueReporterAttachmentUpload {
109
+ readonly destination: string;
110
+ readonly state: "pending" | "uploading" | "done";
111
+ }
112
+ export type IssueReporterAttachment<TScreenshot extends IIssueReporterScreenshot = IIssueReporterScreenshot> = {
113
+ readonly id: string;
114
+ upload?: IIssueReporterAttachmentUpload;
115
+ } & ({
116
+ readonly kind: "screenshot";
117
+ readonly screenshot: TScreenshot;
118
+ } | {
119
+ readonly kind: "file";
120
+ readonly file: IIssueReporterFileAttachment;
121
+ });
122
+ /** The new reporter's attachment and upload feedback contract. */
95
123
  export interface IIssueSubmissionHost {
96
- getScreenshots(): readonly {
97
- readonly dataUrl: string;
98
- readonly annotatedDataUrl?: string;
99
- }[];
100
- getRecordings(): readonly {
101
- readonly filePath: string;
102
- }[];
124
+ getAttachments(): readonly IssueReporterAttachment[];
103
125
  setUploading(uploading: boolean): void;
104
- setAttachmentUploadState(index: number, state: "pending" | "uploading" | "done"): void;
126
+ setAttachmentUploadState(attachment: IssueReporterAttachment, upload: IIssueReporterAttachmentUpload): void;
127
+ setAttachmentUploadError(message: string | undefined, details?: string): void;
105
128
  }
106
129
  export interface ISimilarIssue {
107
130
  readonly html_url: string;
@@ -0,0 +1,24 @@
1
+ import { IProductConfiguration } from "@codingame/monaco-vscode-api/vscode/vs/base/common/product";
2
+ import { IssueReporterData } from "./issue.js";
3
+ export declare const issueReporterAdditionalRepositoriesSettingId = "issueReporter.additionalRepositories";
4
+ export declare const issueReporterRepositoryPattern = "^[a-zA-Z0-9](?:[a-zA-Z0-9]|-(?=[a-zA-Z0-9])){0,38}/(?!\\.{1,2}$)[a-zA-Z0-9_.-]{1,100}$(?![\\r\\n])";
5
+ export declare const internalIssueReporterUrl = "https://github.com/microsoft/vscode-internalbacklog";
6
+ type IssueTargetData = Pick<IssueReporterData, "issueSource" | "extensionId" | "enabledExtensions" | "uri" | "privateUri" | "additionalRepositories" | "issueRepository">;
7
+ type IssueProduct = Pick<IProductConfiguration, "reportIssueUrl" | "reportMarketplaceIssueUrl">;
8
+ export interface IssueReporterTarget {
9
+ readonly url: string;
10
+ readonly external: boolean;
11
+ readonly isPrivate: boolean;
12
+ readonly isPublic: boolean;
13
+ readonly repository: {
14
+ readonly owner: string;
15
+ readonly repositoryName: string;
16
+ } | undefined;
17
+ }
18
+ export declare function parseIssueReporterRepositories(value: unknown): readonly string[];
19
+ export declare function parseGitHubRepository(url: string): IssueReporterTarget["repository"];
20
+ export declare function isPublicVSCodeIssueUrl(url: string | undefined): boolean;
21
+ export declare function getIssueReporterRepositoryChoices(data: IssueTargetData, product: IssueProduct): readonly IssueReporterTarget[];
22
+ export declare function resolveIssueReporterTarget(data: IssueTargetData, product: IssueProduct): IssueReporterTarget | undefined;
23
+ export declare function getIssueReporterUrlWithTitle(issueTitle: string, issueUrl: string): string;
24
+ export {};