@codingame/monaco-vscode-output-service-override 13.1.7 → 14.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.
@@ -3,37 +3,71 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
3
3
  import './output.css.js';
4
4
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
5
5
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
6
+ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
6
7
  import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
7
8
  import { ITextResourceConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration';
8
9
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
10
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
9
11
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
10
12
  import { AbstractTextResourceEditor } from '@codingame/monaco-vscode-523730aa-81e6-55d7-9916-87ad537fe087-common/vscode/vs/workbench/browser/parts/editor/textResourceEditor';
11
- import { CONTEXT_OUTPUT_SCROLL_LOCK, OUTPUT_VIEW_ID, CONTEXT_IN_OUTPUT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output';
13
+ import { OUTPUT_FILTER_FOCUS_CONTEXT, CONTEXT_OUTPUT_SCROLL_LOCK, OUTPUT_VIEW_ID, CONTEXT_IN_OUTPUT, HIDE_CATEGORY_FILTER_CONTEXT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output';
14
+ import { IOutputService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output.service';
12
15
  import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
13
16
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
14
17
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
15
18
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
16
19
  import { CursorChangeReason } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/cursorEvents';
17
- import { ViewPane } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane';
20
+ import { FilterViewPane } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane';
18
21
  import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
19
22
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
20
23
  import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
21
- import { TextResourceEditorInput } from '@codingame/monaco-vscode-0139c6af-2375-559c-af57-b738f2fd6d8e-common/vscode/vs/workbench/common/editor/textResourceEditorInput';
24
+ import { TextResourceEditorInput } from '@codingame/monaco-vscode-ce8c4b18-4e75-55dd-9656-517347af9de7-common/vscode/vs/workbench/common/editor/textResourceEditorInput';
22
25
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
23
26
  import { Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
24
27
  import { createCancelablePromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
25
28
  import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
26
29
  import { ResourceContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
27
30
  import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
28
- import { computeEditorAriaLabel } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/editor';
31
+ import { computeEditorAriaLabel } from '@codingame/monaco-vscode-d0fb86d3-2a47-594e-955b-9a24631a7124-common/vscode/vs/workbench/browser/editor';
29
32
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
33
+ import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
34
+ import { LogLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log';
35
+ import { EditorExtensionsRegistry, EditorContributionInstantiation } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
36
+ import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
37
+ import { FindDecorations } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/find/browser/findDecorations';
38
+ import { Memento } from '@codingame/monaco-vscode-91789cdf-e3cb-5a04-aaeb-6f7df7d3d231-common/vscode/vs/workbench/common/memento';
39
+ import { Markers } from '@codingame/monaco-vscode-ab07af84-42e8-5a0f-8aef-b83fb90ede21-common/vscode/vs/workbench/contrib/markers/common/markers';
40
+ import { registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
41
+ import { viewFilterSubmenu } from '@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewFilter';
42
+ import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
30
43
 
31
- let OutputViewPane = class OutputViewPane extends ViewPane {
44
+ let OutputViewPane = class OutputViewPane extends FilterViewPane {
32
45
  get scrollLock() { return !!this.scrollLockContextKey.get(); }
33
46
  set scrollLock(scrollLock) { this.scrollLockContextKey.set(scrollLock); }
34
- constructor(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService) {
35
- super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
47
+ constructor(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService, outputService, storageService) {
48
+ const memento = ( new Memento(Markers.MARKERS_VIEW_STORAGE_ID, storageService));
49
+ const viewState = memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
50
+ super({
51
+ ...options,
52
+ filterOptions: {
53
+ placeholder: ( localize(8042, "Filter")),
54
+ focusContextKey: OUTPUT_FILTER_FOCUS_CONTEXT.key,
55
+ text: viewState['filter'] || '',
56
+ history: []
57
+ }
58
+ }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
59
+ this.outputService = outputService;
36
60
  this.editorPromise = null;
61
+ this.memento = memento;
62
+ this.panelState = viewState;
63
+ const filters = outputService.filters;
64
+ filters.text = this.panelState['filter'] || '';
65
+ filters.trace = this.panelState['showTrace'] ?? true;
66
+ filters.debug = this.panelState['showDebug'] ?? true;
67
+ filters.info = this.panelState['showInfo'] ?? true;
68
+ filters.warning = this.panelState['showWarning'] ?? true;
69
+ filters.error = this.panelState['showError'] ?? true;
70
+ filters.categories = this.panelState['categories'] ?? '';
37
71
  this.scrollLockContextKey = CONTEXT_OUTPUT_SCROLL_LOCK.bindTo(this.contextKeyService);
38
72
  const editorInstantiationService = this._register(instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.scopedContextKeyService]))));
39
73
  this.editor = this._register(editorInstantiationService.createInstance(OutputEditor));
@@ -42,6 +76,9 @@ let OutputViewPane = class OutputViewPane extends ViewPane {
42
76
  this.updateActions();
43
77
  }));
44
78
  this._register(this.onDidChangeBodyVisibility(() => this.onDidChangeVisibility(this.isBodyVisible())));
79
+ this._register(this.filterWidget.onDidChangeFilterText(text => outputService.filters.text = text));
80
+ this.checkMoreFilters();
81
+ this._register(outputService.filters.onDidChange(() => this.checkMoreFilters()));
45
82
  }
46
83
  showChannel(channel, preserveFocus) {
47
84
  if (this.channelId !== channel.id) {
@@ -55,6 +92,9 @@ let OutputViewPane = class OutputViewPane extends ViewPane {
55
92
  super.focus();
56
93
  this.editorPromise?.then(() => this.editor.focus());
57
94
  }
95
+ clearFilterText() {
96
+ this.filterWidget.setFilterText('');
97
+ }
58
98
  renderBody(container) {
59
99
  super.renderBody(container);
60
100
  this.editor.create(container);
@@ -81,8 +121,7 @@ let OutputViewPane = class OutputViewPane extends ViewPane {
81
121
  }
82
122
  }));
83
123
  }
84
- layoutBody(height, width) {
85
- super.layoutBody(height, width);
124
+ layoutBodyContent(height, width) {
86
125
  this.editor.layout(( new Dimension(width, height)));
87
126
  }
88
127
  onDidChangeVisibility(visible) {
@@ -93,6 +132,7 @@ let OutputViewPane = class OutputViewPane extends ViewPane {
93
132
  }
94
133
  setInput(channel) {
95
134
  this.channelId = channel.id;
135
+ this.checkMoreFilters();
96
136
  const input = this.createInput(channel);
97
137
  if (!this.editor.input || !input.matches(this.editor.input)) {
98
138
  this.editorPromise?.cancel();
@@ -100,13 +140,29 @@ let OutputViewPane = class OutputViewPane extends ViewPane {
100
140
  .then(() => this.editor));
101
141
  }
102
142
  }
143
+ checkMoreFilters() {
144
+ const filters = this.outputService.filters;
145
+ this.filterWidget.checkMoreFilters(!filters.trace || !filters.debug || !filters.info || !filters.warning || !filters.error || (!!this.channelId && filters.categories.includes(`,${this.channelId}:`)));
146
+ }
103
147
  clearInput() {
104
148
  this.channelId = undefined;
105
149
  this.editor.clearInput();
106
150
  this.editorPromise = null;
107
151
  }
108
152
  createInput(channel) {
109
- return this.instantiationService.createInstance(TextResourceEditorInput, channel.uri, ( localize(7884, "{0} - Output", channel.label)), ( localize(7885, "Output channel for '{0}'", channel.label)), undefined, undefined);
153
+ return this.instantiationService.createInstance(TextResourceEditorInput, channel.uri, ( localize(8043, "{0} - Output", channel.label)), ( localize(8044, "Output channel for '{0}'", channel.label)), undefined, undefined);
154
+ }
155
+ saveState() {
156
+ const filters = this.outputService.filters;
157
+ this.panelState['filter'] = filters.text;
158
+ this.panelState['showTrace'] = filters.trace;
159
+ this.panelState['showDebug'] = filters.debug;
160
+ this.panelState['showInfo'] = filters.info;
161
+ this.panelState['showWarning'] = filters.warning;
162
+ this.panelState['showError'] = filters.error;
163
+ this.panelState['categories'] = filters.categories;
164
+ this.memento.saveMemento();
165
+ super.saveState();
110
166
  }
111
167
  };
112
168
  OutputViewPane = ( __decorate([
@@ -119,7 +175,9 @@ OutputViewPane = ( __decorate([
119
175
  ( __param(7, IOpenerService)),
120
176
  ( __param(8, IThemeService)),
121
177
  ( __param(9, ITelemetryService)),
122
- ( __param(10, IHoverService))
178
+ ( __param(10, IHoverService)),
179
+ ( __param(11, IOutputService)),
180
+ ( __param(12, IStorageService))
123
181
  ], OutputViewPane));
124
182
  let OutputEditor = class OutputEditor extends AbstractTextResourceEditor {
125
183
  constructor(telemetryService, instantiationService, storageService, configurationService, textResourceConfigurationService, themeService, editorGroupService, editorService, fileService) {
@@ -131,7 +189,7 @@ let OutputEditor = class OutputEditor extends AbstractTextResourceEditor {
131
189
  return OUTPUT_VIEW_ID;
132
190
  }
133
191
  getTitle() {
134
- return localize(7886, "Output");
192
+ return localize(8045, "Output");
135
193
  }
136
194
  getConfigurationOverrides(configuration) {
137
195
  const options = super.getConfigurationOverrides(configuration);
@@ -165,7 +223,7 @@ let OutputEditor = class OutputEditor extends AbstractTextResourceEditor {
165
223
  return options;
166
224
  }
167
225
  getAriaLabel() {
168
- return this.input ? this.input.getAriaLabel() : ( localize(7887, "Output panel"));
226
+ return this.input ? this.input.getAriaLabel() : ( localize(8046, "Output panel"));
169
227
  }
170
228
  computeAriaLabel() {
171
229
  return this.input ? computeEditorAriaLabel(this.input, undefined, undefined, this.editorGroupService.count) : this.getAriaLabel();
@@ -200,6 +258,19 @@ let OutputEditor = class OutputEditor extends AbstractTextResourceEditor {
200
258
  CONTEXT_IN_OUTPUT.bindTo(scopedContextKeyService).set(true);
201
259
  }
202
260
  }
261
+ _getContributions() {
262
+ return [
263
+ ...EditorExtensionsRegistry.getEditorContributions(),
264
+ {
265
+ id: FilterController.ID,
266
+ ctor: FilterController,
267
+ instantiation: EditorContributionInstantiation.Eager
268
+ }
269
+ ];
270
+ }
271
+ getCodeEditorWidgetOptions() {
272
+ return { contributions: this._getContributions() };
273
+ }
203
274
  };
204
275
  OutputEditor = ( __decorate([
205
276
  ( __param(0, ITelemetryService)),
@@ -212,5 +283,164 @@ OutputEditor = ( __decorate([
212
283
  ( __param(7, IEditorService)),
213
284
  ( __param(8, IFileService))
214
285
  ], OutputEditor));
286
+ let FilterController = class FilterController extends Disposable {
287
+ static { this.ID = 'output.editor.contrib.filterController'; }
288
+ constructor(editor, outputService) {
289
+ super();
290
+ this.editor = editor;
291
+ this.outputService = outputService;
292
+ this.modelDisposables = this._register(( new DisposableStore()));
293
+ this.hiddenAreas = [];
294
+ this.categories = ( new Map());
295
+ this.decorationsCollection = editor.createDecorationsCollection();
296
+ this._register(editor.onDidChangeModel(() => this.onDidChangeModel()));
297
+ this._register(this.outputService.filters.onDidChange(() => editor.hasModel() && this.filter(editor.getModel())));
298
+ }
299
+ onDidChangeModel() {
300
+ this.modelDisposables.clear();
301
+ this.hiddenAreas = [];
302
+ this.categories.clear();
303
+ if (!this.editor.hasModel()) {
304
+ return;
305
+ }
306
+ const model = this.editor.getModel();
307
+ this.filter(model);
308
+ const computeEndLineNumber = () => {
309
+ const endLineNumber = model.getLineCount();
310
+ return endLineNumber > 1 && model.getLineMaxColumn(endLineNumber) === 1 ? endLineNumber - 1 : endLineNumber;
311
+ };
312
+ let endLineNumber = computeEndLineNumber();
313
+ this.modelDisposables.add(model.onDidChangeContent(e => {
314
+ if (e.changes.every(e => e.range.startLineNumber > endLineNumber)) {
315
+ this.filterIncremental(model, endLineNumber + 1);
316
+ }
317
+ else {
318
+ this.filter(model);
319
+ }
320
+ endLineNumber = computeEndLineNumber();
321
+ }));
322
+ }
323
+ filter(model) {
324
+ this.hiddenAreas = [];
325
+ this.decorationsCollection.clear();
326
+ this.filterIncremental(model, 1);
327
+ }
328
+ filterIncremental(model, fromLineNumber) {
329
+ const { findMatches, hiddenAreas, categories: sources } = this.compute(model, fromLineNumber);
330
+ this.hiddenAreas.push(...hiddenAreas);
331
+ this.editor.setHiddenAreas(this.hiddenAreas, this);
332
+ if (findMatches.length) {
333
+ this.decorationsCollection.append(findMatches);
334
+ }
335
+ if (sources.size) {
336
+ const that = this;
337
+ for (const [categoryFilter, categoryName] of sources) {
338
+ if (( this.categories.has(categoryFilter))) {
339
+ continue;
340
+ }
341
+ this.categories.set(categoryFilter, categoryName);
342
+ this.modelDisposables.add(registerAction2(class extends Action2 {
343
+ constructor() {
344
+ super({
345
+ id: `workbench.actions.${OUTPUT_VIEW_ID}.toggle.${categoryFilter}`,
346
+ title: categoryName,
347
+ toggled: ( ( ContextKeyExpr.regex(HIDE_CATEGORY_FILTER_CONTEXT.key, ( new RegExp(`.*,${escapeRegExpCharacters(categoryFilter)},.*`)))).negate()),
348
+ menu: {
349
+ id: viewFilterSubmenu,
350
+ group: '1_category_filter',
351
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)))),
352
+ }
353
+ });
354
+ }
355
+ async run() {
356
+ that.outputService.filters.toggleCategory(categoryFilter);
357
+ }
358
+ }));
359
+ }
360
+ }
361
+ }
362
+ compute(model, fromLineNumber) {
363
+ const filters = this.outputService.filters;
364
+ const activeChannel = this.outputService.getActiveChannel();
365
+ const findMatches = [];
366
+ const hiddenAreas = [];
367
+ const categories = ( new Map());
368
+ const logEntries = activeChannel?.getLogEntries();
369
+ if (activeChannel && logEntries?.length) {
370
+ const hasLogLevelFilter = !filters.trace || !filters.debug || !filters.info || !filters.warning || !filters.error;
371
+ const fromLogLevelEntryIndex = logEntries.findIndex(entry => fromLineNumber >= entry.range.startLineNumber && fromLineNumber <= entry.range.endLineNumber);
372
+ if (fromLogLevelEntryIndex === -1) {
373
+ return { findMatches, hiddenAreas, categories };
374
+ }
375
+ for (let i = fromLogLevelEntryIndex; i < logEntries.length; i++) {
376
+ const entry = logEntries[i];
377
+ if (entry.category) {
378
+ categories.set(`${activeChannel.id}:${entry.category}`, entry.category);
379
+ }
380
+ if (hasLogLevelFilter && !this.shouldShowLogLevel(entry, filters)) {
381
+ hiddenAreas.push(entry.range);
382
+ continue;
383
+ }
384
+ if (!this.shouldShowCategory(activeChannel.id, entry, filters)) {
385
+ hiddenAreas.push(entry.range);
386
+ continue;
387
+ }
388
+ if (filters.text) {
389
+ const matches = model.findMatches(filters.text, entry.range, false, false, null, false);
390
+ if (matches.length) {
391
+ for (const match of matches) {
392
+ findMatches.push({ range: match.range, options: FindDecorations._FIND_MATCH_DECORATION });
393
+ }
394
+ }
395
+ else {
396
+ hiddenAreas.push(entry.range);
397
+ }
398
+ }
399
+ }
400
+ return { findMatches, hiddenAreas, categories };
401
+ }
402
+ if (!filters.text) {
403
+ return { findMatches, hiddenAreas, categories };
404
+ }
405
+ const lineCount = model.getLineCount();
406
+ for (let lineNumber = fromLineNumber; lineNumber <= lineCount; lineNumber++) {
407
+ const lineRange = ( new Range(lineNumber, 1, lineNumber, model.getLineMaxColumn(lineNumber)));
408
+ const matches = model.findMatches(filters.text, lineRange, false, false, null, false);
409
+ if (matches.length) {
410
+ for (const match of matches) {
411
+ findMatches.push({ range: match.range, options: FindDecorations._FIND_MATCH_DECORATION });
412
+ }
413
+ }
414
+ else {
415
+ hiddenAreas.push(lineRange);
416
+ }
417
+ }
418
+ return { findMatches, hiddenAreas, categories };
419
+ }
420
+ shouldShowLogLevel(entry, filters) {
421
+ switch (entry.logLevel) {
422
+ case LogLevel.Trace:
423
+ return filters.trace;
424
+ case LogLevel.Debug:
425
+ return filters.debug;
426
+ case LogLevel.Info:
427
+ return filters.info;
428
+ case LogLevel.Warning:
429
+ return filters.warning;
430
+ case LogLevel.Error:
431
+ return filters.error;
432
+ }
433
+ return true;
434
+ }
435
+ shouldShowCategory(activeChannelId, entry, filters) {
436
+ if (!entry.category) {
437
+ return true;
438
+ }
439
+ return !filters.hasCategory(`${activeChannelId}:${entry.category}`);
440
+ }
441
+ };
442
+ FilterController = ( __decorate([
443
+ ( __param(1, IOutputService))
444
+ ], FilterController));
215
445
 
216
- export { OutputViewPane };
446
+ export { FilterController, OutputEditor, OutputViewPane };
@@ -8,52 +8,81 @@ import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/com
8
8
  import { ILanguageSelection } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language";
9
9
  import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
10
10
  import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
11
- import { OutputChannelUpdateMode } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output";
11
+ import { ILogEntry, IOutputContentSource, OutputChannelUpdateMode } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output";
12
+ export declare function parseLogEntryAt(model: ITextModel, lineNumber: number): ILogEntry | null;
12
13
  export interface IOutputChannelModel extends IDisposable {
13
14
  readonly onDispose: Event<void>;
15
+ readonly source: IOutputContentSource | ReadonlyArray<IOutputContentSource>;
16
+ getLogEntries(): ReadonlyArray<ILogEntry>;
14
17
  append(output: string): void;
15
18
  update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void;
19
+ updateChannelSources(sources: ReadonlyArray<IOutputContentSource>): void;
16
20
  loadModel(): Promise<ITextModel>;
17
21
  clear(): void;
18
22
  replace(value: string): void;
19
23
  }
20
- export declare class FileOutputChannelModel extends Disposable implements IOutputChannelModel {
24
+ interface IContentProvider {
25
+ readonly onDidAppend: Event<void>;
26
+ readonly onDidReset: Event<void>;
27
+ reset(): void;
28
+ watch(): void;
29
+ unwatch(): void;
30
+ getContent(): Promise<{
31
+ readonly content: string;
32
+ readonly consume: () => void;
33
+ }>;
34
+ getLogEntries(): ReadonlyArray<ILogEntry>;
35
+ }
36
+ export declare abstract class AbstractFileOutputChannelModel extends Disposable implements IOutputChannelModel {
21
37
  private readonly modelUri;
22
38
  private readonly language;
23
- private readonly file;
24
- private readonly fileService;
25
- private readonly modelService;
39
+ private readonly outputContentProvider;
40
+ protected readonly modelService: IModelService;
26
41
  private readonly editorWorkerService;
27
42
  private readonly _onDispose;
28
43
  readonly onDispose: Event<void>;
29
- private readonly fileHandler;
30
- private etag;
31
- private loadModelPromise;
32
- private model;
44
+ protected loadModelPromise: Promise<ITextModel> | null;
45
+ private readonly modelDisposable;
46
+ protected model: ITextModel | null;
33
47
  private modelUpdateInProgress;
34
48
  private readonly modelUpdateCancellationSource;
35
49
  private readonly appendThrottler;
36
50
  private replacePromise;
37
- private startOffset;
38
- private endOffset;
39
- constructor(modelUri: URI, language: ILanguageSelection, file: URI, fileService: IFileService, modelService: IModelService, logService: ILogService, editorWorkerService: IEditorWorkerService);
40
- append(message: string): void;
41
- replace(message: string): void;
42
- clear(): void;
43
- update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void;
51
+ abstract readonly source: IOutputContentSource | ReadonlyArray<IOutputContentSource>;
52
+ constructor(modelUri: URI, language: ILanguageSelection, outputContentProvider: IContentProvider, modelService: IModelService, editorWorkerService: IEditorWorkerService);
44
53
  loadModel(): Promise<ITextModel>;
45
- private createModel;
46
- private doUpdate;
54
+ getLogEntries(): readonly ILogEntry[];
55
+ private onDidContentChange;
56
+ protected doUpdate(mode: OutputChannelUpdateMode, immediate: boolean): void;
47
57
  private clearContent;
48
58
  private appendContent;
59
+ private doAppendContent;
49
60
  private replaceContent;
50
61
  private getReplaceEdits;
51
- private doUpdateModel;
52
62
  protected cancelModelUpdate(): void;
53
- private getContentToUpdate;
54
- private onDidContentChange;
55
63
  protected isVisible(): boolean;
56
64
  dispose(): void;
65
+ append(message: string): void;
66
+ replace(message: string): void;
67
+ abstract clear(): void;
68
+ abstract update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void;
69
+ abstract updateChannelSources(files: IOutputContentSource[]): void;
70
+ }
71
+ export declare class FileOutputChannelModel extends AbstractFileOutputChannelModel implements IOutputChannelModel {
72
+ readonly source: IOutputContentSource;
73
+ private readonly fileOutput;
74
+ constructor(modelUri: URI, language: ILanguageSelection, source: IOutputContentSource, fileService: IFileService, modelService: IModelService, instantiationService: IInstantiationService, logService: ILogService, editorWorkerService: IEditorWorkerService);
75
+ clear(): void;
76
+ update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void;
77
+ updateChannelSources(files: IOutputContentSource[]): void;
78
+ }
79
+ export declare class MultiFileOutputChannelModel extends AbstractFileOutputChannelModel implements IOutputChannelModel {
80
+ readonly source: IOutputContentSource[];
81
+ private readonly multifileOutput;
82
+ constructor(modelUri: URI, language: ILanguageSelection, source: IOutputContentSource[], fileService: IFileService, modelService: IModelService, logService: ILogService, editorWorkerService: IEditorWorkerService, instantiationService: IInstantiationService);
83
+ updateChannelSources(files: IOutputContentSource[]): void;
84
+ clear(): void;
85
+ update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void;
57
86
  }
58
87
  export declare class DelegatedOutputChannelModel extends Disposable implements IOutputChannelModel {
59
88
  private readonly instantiationService;
@@ -61,11 +90,15 @@ export declare class DelegatedOutputChannelModel extends Disposable implements I
61
90
  private readonly _onDispose;
62
91
  readonly onDispose: Event<void>;
63
92
  private readonly outputChannelModel;
64
- constructor(id: string, modelUri: URI, language: ILanguageSelection, outputDir: Promise<URI>, instantiationService: IInstantiationService, fileService: IFileService);
93
+ readonly source: IOutputContentSource;
94
+ constructor(id: string, modelUri: URI, language: ILanguageSelection, outputDir: URI, outputDirCreationPromise: Promise<void>, instantiationService: IInstantiationService, fileService: IFileService);
65
95
  private createOutputChannelModel;
96
+ getLogEntries(): readonly ILogEntry[];
66
97
  append(output: string): void;
67
98
  update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void;
68
99
  loadModel(): Promise<ITextModel>;
69
100
  clear(): void;
70
101
  replace(value: string): void;
102
+ updateChannelSources(files: IOutputContentSource[]): void;
71
103
  }
104
+ export {};