@codingame/monaco-vscode-output-service-override 25.1.2 → 26.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.
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +264 -211
- package/vscode/src/vs/workbench/contrib/output/browser/outputLinkProvider.js +25 -21
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +122 -79
- package/vscode/src/vs/workbench/contrib/output/browser/outputView.js +163 -99
- package/vscode/src/vs/workbench/contrib/output/common/outputChannelModel.js +216 -136
- package/vscode/src/vs/workbench/contrib/output/common/outputLinkComputer.js +18 -19
|
@@ -42,14 +42,21 @@ function parseLogEntryAt(model, lineNumber) {
|
|
|
42
42
|
const lineCount = model.getLineCount();
|
|
43
43
|
while (endLine < lineCount) {
|
|
44
44
|
const nextLineContent = model.getLineContent(endLine + 1);
|
|
45
|
-
const isLastLine = endLine + 1 === lineCount && nextLineContent ===
|
|
45
|
+
const isLastLine = endLine + 1 === lineCount && nextLineContent === "";
|
|
46
46
|
if (LOG_ENTRY_REGEX.test(nextLineContent) || isLastLine) {
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
endLine++;
|
|
50
50
|
}
|
|
51
51
|
const range = ( new Range(startLine, 1, endLine, model.getLineMaxColumn(endLine)));
|
|
52
|
-
return {
|
|
52
|
+
return {
|
|
53
|
+
range,
|
|
54
|
+
timestamp,
|
|
55
|
+
timestampRange,
|
|
56
|
+
logLevel,
|
|
57
|
+
logLevelRange,
|
|
58
|
+
category
|
|
59
|
+
};
|
|
53
60
|
}
|
|
54
61
|
return null;
|
|
55
62
|
}
|
|
@@ -82,29 +89,41 @@ function changeStartLineNumber(logEntry, lineNumber) {
|
|
|
82
89
|
logEntry.logLevelRange.startColumn,
|
|
83
90
|
lineNumber,
|
|
84
91
|
logEntry.logLevelRange.endColumn
|
|
85
|
-
))
|
|
92
|
+
))
|
|
86
93
|
};
|
|
87
94
|
}
|
|
88
95
|
function parseLogLevel(level) {
|
|
89
96
|
switch (level.toLowerCase()) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
case "trace":
|
|
98
|
+
return LogLevel.Trace;
|
|
99
|
+
case "debug":
|
|
100
|
+
return LogLevel.Debug;
|
|
101
|
+
case "info":
|
|
102
|
+
return LogLevel.Info;
|
|
103
|
+
case "warning":
|
|
104
|
+
return LogLevel.Warning;
|
|
105
|
+
case "error":
|
|
106
|
+
return LogLevel.Error;
|
|
107
|
+
default:
|
|
108
|
+
throw ( new Error(`Unknown log level: ${level}`));
|
|
102
109
|
}
|
|
103
110
|
}
|
|
104
111
|
let FileContentProvider = class FileContentProvider extends Disposable {
|
|
105
|
-
get onDidAppend() {
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
get onDidAppend() {
|
|
113
|
+
return this._onDidAppend.event;
|
|
114
|
+
}
|
|
115
|
+
get onDidReset() {
|
|
116
|
+
return this._onDidReset.event;
|
|
117
|
+
}
|
|
118
|
+
constructor(
|
|
119
|
+
{
|
|
120
|
+
name,
|
|
121
|
+
resource
|
|
122
|
+
},
|
|
123
|
+
fileService,
|
|
124
|
+
instantiationService,
|
|
125
|
+
logService
|
|
126
|
+
) {
|
|
108
127
|
super();
|
|
109
128
|
this.fileService = fileService;
|
|
110
129
|
this.instantiationService = instantiationService;
|
|
@@ -112,11 +131,11 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
112
131
|
this._onDidAppend = ( new Emitter());
|
|
113
132
|
this._onDidReset = ( new Emitter());
|
|
114
133
|
this.watching = false;
|
|
115
|
-
this.etag =
|
|
134
|
+
this.etag = "";
|
|
116
135
|
this.logEntries = [];
|
|
117
136
|
this.startOffset = 0;
|
|
118
137
|
this.endOffset = 0;
|
|
119
|
-
this.name = name ??
|
|
138
|
+
this.name = name ?? "";
|
|
120
139
|
this.resource = resource;
|
|
121
140
|
this.syncDelayer = ( new ThrottledDelayer(500));
|
|
122
141
|
this._register(toDisposable(() => this.unwatch()));
|
|
@@ -131,7 +150,7 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
131
150
|
}
|
|
132
151
|
watch() {
|
|
133
152
|
if (!this.watching) {
|
|
134
|
-
this.logService.trace(
|
|
153
|
+
this.logService.trace("Started polling", ( this.resource.toString()));
|
|
135
154
|
this.poll();
|
|
136
155
|
this.watching = true;
|
|
137
156
|
}
|
|
@@ -140,7 +159,7 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
140
159
|
if (this.watching) {
|
|
141
160
|
this.syncDelayer.cancel();
|
|
142
161
|
this.watching = false;
|
|
143
|
-
this.logService.trace(
|
|
162
|
+
this.logService.trace("Stopped polling", ( this.resource.toString()));
|
|
144
163
|
}
|
|
145
164
|
}
|
|
146
165
|
poll() {
|
|
@@ -162,13 +181,11 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
162
181
|
if (isNumber(stat.size) && this.endOffset > stat.size) {
|
|
163
182
|
this.reset(0);
|
|
164
183
|
this._onDidReset.fire();
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
184
|
+
} else {
|
|
167
185
|
this._onDidAppend.fire();
|
|
168
186
|
}
|
|
169
187
|
}
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
188
|
+
} catch (error) {
|
|
172
189
|
if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
|
|
173
190
|
throw error;
|
|
174
191
|
}
|
|
@@ -182,11 +199,13 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
182
199
|
if (!this.fileService.hasProvider(this.resource)) {
|
|
183
200
|
return {
|
|
184
201
|
name: this.name,
|
|
185
|
-
content:
|
|
186
|
-
consume: () => {
|
|
202
|
+
content: "",
|
|
203
|
+
consume: () => {}
|
|
187
204
|
};
|
|
188
205
|
}
|
|
189
|
-
const fileContent = await this.fileService.readFile(this.resource, {
|
|
206
|
+
const fileContent = await this.fileService.readFile(this.resource, {
|
|
207
|
+
position: this.endOffset
|
|
208
|
+
});
|
|
190
209
|
const content = ( fileContent.value.toString());
|
|
191
210
|
const logEntries = donotConsumeLogEntries ? [] : this.parseLogEntries(content, this.logEntries[this.logEntries.length - 1]);
|
|
192
211
|
let consumed = false;
|
|
@@ -202,15 +221,14 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
202
221
|
}
|
|
203
222
|
}
|
|
204
223
|
};
|
|
205
|
-
}
|
|
206
|
-
catch (error) {
|
|
224
|
+
} catch (error) {
|
|
207
225
|
if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
|
|
208
226
|
throw error;
|
|
209
227
|
}
|
|
210
228
|
return {
|
|
211
229
|
name: this.name,
|
|
212
|
-
content:
|
|
213
|
-
consume: () => {
|
|
230
|
+
content: "",
|
|
231
|
+
consume: () => {}
|
|
214
232
|
};
|
|
215
233
|
}
|
|
216
234
|
}
|
|
@@ -222,22 +240,17 @@ let FileContentProvider = class FileContentProvider extends Disposable {
|
|
|
222
240
|
}
|
|
223
241
|
const logEntries = [];
|
|
224
242
|
let logEntryStartLineNumber = lastLogEntry ? lastLogEntry.range.endLineNumber + 1 : 1;
|
|
225
|
-
for (const entry of logEntryIterator(model,
|
|
243
|
+
for (const entry of logEntryIterator(model, e => changeStartLineNumber(e, logEntryStartLineNumber))) {
|
|
226
244
|
logEntries.push(entry);
|
|
227
245
|
logEntryStartLineNumber = entry.range.endLineNumber + 1;
|
|
228
246
|
}
|
|
229
247
|
return logEntries;
|
|
230
|
-
}
|
|
231
|
-
finally {
|
|
248
|
+
} finally {
|
|
232
249
|
model.dispose();
|
|
233
250
|
}
|
|
234
251
|
}
|
|
235
252
|
};
|
|
236
|
-
FileContentProvider = ( __decorate([
|
|
237
|
-
( __param(1, IFileService)),
|
|
238
|
-
( __param(2, IInstantiationService)),
|
|
239
|
-
( __param(3, ILogService))
|
|
240
|
-
], FileContentProvider));
|
|
253
|
+
FileContentProvider = ( __decorate([( __param(1, IFileService)), ( __param(2, IInstantiationService)), ( __param(3, ILogService))], FileContentProvider));
|
|
241
254
|
let MultiFileContentProvider = class MultiFileContentProvider extends Disposable {
|
|
242
255
|
constructor(filesInfos, instantiationService, fileService, logService) {
|
|
243
256
|
super();
|
|
@@ -287,7 +300,11 @@ let MultiFileContentProvider = class MultiFileContentProvider extends Disposable
|
|
|
287
300
|
this.unwatch();
|
|
288
301
|
}
|
|
289
302
|
const result = sortedDiff(( this.fileContentProviderItems.map(([output]) => output)), files, (a, b) => extUri.compare(a.resource, b.resource));
|
|
290
|
-
for (const {
|
|
303
|
+
for (const {
|
|
304
|
+
start,
|
|
305
|
+
deleteCount,
|
|
306
|
+
toInsert
|
|
307
|
+
} of result) {
|
|
291
308
|
const outputs = ( toInsert.map(file => this.createFileContentProvider(file)));
|
|
292
309
|
const outputsToRemove = this.fileContentProviderItems.splice(start, deleteCount, ...outputs);
|
|
293
310
|
for (const [, disposables] of outputsToRemove) {
|
|
@@ -315,14 +332,21 @@ let MultiFileContentProvider = class MultiFileContentProvider extends Disposable
|
|
|
315
332
|
}
|
|
316
333
|
async getContent() {
|
|
317
334
|
const outputs = await Promise.all(( this.fileContentProviderItems.map(([output]) => output.getContent(true))));
|
|
318
|
-
const {
|
|
335
|
+
const {
|
|
336
|
+
content,
|
|
337
|
+
logEntries
|
|
338
|
+
} = this.combineLogEntries(outputs, this.logEntries[this.logEntries.length - 1]);
|
|
319
339
|
let consumed = false;
|
|
320
340
|
return {
|
|
321
341
|
content,
|
|
322
342
|
consume: () => {
|
|
323
343
|
if (!consumed) {
|
|
324
344
|
consumed = true;
|
|
325
|
-
outputs.forEach((
|
|
345
|
+
outputs.forEach((
|
|
346
|
+
{
|
|
347
|
+
consume
|
|
348
|
+
}
|
|
349
|
+
) => consume());
|
|
326
350
|
this.logEntries.push(...logEntries);
|
|
327
351
|
}
|
|
328
352
|
}
|
|
@@ -331,7 +355,10 @@ let MultiFileContentProvider = class MultiFileContentProvider extends Disposable
|
|
|
331
355
|
combineLogEntries(outputs, lastEntry) {
|
|
332
356
|
outputs = outputs.filter(output => !!output.content);
|
|
333
357
|
if (outputs.length === 0) {
|
|
334
|
-
return {
|
|
358
|
+
return {
|
|
359
|
+
logEntries: [],
|
|
360
|
+
content: ""
|
|
361
|
+
};
|
|
335
362
|
}
|
|
336
363
|
const logEntries = [];
|
|
337
364
|
const contents = [];
|
|
@@ -339,31 +366,39 @@ let MultiFileContentProvider = class MultiFileContentProvider extends Disposable
|
|
|
339
366
|
const lineContent = model.getValueInRange(logEntry.range);
|
|
340
367
|
const content = name ? `${lineContent.substring(0, logEntry.logLevelRange.endColumn)} [${name}]${lineContent.substring(logEntry.logLevelRange.endColumn)}` : lineContent;
|
|
341
368
|
return [{
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
369
|
+
...logEntry,
|
|
370
|
+
category: name,
|
|
371
|
+
range: ( new Range(
|
|
372
|
+
logEntry.range.startLineNumber,
|
|
373
|
+
logEntry.logLevelRange.startColumn,
|
|
374
|
+
logEntry.range.endLineNumber,
|
|
375
|
+
name ? logEntry.range.endColumn + name.length + 3 : logEntry.range.endColumn
|
|
376
|
+
))
|
|
377
|
+
}, content];
|
|
351
378
|
};
|
|
352
|
-
const model = this.instantiationService.createInstance(
|
|
379
|
+
const model = this.instantiationService.createInstance(
|
|
380
|
+
TextModel,
|
|
381
|
+
outputs[0].content,
|
|
382
|
+
LOG_MIME,
|
|
383
|
+
TextModel.DEFAULT_CREATION_OPTIONS,
|
|
384
|
+
null
|
|
385
|
+
);
|
|
353
386
|
try {
|
|
354
|
-
for (const [logEntry, content] of logEntryIterator(model,
|
|
387
|
+
for (const [logEntry, content] of logEntryIterator(model, e => process(model, e, outputs[0].name))) {
|
|
355
388
|
logEntries.push(logEntry);
|
|
356
389
|
contents.push(content);
|
|
357
390
|
}
|
|
358
|
-
}
|
|
359
|
-
finally {
|
|
391
|
+
} finally {
|
|
360
392
|
model.dispose();
|
|
361
393
|
}
|
|
362
394
|
for (let index = 1; index < outputs.length; index++) {
|
|
363
|
-
const {
|
|
395
|
+
const {
|
|
396
|
+
content,
|
|
397
|
+
name
|
|
398
|
+
} = outputs[index];
|
|
364
399
|
const model = this.instantiationService.createInstance(TextModel, content, LOG_MIME, TextModel.DEFAULT_CREATION_OPTIONS, null);
|
|
365
400
|
try {
|
|
366
|
-
const iterator = logEntryIterator(model,
|
|
401
|
+
const iterator = logEntryIterator(model, e => process(model, e, name));
|
|
367
402
|
let next = iterator.next();
|
|
368
403
|
while (!next.done) {
|
|
369
404
|
const [logEntry, content] = next.value;
|
|
@@ -376,12 +411,10 @@ let MultiFileContentProvider = class MultiFileContentProvider extends Disposable
|
|
|
376
411
|
logEntriesToAdd.push(next.value[0]);
|
|
377
412
|
contentsToAdd.push(next.value[1]);
|
|
378
413
|
}
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
414
|
+
} else {
|
|
381
415
|
if (logEntry.timestamp <= logEntries[0].timestamp) {
|
|
382
416
|
insertionIndex = 0;
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
417
|
+
} else {
|
|
385
418
|
const idx = binarySearch(logEntries, logEntry, (a, b) => a.timestamp - b.timestamp);
|
|
386
419
|
insertionIndex = idx < 0 ? ~idx : idx;
|
|
387
420
|
}
|
|
@@ -393,30 +426,34 @@ let MultiFileContentProvider = class MultiFileContentProvider extends Disposable
|
|
|
393
426
|
contents.splice(insertionIndex, 0, ...contentsToAdd);
|
|
394
427
|
logEntries.splice(insertionIndex, 0, ...logEntriesToAdd);
|
|
395
428
|
}
|
|
396
|
-
}
|
|
397
|
-
finally {
|
|
429
|
+
} finally {
|
|
398
430
|
model.dispose();
|
|
399
431
|
}
|
|
400
432
|
}
|
|
401
|
-
let content =
|
|
433
|
+
let content = "";
|
|
402
434
|
const updatedLogEntries = [];
|
|
403
435
|
let logEntryStartLineNumber = lastEntry ? lastEntry.range.endLineNumber + 1 : 1;
|
|
404
436
|
for (let i = 0; i < logEntries.length; i++) {
|
|
405
|
-
content += contents[i] +
|
|
437
|
+
content += contents[i] + "\n";
|
|
406
438
|
const updatedLogEntry = changeStartLineNumber(logEntries[i], logEntryStartLineNumber);
|
|
407
439
|
updatedLogEntries.push(updatedLogEntry);
|
|
408
440
|
logEntryStartLineNumber = updatedLogEntry.range.endLineNumber + 1;
|
|
409
441
|
}
|
|
410
|
-
return {
|
|
442
|
+
return {
|
|
443
|
+
logEntries: updatedLogEntries,
|
|
444
|
+
content
|
|
445
|
+
};
|
|
411
446
|
}
|
|
412
447
|
};
|
|
413
|
-
MultiFileContentProvider = ( __decorate([
|
|
414
|
-
( __param(1, IInstantiationService)),
|
|
415
|
-
( __param(2, IFileService)),
|
|
416
|
-
( __param(3, ILogService))
|
|
417
|
-
], MultiFileContentProvider));
|
|
448
|
+
MultiFileContentProvider = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IFileService)), ( __param(3, ILogService))], MultiFileContentProvider));
|
|
418
449
|
let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extends Disposable {
|
|
419
|
-
constructor(
|
|
450
|
+
constructor(
|
|
451
|
+
modelUri,
|
|
452
|
+
language,
|
|
453
|
+
outputContentProvider,
|
|
454
|
+
modelService,
|
|
455
|
+
editorWorkerService
|
|
456
|
+
) {
|
|
420
457
|
super();
|
|
421
458
|
this.modelUri = modelUri;
|
|
422
459
|
this.language = language;
|
|
@@ -436,12 +473,19 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
436
473
|
this.loadModelPromise = Promises.withAsyncBody(async (c, e) => {
|
|
437
474
|
try {
|
|
438
475
|
this.modelDisposable.value = ( new DisposableStore());
|
|
439
|
-
this.model = this.modelService.createModel(
|
|
440
|
-
const {
|
|
476
|
+
this.model = this.modelService.createModel("", this.language, this.modelUri);
|
|
477
|
+
const {
|
|
478
|
+
content,
|
|
479
|
+
consume
|
|
480
|
+
} = await this.outputContentProvider.getContent();
|
|
441
481
|
consume();
|
|
442
482
|
this.doAppendContent(this.model, content);
|
|
443
|
-
this.modelDisposable.value.add(
|
|
444
|
-
|
|
483
|
+
this.modelDisposable.value.add(
|
|
484
|
+
this.outputContentProvider.onDidReset(() => this.onDidContentChange(true, true))
|
|
485
|
+
);
|
|
486
|
+
this.modelDisposable.value.add(
|
|
487
|
+
this.outputContentProvider.onDidAppend(() => this.onDidContentChange(false, false))
|
|
488
|
+
);
|
|
445
489
|
this.outputContentProvider.watch();
|
|
446
490
|
this.modelDisposable.value.add(toDisposable(() => this.outputContentProvider.unwatch()));
|
|
447
491
|
this.modelDisposable.value.add(this.model.onWillDispose(() => {
|
|
@@ -451,8 +495,7 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
451
495
|
this.model = null;
|
|
452
496
|
}));
|
|
453
497
|
c(this.model);
|
|
454
|
-
}
|
|
455
|
-
catch (error) {
|
|
498
|
+
} catch (error) {
|
|
456
499
|
e(error);
|
|
457
500
|
}
|
|
458
501
|
});
|
|
@@ -481,11 +524,9 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
481
524
|
const token = this.modelUpdateCancellationSource.value.token;
|
|
482
525
|
if (mode === OutputChannelUpdateMode.Clear) {
|
|
483
526
|
this.clearContent(this.model);
|
|
484
|
-
}
|
|
485
|
-
else if (mode === OutputChannelUpdateMode.Replace) {
|
|
527
|
+
} else if (mode === OutputChannelUpdateMode.Replace) {
|
|
486
528
|
this.replacePromise = this.replaceContent(this.model, token).finally(() => this.replacePromise = undefined);
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
529
|
+
} else {
|
|
489
530
|
this.appendContent(this.model, immediate, token);
|
|
490
531
|
}
|
|
491
532
|
}
|
|
@@ -501,13 +542,15 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
501
542
|
if (this.replacePromise) {
|
|
502
543
|
try {
|
|
503
544
|
await this.replacePromise;
|
|
504
|
-
}
|
|
505
|
-
catch (e) { }
|
|
545
|
+
} catch (e) {}
|
|
506
546
|
if (token.isCancellationRequested) {
|
|
507
547
|
return;
|
|
508
548
|
}
|
|
509
549
|
}
|
|
510
|
-
const {
|
|
550
|
+
const {
|
|
551
|
+
content,
|
|
552
|
+
consume
|
|
553
|
+
} = await this.outputContentProvider.getContent();
|
|
511
554
|
if (token.isCancellationRequested) {
|
|
512
555
|
return;
|
|
513
556
|
}
|
|
@@ -526,7 +569,10 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
526
569
|
model.applyEdits([EditOperation.insert(( new Position(lastLine, lastLineMaxColumn)), content)]);
|
|
527
570
|
}
|
|
528
571
|
async replaceContent(model, token) {
|
|
529
|
-
const {
|
|
572
|
+
const {
|
|
573
|
+
content,
|
|
574
|
+
consume
|
|
575
|
+
} = await this.outputContentProvider.getContent();
|
|
530
576
|
if (token.isCancellationRequested) {
|
|
531
577
|
return;
|
|
532
578
|
}
|
|
@@ -545,7 +591,10 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
545
591
|
return [EditOperation.delete(model.getFullModelRange())];
|
|
546
592
|
}
|
|
547
593
|
if (contentToReplace !== model.getValue()) {
|
|
548
|
-
const edits = await this.editorWorkerService.computeMoreMinimalEdits(model.uri, [{
|
|
594
|
+
const edits = await this.editorWorkerService.computeMoreMinimalEdits(model.uri, [{
|
|
595
|
+
text: ( contentToReplace.toString()),
|
|
596
|
+
range: model.getFullModelRange()
|
|
597
|
+
}]);
|
|
549
598
|
if (edits?.length) {
|
|
550
599
|
return ( edits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text)));
|
|
551
600
|
}
|
|
@@ -566,15 +615,25 @@ let AbstractFileOutputChannelModel = class AbstractFileOutputChannelModel extend
|
|
|
566
615
|
this._onDispose.fire();
|
|
567
616
|
super.dispose();
|
|
568
617
|
}
|
|
569
|
-
append(message) {
|
|
570
|
-
|
|
618
|
+
append(message) {
|
|
619
|
+
throw ( new Error("Not supported"));
|
|
620
|
+
}
|
|
621
|
+
replace(message) {
|
|
622
|
+
throw ( new Error("Not supported"));
|
|
623
|
+
}
|
|
571
624
|
};
|
|
572
|
-
AbstractFileOutputChannelModel = ( __decorate([
|
|
573
|
-
( __param(3, IModelService)),
|
|
574
|
-
( __param(4, IEditorWorkerService))
|
|
575
|
-
], AbstractFileOutputChannelModel));
|
|
625
|
+
AbstractFileOutputChannelModel = ( __decorate([( __param(3, IModelService)), ( __param(4, IEditorWorkerService))], AbstractFileOutputChannelModel));
|
|
576
626
|
let FileOutputChannelModel = class FileOutputChannelModel extends AbstractFileOutputChannelModel {
|
|
577
|
-
constructor(
|
|
627
|
+
constructor(
|
|
628
|
+
modelUri,
|
|
629
|
+
language,
|
|
630
|
+
source,
|
|
631
|
+
fileService,
|
|
632
|
+
modelService,
|
|
633
|
+
instantiationService,
|
|
634
|
+
logService,
|
|
635
|
+
editorWorkerService
|
|
636
|
+
) {
|
|
578
637
|
const fileOutput = ( new FileContentProvider(source, fileService, instantiationService, logService));
|
|
579
638
|
super(modelUri, language, fileOutput, modelService, editorWorkerService);
|
|
580
639
|
this.source = source;
|
|
@@ -589,25 +648,29 @@ let FileOutputChannelModel = class FileOutputChannelModel extends AbstractFileOu
|
|
|
589
648
|
if (mode === OutputChannelUpdateMode.Clear || mode === OutputChannelUpdateMode.Replace) {
|
|
590
649
|
if (isNumber(till)) {
|
|
591
650
|
this.fileOutput.reset(till);
|
|
592
|
-
}
|
|
593
|
-
else {
|
|
651
|
+
} else {
|
|
594
652
|
this.fileOutput.resetToEnd();
|
|
595
653
|
}
|
|
596
654
|
}
|
|
597
655
|
this.doUpdate(mode, immediate);
|
|
598
656
|
});
|
|
599
657
|
}
|
|
600
|
-
updateChannelSources(files) {
|
|
658
|
+
updateChannelSources(files) {
|
|
659
|
+
throw ( new Error("Not supported"));
|
|
660
|
+
}
|
|
601
661
|
};
|
|
602
|
-
FileOutputChannelModel = ( __decorate([
|
|
603
|
-
( __param(3, IFileService)),
|
|
604
|
-
( __param(4, IModelService)),
|
|
605
|
-
( __param(5, IInstantiationService)),
|
|
606
|
-
( __param(6, ILogService)),
|
|
607
|
-
( __param(7, IEditorWorkerService))
|
|
608
|
-
], FileOutputChannelModel));
|
|
662
|
+
FileOutputChannelModel = ( __decorate([( __param(3, IFileService)), ( __param(4, IModelService)), ( __param(5, IInstantiationService)), ( __param(6, ILogService)), ( __param(7, IEditorWorkerService))], FileOutputChannelModel));
|
|
609
663
|
let MultiFileOutputChannelModel = class MultiFileOutputChannelModel extends AbstractFileOutputChannelModel {
|
|
610
|
-
constructor(
|
|
664
|
+
constructor(
|
|
665
|
+
modelUri,
|
|
666
|
+
language,
|
|
667
|
+
source,
|
|
668
|
+
fileService,
|
|
669
|
+
modelService,
|
|
670
|
+
logService,
|
|
671
|
+
editorWorkerService,
|
|
672
|
+
instantiationService
|
|
673
|
+
) {
|
|
611
674
|
const multifileOutput = ( new MultiFileContentProvider(source, instantiationService, fileService, logService));
|
|
612
675
|
super(modelUri, language, multifileOutput, modelService, editorWorkerService);
|
|
613
676
|
this.source = source;
|
|
@@ -629,19 +692,34 @@ let MultiFileOutputChannelModel = class MultiFileOutputChannelModel extends Abst
|
|
|
629
692
|
this.doUpdate(OutputChannelUpdateMode.Clear, true);
|
|
630
693
|
});
|
|
631
694
|
}
|
|
632
|
-
update(mode, till, immediate) {
|
|
695
|
+
update(mode, till, immediate) {
|
|
696
|
+
throw ( new Error("Not supported"));
|
|
697
|
+
}
|
|
633
698
|
};
|
|
634
|
-
MultiFileOutputChannelModel = ( __decorate([
|
|
635
|
-
( __param(3, IFileService)),
|
|
636
|
-
( __param(4, IModelService)),
|
|
637
|
-
( __param(5, ILogService)),
|
|
638
|
-
( __param(6, IEditorWorkerService)),
|
|
639
|
-
( __param(7, IInstantiationService))
|
|
640
|
-
], MultiFileOutputChannelModel));
|
|
699
|
+
MultiFileOutputChannelModel = ( __decorate([( __param(3, IFileService)), ( __param(4, IModelService)), ( __param(5, ILogService)), ( __param(6, IEditorWorkerService)), ( __param(7, IInstantiationService))], MultiFileOutputChannelModel));
|
|
641
700
|
let OutputChannelBackedByFile = class OutputChannelBackedByFile extends FileOutputChannelModel {
|
|
642
|
-
constructor(
|
|
643
|
-
|
|
644
|
-
|
|
701
|
+
constructor(
|
|
702
|
+
id,
|
|
703
|
+
modelUri,
|
|
704
|
+
language,
|
|
705
|
+
file,
|
|
706
|
+
fileService,
|
|
707
|
+
modelService,
|
|
708
|
+
loggerService,
|
|
709
|
+
instantiationService,
|
|
710
|
+
logService,
|
|
711
|
+
editorWorkerService
|
|
712
|
+
) {
|
|
713
|
+
super(modelUri, language, {
|
|
714
|
+
resource: file,
|
|
715
|
+
name: ""
|
|
716
|
+
}, fileService, modelService, instantiationService, logService, editorWorkerService);
|
|
717
|
+
this.logger = loggerService.createLogger(file, {
|
|
718
|
+
logLevel: "always",
|
|
719
|
+
donotRotate: true,
|
|
720
|
+
donotUseFormatters: true,
|
|
721
|
+
hidden: true
|
|
722
|
+
});
|
|
645
723
|
this._offset = 0;
|
|
646
724
|
}
|
|
647
725
|
append(message) {
|
|
@@ -661,30 +739,35 @@ let OutputChannelBackedByFile = class OutputChannelBackedByFile extends FileOutp
|
|
|
661
739
|
}
|
|
662
740
|
}
|
|
663
741
|
};
|
|
664
|
-
OutputChannelBackedByFile = ( __decorate([
|
|
665
|
-
( __param(4, IFileService)),
|
|
666
|
-
( __param(5, IModelService)),
|
|
667
|
-
( __param(6, ILoggerService)),
|
|
668
|
-
( __param(7, IInstantiationService)),
|
|
669
|
-
( __param(8, ILogService)),
|
|
670
|
-
( __param(9, IEditorWorkerService))
|
|
671
|
-
], OutputChannelBackedByFile));
|
|
742
|
+
OutputChannelBackedByFile = ( __decorate([( __param(4, IFileService)), ( __param(5, IModelService)), ( __param(6, ILoggerService)), ( __param(7, IInstantiationService)), ( __param(8, ILogService)), ( __param(9, IEditorWorkerService))], OutputChannelBackedByFile));
|
|
672
743
|
let DelegatedOutputChannelModel = class DelegatedOutputChannelModel extends Disposable {
|
|
673
|
-
constructor(
|
|
744
|
+
constructor(
|
|
745
|
+
id,
|
|
746
|
+
modelUri,
|
|
747
|
+
language,
|
|
748
|
+
outputDir,
|
|
749
|
+
outputDirCreationPromise,
|
|
750
|
+
instantiationService,
|
|
751
|
+
fileService
|
|
752
|
+
) {
|
|
674
753
|
super();
|
|
675
754
|
this.instantiationService = instantiationService;
|
|
676
755
|
this.fileService = fileService;
|
|
677
756
|
this._onDispose = this._register(( new Emitter()));
|
|
678
757
|
this.onDispose = this._onDispose.event;
|
|
679
758
|
this.outputChannelModel = this.createOutputChannelModel(id, modelUri, language, outputDir, outputDirCreationPromise);
|
|
680
|
-
const resource = joinPath(outputDir, `${id.replace(/[\\/:\*\?"<>\|]/g,
|
|
681
|
-
this.source = {
|
|
759
|
+
const resource = joinPath(outputDir, `${id.replace(/[\\/:\*\?"<>\|]/g, "")}.log`);
|
|
760
|
+
this.source = {
|
|
761
|
+
resource
|
|
762
|
+
};
|
|
682
763
|
}
|
|
683
764
|
async createOutputChannelModel(id, modelUri, language, outputDir, outputDirPromise) {
|
|
684
765
|
await outputDirPromise;
|
|
685
|
-
const file = joinPath(outputDir, `${id.replace(/[\\/:\*\?"<>\|]/g,
|
|
766
|
+
const file = joinPath(outputDir, `${id.replace(/[\\/:\*\?"<>\|]/g, "")}.log`);
|
|
686
767
|
await this.fileService.createFile(file);
|
|
687
|
-
const outputChannelModel = this._register(
|
|
768
|
+
const outputChannelModel = this._register(
|
|
769
|
+
this.instantiationService.createInstance(OutputChannelBackedByFile, id, modelUri, language, file)
|
|
770
|
+
);
|
|
688
771
|
this._register(outputChannelModel.onDispose(() => this._onDispose.fire()));
|
|
689
772
|
return outputChannelModel;
|
|
690
773
|
}
|
|
@@ -710,9 +793,6 @@ let DelegatedOutputChannelModel = class DelegatedOutputChannelModel extends Disp
|
|
|
710
793
|
this.outputChannelModel.then(outputChannelModel => outputChannelModel.updateChannelSources(files));
|
|
711
794
|
}
|
|
712
795
|
};
|
|
713
|
-
DelegatedOutputChannelModel = ( __decorate([
|
|
714
|
-
( __param(5, IInstantiationService)),
|
|
715
|
-
( __param(6, IFileService))
|
|
716
|
-
], DelegatedOutputChannelModel));
|
|
796
|
+
DelegatedOutputChannelModel = ( __decorate([( __param(5, IInstantiationService)), ( __param(6, IFileService))], DelegatedOutputChannelModel));
|
|
717
797
|
|
|
718
798
|
export { AbstractFileOutputChannelModel, DelegatedOutputChannelModel, FileOutputChannelModel, MultiFileOutputChannelModel, parseLogEntryAt };
|