@codingame/monaco-vscode-output-service-override 13.1.7 → 14.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.
@@ -7,7 +7,7 @@ import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/regist
7
7
  import { registerAction2, Action2, MenuId, MenuRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
8
8
  import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
9
9
  import './outputServices.js';
10
- import { OUTPUT_MIME, OUTPUT_MODE_ID, LOG_MIME, LOG_MODE_ID, OUTPUT_VIEW_ID, ACTIVE_OUTPUT_CHANNEL_CONTEXT, Extensions as Extensions$1, CONTEXT_IN_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, CONTEXT_ACTIVE_FILE_OUTPUT, CONTEXT_ACTIVE_OUTPUT_LEVEL_SETTABLE, CONTEXT_ACTIVE_OUTPUT_LEVEL, CONTEXT_ACTIVE_OUTPUT_LEVEL_IS_DEFAULT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output';
10
+ import { OUTPUT_MIME, OUTPUT_MODE_ID, LOG_MIME, LOG_MODE_ID, OUTPUT_VIEW_ID, ACTIVE_OUTPUT_CHANNEL_CONTEXT, Extensions as Extensions$1, CONTEXT_IN_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, CONTEXT_ACTIVE_OUTPUT_LEVEL_SETTABLE, CONTEXT_ACTIVE_OUTPUT_LEVEL, CONTEXT_ACTIVE_OUTPUT_LEVEL_IS_DEFAULT, isSingleSourceOutputChannelDescriptor, CONTEXT_ACTIVE_LOG_FILE_OUTPUT, SHOW_TRACE_FILTER_CONTEXT, SHOW_DEBUG_FILTER_CONTEXT, SHOW_INFO_FILTER_CONTEXT, SHOW_WARNING_FILTER_CONTEXT, SHOW_ERROR_FILTER_CONTEXT, OUTPUT_FILTER_FOCUS_CONTEXT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output';
11
11
  import { IOutputService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output.service';
12
12
  import { OutputViewPane } from './outputView.js';
13
13
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
@@ -15,29 +15,33 @@ import { Extensions as Extensions$2 } from '@codingame/monaco-vscode-api/vscode/
15
15
  import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
16
16
  import { Extensions, ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
17
17
  import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
18
- import { ViewPaneContainer } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
18
+ import { ViewPaneContainer } from '@codingame/monaco-vscode-91789cdf-e3cb-5a04-aaeb-6f7df7d3d231-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
19
19
  import { Extensions as Extensions$3, ConfigurationScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
20
20
  import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
21
21
  import { AUX_WINDOW_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
22
22
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
23
- import { assertIsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
24
23
  import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
25
24
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
26
25
  import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/iconRegistry';
27
26
  import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
28
27
  import { Disposable, toDisposable, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
29
- import { IFilesConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
30
28
  import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
31
29
  import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
32
30
  import { LogLevelToLocalizedString, LogLevelToString, LogLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log';
33
31
  import { ILoggerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
34
32
  import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/logs/common/defaultLogLevels.service';
35
- import { KeybindingsRegistry, KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
33
+ import { KeybindingWeight, KeybindingsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
36
34
  import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
37
35
  import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility';
38
36
  import { IsWindowsContext } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkeys';
39
37
  import { FocusedViewContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
38
+ import { viewFilterSubmenu } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewFilter';
39
+ import { ViewAction } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane';
40
+ import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
41
+ import { IFileDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
42
+ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
40
43
 
44
+ const IMPORTED_LOG_ID_PREFIX = 'importedLog.';
41
45
  ModesRegistry.registerLanguage({
42
46
  id: OUTPUT_MODE_ID,
43
47
  extensions: [],
@@ -48,10 +52,10 @@ ModesRegistry.registerLanguage({
48
52
  extensions: [],
49
53
  mimetypes: [LOG_MIME]
50
54
  });
51
- const outputViewIcon = registerIcon('output-view-icon', Codicon.output, ( localize(7862, 'View icon of the output view.')));
55
+ const outputViewIcon = registerIcon('output-view-icon', Codicon.output, ( localize(8008, 'View icon of the output view.')));
52
56
  const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
53
57
  id: OUTPUT_VIEW_ID,
54
- title: ( localize2(7863, "Output")),
58
+ title: ( localize2(8009, "Output")),
55
59
  icon: outputViewIcon,
56
60
  order: 1,
57
61
  ctorDescriptor: ( new SyncDescriptor(
@@ -63,14 +67,14 @@ const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registe
63
67
  }, ViewContainerLocation.Panel, { doNotRegisterOpenCommand: true });
64
68
  ( Registry.as(Extensions.ViewsRegistry)).registerViews([{
65
69
  id: OUTPUT_VIEW_ID,
66
- name: ( localize2(7863, "Output")),
70
+ name: ( localize2(8009, "Output")),
67
71
  containerIcon: outputViewIcon,
68
72
  canMoveView: true,
69
- canToggleVisibility: false,
73
+ canToggleVisibility: true,
70
74
  ctorDescriptor: ( new SyncDescriptor(OutputViewPane)),
71
75
  openCommandActionDescriptor: {
72
76
  id: 'workbench.action.output.toggleOutput',
73
- mnemonicTitle: ( localize(7864, "&&Output")),
77
+ mnemonicTitle: ( localize(8010, "&&Output")),
74
78
  keybindings: {
75
79
  primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyU,
76
80
  linux: {
@@ -81,30 +85,36 @@ const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registe
81
85
  }
82
86
  }], VIEW_CONTAINER);
83
87
  let OutputContribution = class OutputContribution extends Disposable {
84
- constructor(outputService, editorService, fileConfigurationService) {
88
+ constructor(outputService, editorService) {
85
89
  super();
86
90
  this.outputService = outputService;
87
91
  this.editorService = editorService;
88
- this.fileConfigurationService = fileConfigurationService;
89
92
  this.registerActions();
90
93
  }
91
94
  registerActions() {
92
95
  this.registerSwitchOutputAction();
96
+ this.registerAddCompoundLogAction();
97
+ this.registerRemoveLogAction();
93
98
  this.registerShowOutputChannelsAction();
94
99
  this.registerClearOutputAction();
95
100
  this.registerToggleAutoScrollAction();
96
101
  this.registerOpenActiveOutputFileAction();
97
102
  this.registerOpenActiveOutputFileInAuxWindowAction();
103
+ this.registerSaveActiveOutputAsAction();
98
104
  this.registerShowLogsAction();
99
105
  this.registerOpenLogFileAction();
100
106
  this.registerConfigureActiveOutputLogLevelAction();
107
+ this.registerLogLevelFilterActions();
108
+ this.registerClearFilterActions();
109
+ this.registerExportLogsAction();
110
+ this.registerImportLogAction();
101
111
  }
102
112
  registerSwitchOutputAction() {
103
113
  this._register(registerAction2(class extends Action2 {
104
114
  constructor() {
105
115
  super({
106
116
  id: `workbench.output.action.switchBetweenOutputs`,
107
- title: ( localize(7865, "Switch Output")),
117
+ title: ( localize(8011, "Switch Output")),
108
118
  });
109
119
  }
110
120
  async run(accessor, channelId) {
@@ -116,7 +126,7 @@ let OutputContribution = class OutputContribution extends Disposable {
116
126
  const switchOutputMenu = ( new MenuId('workbench.output.menu.switchOutput'));
117
127
  this._register(MenuRegistry.appendMenuItem(MenuId.ViewTitle, {
118
128
  submenu: switchOutputMenu,
119
- title: ( localize(7866, "Switch Output")),
129
+ title: ( localize(8012, "Switch Output")),
120
130
  group: 'navigation',
121
131
  when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
122
132
  order: 1,
@@ -127,7 +137,7 @@ let OutputContribution = class OutputContribution extends Disposable {
127
137
  const registerOutputChannels = (channels) => {
128
138
  for (const channel of channels) {
129
139
  const title = channel.label;
130
- const group = channel.extensionId ? '0_ext_outputchannels' : '1_core_outputchannels';
140
+ const group = channel.user ? '2_user_outputchannels' : channel.extensionId ? '0_ext_outputchannels' : '1_core_outputchannels';
131
141
  registeredChannels.set(channel.id, registerAction2(class extends Action2 {
132
142
  constructor() {
133
143
  super({
@@ -155,8 +165,84 @@ let OutputContribution = class OutputContribution extends Disposable {
155
165
  }
156
166
  }));
157
167
  this._register(outputChannelRegistry.onDidRemoveChannel(e => {
158
- registeredChannels.get(e)?.dispose();
159
- registeredChannels.delete(e);
168
+ registeredChannels.get(e.id)?.dispose();
169
+ registeredChannels.delete(e.id);
170
+ }));
171
+ }
172
+ registerAddCompoundLogAction() {
173
+ this._register(registerAction2(class extends Action2 {
174
+ constructor() {
175
+ super({
176
+ id: 'workbench.action.output.addCompoundLog',
177
+ title: ( localize2(8013, "Add Compound Log...")),
178
+ category: ( localize2(8009, "Output")),
179
+ f1: true,
180
+ menu: [{
181
+ id: MenuId.ViewTitle,
182
+ when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
183
+ group: '2_add',
184
+ }],
185
+ });
186
+ }
187
+ async run(accessor) {
188
+ const outputService = accessor.get(IOutputService);
189
+ const quickInputService = accessor.get(IQuickInputService);
190
+ const extensionLogs = [], logs = [];
191
+ for (const channel of outputService.getChannelDescriptors()) {
192
+ if (channel.log && !channel.user) {
193
+ if (channel.extensionId) {
194
+ extensionLogs.push(channel);
195
+ }
196
+ else {
197
+ logs.push(channel);
198
+ }
199
+ }
200
+ }
201
+ const entries = [];
202
+ for (const log of logs.sort((a, b) => a.label.localeCompare(b.label))) {
203
+ entries.push(log);
204
+ }
205
+ if (extensionLogs.length && logs.length) {
206
+ entries.push({ type: 'separator', label: ( localize(8014, "Extension Logs")) });
207
+ }
208
+ for (const log of extensionLogs.sort((a, b) => a.label.localeCompare(b.label))) {
209
+ entries.push(log);
210
+ }
211
+ const result = await quickInputService.pick(entries, { placeHolder: ( localize(8015, "Select Log")), canPickMany: true });
212
+ if (result?.length) {
213
+ outputService.showChannel(outputService.registerCompoundLogChannel(result));
214
+ }
215
+ }
216
+ }));
217
+ }
218
+ registerRemoveLogAction() {
219
+ this._register(registerAction2(class extends Action2 {
220
+ constructor() {
221
+ super({
222
+ id: 'workbench.action.output.remove',
223
+ title: ( localize2(8016, "Remove Output...")),
224
+ category: ( localize2(8009, "Output")),
225
+ f1: true
226
+ });
227
+ }
228
+ async run(accessor) {
229
+ const outputService = accessor.get(IOutputService);
230
+ const quickInputService = accessor.get(IQuickInputService);
231
+ const notificationService = accessor.get(INotificationService);
232
+ const entries = outputService.getChannelDescriptors().filter(channel => channel.user);
233
+ if (entries.length === 0) {
234
+ notificationService.info(( localize(8017, "No custom outputs to remove.")));
235
+ return;
236
+ }
237
+ const result = await quickInputService.pick(entries, { placeHolder: ( localize(8015, "Select Log")), canPickMany: true });
238
+ if (!result?.length) {
239
+ return;
240
+ }
241
+ const outputChannelRegistry = ( Registry.as(Extensions$1.OutputChannels));
242
+ for (const channel of result) {
243
+ outputChannelRegistry.removeChannel(channel.id);
244
+ }
245
+ }
160
246
  }));
161
247
  }
162
248
  registerShowOutputChannelsAction() {
@@ -164,8 +250,8 @@ let OutputContribution = class OutputContribution extends Disposable {
164
250
  constructor() {
165
251
  super({
166
252
  id: 'workbench.action.showOutputChannels',
167
- title: ( localize2(7867, "Show Output Channels...")),
168
- category: ( localize2(7863, "Output")),
253
+ title: ( localize2(8018, "Show Output Channels...")),
254
+ category: ( localize2(8009, "Output")),
169
255
  f1: true
170
256
  });
171
257
  }
@@ -191,7 +277,7 @@ let OutputContribution = class OutputContribution extends Disposable {
191
277
  for (const { id, label } of coreChannels) {
192
278
  entries.push({ id, label });
193
279
  }
194
- const entry = await quickInputService.pick(entries, { placeHolder: ( localize(7868, "Select Output Channel")) });
280
+ const entry = await quickInputService.pick(entries, { placeHolder: ( localize(8019, "Select Output Channel")) });
195
281
  if (entry) {
196
282
  return outputService.showChannel(entry.id);
197
283
  }
@@ -203,7 +289,7 @@ let OutputContribution = class OutputContribution extends Disposable {
203
289
  constructor() {
204
290
  super({
205
291
  id: `workbench.output.action.clearOutput`,
206
- title: ( localize2(7869, "Clear Output")),
292
+ title: ( localize2(8020, "Clear Output")),
207
293
  category: Categories.View,
208
294
  menu: [{
209
295
  id: MenuId.ViewTitle,
@@ -235,8 +321,8 @@ let OutputContribution = class OutputContribution extends Disposable {
235
321
  constructor() {
236
322
  super({
237
323
  id: `workbench.output.action.toggleAutoScroll`,
238
- title: ( localize2(7870, "Toggle Auto Scrolling")),
239
- tooltip: ( localize(7871, "Turn Auto Scrolling Off")),
324
+ title: ( localize2(8021, "Toggle Auto Scrolling")),
325
+ tooltip: ( localize(8022, "Turn Auto Scrolling Off")),
240
326
  menu: {
241
327
  id: MenuId.ViewTitle,
242
328
  when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)))),
@@ -247,7 +333,7 @@ let OutputContribution = class OutputContribution extends Disposable {
247
333
  toggled: {
248
334
  condition: CONTEXT_OUTPUT_SCROLL_LOCK,
249
335
  icon: Codicon.unlock,
250
- tooltip: ( localize(7872, "Turn Auto Scrolling On"))
336
+ tooltip: ( localize(8023, "Turn Auto Scrolling On"))
251
337
  }
252
338
  });
253
339
  }
@@ -263,7 +349,7 @@ let OutputContribution = class OutputContribution extends Disposable {
263
349
  constructor() {
264
350
  super({
265
351
  id: `workbench.action.openActiveLogOutputFile`,
266
- title: ( localize2(7873, "Open Output in Editor")),
352
+ title: ( localize2(8024, "Open Output in Editor")),
267
353
  menu: [{
268
354
  id: MenuId.ViewTitle,
269
355
  when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
@@ -272,11 +358,10 @@ let OutputContribution = class OutputContribution extends Disposable {
272
358
  isHiddenByDefault: true
273
359
  }],
274
360
  icon: Codicon.goToFile,
275
- precondition: CONTEXT_ACTIVE_FILE_OUTPUT
276
361
  });
277
362
  }
278
363
  async run() {
279
- that.openActiveOutoutFile();
364
+ that.openActiveOutput();
280
365
  }
281
366
  }));
282
367
  }
@@ -286,7 +371,7 @@ let OutputContribution = class OutputContribution extends Disposable {
286
371
  constructor() {
287
372
  super({
288
373
  id: `workbench.action.openActiveLogOutputFileInNewWindow`,
289
- title: ( localize2(7874, "Open Output in New Window")),
374
+ title: ( localize2(8025, "Open Output in New Window")),
290
375
  menu: [{
291
376
  id: MenuId.ViewTitle,
292
377
  when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
@@ -295,42 +380,55 @@ let OutputContribution = class OutputContribution extends Disposable {
295
380
  isHiddenByDefault: true
296
381
  }],
297
382
  icon: Codicon.emptyWindow,
298
- precondition: CONTEXT_ACTIVE_FILE_OUTPUT
299
383
  });
300
384
  }
301
385
  async run() {
302
- that.openActiveOutoutFile(AUX_WINDOW_GROUP);
386
+ that.openActiveOutput(AUX_WINDOW_GROUP);
303
387
  }
304
388
  }));
305
389
  }
306
- async openActiveOutoutFile(group) {
307
- const fileOutputChannelDescriptor = this.getFileOutputChannelDescriptor();
308
- if (fileOutputChannelDescriptor) {
309
- await this.fileConfigurationService.updateReadonly(fileOutputChannelDescriptor.file, true);
390
+ registerSaveActiveOutputAsAction() {
391
+ this._register(registerAction2(class extends Action2 {
392
+ constructor() {
393
+ super({
394
+ id: `workbench.action.saveActiveLogOutputAs`,
395
+ title: ( localize2(8026, "Save Output As...")),
396
+ menu: [{
397
+ id: MenuId.ViewTitle,
398
+ when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
399
+ group: '1_export',
400
+ order: 1
401
+ }],
402
+ });
403
+ }
404
+ async run(accessor) {
405
+ const outputService = accessor.get(IOutputService);
406
+ const channel = outputService.getActiveChannel();
407
+ if (channel) {
408
+ const descriptor = outputService.getChannelDescriptors().find(c => c.id === channel.id);
409
+ if (descriptor) {
410
+ await outputService.saveOutputAs(descriptor);
411
+ }
412
+ }
413
+ }
414
+ }));
415
+ }
416
+ async openActiveOutput(group) {
417
+ const channel = this.outputService.getActiveChannel();
418
+ if (channel) {
310
419
  await this.editorService.openEditor({
311
- resource: fileOutputChannelDescriptor.file,
420
+ resource: channel.uri,
312
421
  options: {
313
422
  pinned: true,
314
423
  },
315
424
  }, group);
316
425
  }
317
426
  }
318
- getFileOutputChannelDescriptor() {
319
- const channel = this.outputService.getActiveChannel();
320
- if (channel) {
321
- const descriptor = this.outputService.getChannelDescriptors().filter(c => c.id === channel.id)[0];
322
- if (descriptor?.file) {
323
- return descriptor;
324
- }
325
- }
326
- return null;
327
- }
328
427
  registerConfigureActiveOutputLogLevelAction() {
329
- const that = this;
330
428
  const logLevelMenu = ( new MenuId('workbench.output.menu.logLevel'));
331
429
  this._register(MenuRegistry.appendMenuItem(MenuId.ViewTitle, {
332
430
  submenu: logLevelMenu,
333
- title: ( localize(7875, "Set Log Level...")),
431
+ title: ( localize(8027, "Set Log Level...")),
334
432
  group: 'navigation',
335
433
  when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)), CONTEXT_ACTIVE_OUTPUT_LEVEL_SETTABLE)),
336
434
  icon: Codicon.gear,
@@ -352,11 +450,12 @@ let OutputContribution = class OutputContribution extends Disposable {
352
450
  });
353
451
  }
354
452
  async run(accessor) {
355
- const channel = that.outputService.getActiveChannel();
453
+ const outputService = accessor.get(IOutputService);
454
+ const channel = outputService.getActiveChannel();
356
455
  if (channel) {
357
- const channelDescriptor = that.outputService.getChannelDescriptor(channel.id);
358
- if (channelDescriptor?.log && channelDescriptor.file) {
359
- return accessor.get(ILoggerService).setLogLevel(channelDescriptor.file, logLevel);
456
+ const channelDescriptor = outputService.getChannelDescriptor(channel.id);
457
+ if (channelDescriptor) {
458
+ outputService.setLogLevel(channelDescriptor, logLevel);
360
459
  }
361
460
  }
362
461
  }
@@ -372,7 +471,7 @@ let OutputContribution = class OutputContribution extends Disposable {
372
471
  constructor() {
373
472
  super({
374
473
  id: `workbench.action.output.activeOutputLogLevelDefault`,
375
- title: ( localize(7876, "Set As Default")),
474
+ title: ( localize(8028, "Set As Default")),
376
475
  menu: {
377
476
  id: logLevelMenu,
378
477
  order,
@@ -382,12 +481,15 @@ let OutputContribution = class OutputContribution extends Disposable {
382
481
  });
383
482
  }
384
483
  async run(accessor) {
385
- const channel = that.outputService.getActiveChannel();
484
+ const outputService = accessor.get(IOutputService);
485
+ const loggerService = accessor.get(ILoggerService);
486
+ const defaultLogLevelsService = accessor.get(IDefaultLogLevelsService);
487
+ const channel = outputService.getActiveChannel();
386
488
  if (channel) {
387
- const channelDescriptor = that.outputService.getChannelDescriptor(channel.id);
388
- if (channelDescriptor?.log && channelDescriptor.file) {
389
- const logLevel = accessor.get(ILoggerService).getLogLevel(channelDescriptor.file);
390
- return await accessor.get(IDefaultLogLevelsService).setDefaultLogLevel(logLevel, channelDescriptor.extensionId);
489
+ const channelDescriptor = outputService.getChannelDescriptor(channel.id);
490
+ if (channelDescriptor && isSingleSourceOutputChannelDescriptor(channelDescriptor)) {
491
+ const logLevel = loggerService.getLogLevel(channelDescriptor.source.resource);
492
+ return await defaultLogLevelsService.setDefaultLogLevel(logLevel, channelDescriptor.extensionId);
391
493
  }
392
494
  }
393
495
  }
@@ -398,7 +500,7 @@ let OutputContribution = class OutputContribution extends Disposable {
398
500
  constructor() {
399
501
  super({
400
502
  id: 'workbench.action.showLogs',
401
- title: ( localize2(7877, "Show Logs...")),
503
+ title: ( localize2(8029, "Show Logs...")),
402
504
  category: Categories.Developer,
403
505
  menu: {
404
506
  id: MenuId.CommandPalette,
@@ -424,12 +526,12 @@ let OutputContribution = class OutputContribution extends Disposable {
424
526
  entries.push({ id, label });
425
527
  }
426
528
  if (extensionLogs.length && logs.length) {
427
- entries.push({ type: 'separator', label: ( localize(7878, "Extension Logs")) });
529
+ entries.push({ type: 'separator', label: ( localize(8014, "Extension Logs")) });
428
530
  }
429
531
  for (const { id, label } of extensionLogs) {
430
532
  entries.push({ id, label });
431
533
  }
432
- const entry = await quickInputService.pick(entries, { placeHolder: ( localize(7879, "Select Log")) });
534
+ const entry = await quickInputService.pick(entries, { placeHolder: ( localize(8015, "Select Log")) });
433
535
  if (entry) {
434
536
  return outputService.showChannel(entry.id);
435
537
  }
@@ -441,7 +543,7 @@ let OutputContribution = class OutputContribution extends Disposable {
441
543
  constructor() {
442
544
  super({
443
545
  id: 'workbench.action.openLogFile',
444
- title: ( localize2(7880, "Open Log File...")),
546
+ title: ( localize2(8030, "Open Log...")),
445
547
  category: Categories.Developer,
446
548
  menu: {
447
549
  id: MenuId.CommandPalette,
@@ -452,7 +554,7 @@ let OutputContribution = class OutputContribution extends Disposable {
452
554
  name: 'logFile',
453
555
  schema: {
454
556
  markdownDescription: ( localize(
455
- 7881,
557
+ 8031,
456
558
  "The id of the log file to open, for example `\"window\"`. Currently the best way to get this is to get the ID by checking the `workbench.action.output.show.<id>` commands"
457
559
  )),
458
560
  type: 'string'
@@ -465,14 +567,13 @@ let OutputContribution = class OutputContribution extends Disposable {
465
567
  const outputService = accessor.get(IOutputService);
466
568
  const quickInputService = accessor.get(IQuickInputService);
467
569
  const editorService = accessor.get(IEditorService);
468
- const fileConfigurationService = accessor.get(IFilesConfigurationService);
469
570
  let entry;
470
571
  const argName = args && typeof args === 'string' ? args : undefined;
471
572
  const extensionChannels = [];
472
573
  const coreChannels = [];
473
574
  for (const c of outputService.getChannelDescriptors()) {
474
- if (c.file && c.log) {
475
- const e = { id: c.id, label: c.label, channel: c };
575
+ if (c.log) {
576
+ const e = { id: c.id, label: c.label };
476
577
  if (c.extensionId) {
477
578
  extensionChannels.push(e);
478
579
  }
@@ -490,17 +591,194 @@ let OutputContribution = class OutputContribution extends Disposable {
490
591
  entries.push({ type: 'separator' });
491
592
  entries.push(...coreChannels.sort((a, b) => a.label.localeCompare(b.label)));
492
593
  }
493
- entry = await quickInputService.pick(entries, { placeHolder: ( localize(7882, "Select Log File")) });
594
+ entry = await quickInputService.pick(entries, { placeHolder: ( localize(8032, "Select Log File")) });
494
595
  }
495
- if (entry) {
496
- const resource = assertIsDefined(entry.channel.file);
497
- await fileConfigurationService.updateReadonly(resource, true);
498
- await editorService.openEditor({
499
- resource,
500
- options: {
501
- pinned: true,
596
+ if (entry?.id) {
597
+ const channel = outputService.getChannel(entry.id);
598
+ if (channel) {
599
+ await editorService.openEditor({
600
+ resource: channel.uri,
601
+ options: {
602
+ pinned: true,
603
+ }
604
+ });
605
+ }
606
+ }
607
+ }
608
+ }));
609
+ }
610
+ registerLogLevelFilterActions() {
611
+ let order = 0;
612
+ const registerLogLevel = (logLevel, toggled) => {
613
+ this._register(registerAction2(class extends ViewAction {
614
+ constructor() {
615
+ super({
616
+ id: `workbench.actions.${OUTPUT_VIEW_ID}.toggle.${LogLevelToString(logLevel)}`,
617
+ title: LogLevelToLocalizedString(logLevel).value,
618
+ metadata: {
619
+ description: ( localize2(
620
+ 8033,
621
+ "Show or hide {0} messages in the output",
622
+ LogLevelToString(logLevel)
623
+ ))
624
+ },
625
+ toggled,
626
+ menu: {
627
+ id: viewFilterSubmenu,
628
+ group: '2_log_filter',
629
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)), CONTEXT_ACTIVE_LOG_FILE_OUTPUT)),
630
+ order: order++
631
+ },
632
+ viewId: OUTPUT_VIEW_ID
633
+ });
634
+ }
635
+ async runInView(serviceAccessor, view) {
636
+ this.toggleLogLevelFilter(serviceAccessor.get(IOutputService), logLevel);
637
+ }
638
+ toggleLogLevelFilter(outputService, logLevel) {
639
+ switch (logLevel) {
640
+ case LogLevel.Trace:
641
+ outputService.filters.trace = !outputService.filters.trace;
642
+ break;
643
+ case LogLevel.Debug:
644
+ outputService.filters.debug = !outputService.filters.debug;
645
+ break;
646
+ case LogLevel.Info:
647
+ outputService.filters.info = !outputService.filters.info;
648
+ break;
649
+ case LogLevel.Warning:
650
+ outputService.filters.warning = !outputService.filters.warning;
651
+ break;
652
+ case LogLevel.Error:
653
+ outputService.filters.error = !outputService.filters.error;
654
+ break;
655
+ }
656
+ }
657
+ }));
658
+ };
659
+ registerLogLevel(LogLevel.Trace, SHOW_TRACE_FILTER_CONTEXT);
660
+ registerLogLevel(LogLevel.Debug, SHOW_DEBUG_FILTER_CONTEXT);
661
+ registerLogLevel(LogLevel.Info, SHOW_INFO_FILTER_CONTEXT);
662
+ registerLogLevel(LogLevel.Warning, SHOW_WARNING_FILTER_CONTEXT);
663
+ registerLogLevel(LogLevel.Error, SHOW_ERROR_FILTER_CONTEXT);
664
+ }
665
+ registerClearFilterActions() {
666
+ this._register(registerAction2(class extends ViewAction {
667
+ constructor() {
668
+ super({
669
+ id: `workbench.actions.${OUTPUT_VIEW_ID}.clearFilterText`,
670
+ title: ( localize(8034, "Clear filters text")),
671
+ keybinding: {
672
+ when: OUTPUT_FILTER_FOCUS_CONTEXT,
673
+ weight: KeybindingWeight.WorkbenchContrib,
674
+ primary: KeyCode.Escape
675
+ },
676
+ viewId: OUTPUT_VIEW_ID
677
+ });
678
+ }
679
+ async runInView(serviceAccessor, outputView) {
680
+ outputView.clearFilterText();
681
+ }
682
+ }));
683
+ }
684
+ registerExportLogsAction() {
685
+ this._register(registerAction2(class extends Action2 {
686
+ constructor() {
687
+ super({
688
+ id: `workbench.action.exportLogs`,
689
+ title: ( localize2(8035, "Export Logs...")),
690
+ f1: true,
691
+ category: Categories.Developer,
692
+ menu: [{
693
+ id: MenuId.ViewTitle,
694
+ when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
695
+ group: '1_export',
696
+ order: 2,
697
+ }],
698
+ });
699
+ }
700
+ async run(accessor) {
701
+ const outputService = accessor.get(IOutputService);
702
+ const quickInputService = accessor.get(IQuickInputService);
703
+ const extensionLogs = [], logs = [], userLogs = [];
704
+ for (const channel of outputService.getChannelDescriptors()) {
705
+ if (channel.log) {
706
+ if (channel.extensionId) {
707
+ extensionLogs.push(channel);
708
+ }
709
+ else if (channel.user) {
710
+ userLogs.push(channel);
502
711
  }
712
+ else {
713
+ logs.push(channel);
714
+ }
715
+ }
716
+ }
717
+ const entries = [];
718
+ for (const log of logs.sort((a, b) => a.label.localeCompare(b.label))) {
719
+ entries.push(log);
720
+ }
721
+ if (extensionLogs.length && logs.length) {
722
+ entries.push({ type: 'separator', label: ( localize(8014, "Extension Logs")) });
723
+ }
724
+ for (const log of extensionLogs.sort((a, b) => a.label.localeCompare(b.label))) {
725
+ entries.push(log);
726
+ }
727
+ if (userLogs.length && (extensionLogs.length || logs.length)) {
728
+ entries.push({ type: 'separator', label: ( localize(8036, "User Logs")) });
729
+ }
730
+ for (const log of userLogs.sort((a, b) => a.label.localeCompare(b.label))) {
731
+ entries.push(log);
732
+ }
733
+ const result = await quickInputService.pick(entries, { placeHolder: ( localize(8015, "Select Log")), canPickMany: true });
734
+ if (result?.length) {
735
+ await outputService.saveOutputAs(...result);
736
+ }
737
+ }
738
+ }));
739
+ }
740
+ registerImportLogAction() {
741
+ this._register(registerAction2(class extends Action2 {
742
+ constructor() {
743
+ super({
744
+ id: `workbench.action.importLog`,
745
+ title: ( localize2(8037, "Import Log...")),
746
+ f1: true,
747
+ category: Categories.Developer,
748
+ menu: [{
749
+ id: MenuId.ViewTitle,
750
+ when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
751
+ group: '2_add',
752
+ order: 2,
753
+ }],
754
+ });
755
+ }
756
+ async run(accessor) {
757
+ const outputService = accessor.get(IOutputService);
758
+ const fileDialogService = accessor.get(IFileDialogService);
759
+ const result = await fileDialogService.showOpenDialog({
760
+ title: ( localize(8038, "Import Log File")),
761
+ canSelectFiles: true,
762
+ canSelectFolders: false,
763
+ canSelectMany: true,
764
+ filters: [{
765
+ name: ( localize(8039, "Log Files")),
766
+ extensions: ['log']
767
+ }]
768
+ });
769
+ if (result?.length) {
770
+ const channelName = basename(result[0]);
771
+ const channelId = `${IMPORTED_LOG_ID_PREFIX}${Date.now()}`;
772
+ ( Registry.as(Extensions$1.OutputChannels)).registerChannel({
773
+ id: channelId,
774
+ label: channelName,
775
+ log: true,
776
+ user: true,
777
+ source: result.length === 1
778
+ ? { resource: result[0] }
779
+ : ( result.map(resource => ({ resource, name: basename(resource).split('.')[0] })))
503
780
  });
781
+ outputService.showChannel(channelId);
504
782
  }
505
783
  }
506
784
  }));
@@ -508,20 +786,19 @@ let OutputContribution = class OutputContribution extends Disposable {
508
786
  };
509
787
  OutputContribution = ( __decorate([
510
788
  ( __param(0, IOutputService)),
511
- ( __param(1, IEditorService)),
512
- ( __param(2, IFilesConfigurationService))
789
+ ( __param(1, IEditorService))
513
790
  ], OutputContribution));
514
791
  ( Registry.as(Extensions$2.Workbench)).registerWorkbenchContribution(OutputContribution, LifecyclePhase.Restored);
515
792
  ( Registry.as(Extensions$3.Configuration)).registerConfiguration({
516
793
  id: 'output',
517
794
  order: 30,
518
- title: ( localize(7863, "Output")),
795
+ title: ( localize(8009, "Output")),
519
796
  type: 'object',
520
797
  properties: {
521
798
  'output.smartScroll.enabled': {
522
799
  type: 'boolean',
523
800
  description: ( localize(
524
- 7883,
801
+ 8040,
525
802
  "Enable/disable the ability of smart scrolling in the output view. Smart scrolling allows you to lock scrolling automatically when you click in the output view and unlocks when you click in the last line."
526
803
  )),
527
804
  default: true,