@codingame/monaco-vscode-output-service-override 2.0.3 → 2.1.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.
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +72 -39
- package/vscode/src/vs/workbench/contrib/output/browser/output.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +4 -4
- package/vscode/src/vs/workbench/contrib/output/browser/outputView.js +2 -15
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
+
|
|
3
|
+
export { n as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-output-service-override",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@2.0
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.1.0",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-log-service-override": "2.0
|
|
23
|
+
"@codingame/monaco-vscode-log-service-override": "2.1.0"
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
@@ -4,16 +4,16 @@ import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
|
4
4
|
import { ModesRegistry } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
|
|
5
5
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
6
6
|
import { registerAction2, Action2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
-
import { OUTPUT_MODE_ID, OUTPUT_MIME, LOG_MODE_ID, LOG_MIME, OUTPUT_VIEW_ID, IOutputService, Extensions as Extensions$3, CONTEXT_IN_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK,
|
|
7
|
+
import { OUTPUT_MODE_ID, OUTPUT_MIME, LOG_MODE_ID, LOG_MIME, OUTPUT_VIEW_ID, IOutputService, Extensions as Extensions$3, CONTEXT_IN_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, CONTEXT_ACTIVE_FILE_OUTPUT, ACTIVE_OUTPUT_CHANNEL_CONTEXT } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
8
8
|
import { OutputViewPane } from './outputView.js';
|
|
9
9
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
10
10
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
12
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
13
13
|
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
14
14
|
import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
15
15
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
16
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
16
|
+
import { AUX_WINDOW_GROUP, IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
17
17
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
18
18
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
19
19
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
@@ -21,7 +21,7 @@ import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistr
|
|
|
21
21
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
22
22
|
import { Disposable, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
23
23
|
import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
24
|
-
import {
|
|
24
|
+
import { IAudioCueService, AudioCue } from 'vscode/vscode/vs/platform/audioCues/browser/audioCueService';
|
|
25
25
|
|
|
26
26
|
ModesRegistry.registerLanguage({
|
|
27
27
|
id: OUTPUT_MODE_ID,
|
|
@@ -82,9 +82,11 @@ const VIEW_CONTAINER = ( Registry.as(Extensions.ViewContainersRegistry)).registe
|
|
|
82
82
|
}
|
|
83
83
|
}], VIEW_CONTAINER);
|
|
84
84
|
let OutputContribution = class OutputContribution extends Disposable {
|
|
85
|
-
constructor(
|
|
85
|
+
constructor(outputService, editorService, fileConfigurationService) {
|
|
86
86
|
super();
|
|
87
87
|
this.outputService = outputService;
|
|
88
|
+
this.editorService = editorService;
|
|
89
|
+
this.fileConfigurationService = fileConfigurationService;
|
|
88
90
|
this.registerActions();
|
|
89
91
|
}
|
|
90
92
|
registerActions() {
|
|
@@ -92,7 +94,8 @@ let OutputContribution = class OutputContribution extends Disposable {
|
|
|
92
94
|
this.registerShowOutputChannelsAction();
|
|
93
95
|
this.registerClearOutputAction();
|
|
94
96
|
this.registerToggleAutoScrollAction();
|
|
95
|
-
this.
|
|
97
|
+
this.registerOpenActiveOutputFileAction();
|
|
98
|
+
this.registerOpenActiveOutputFileInAuxWindowAction();
|
|
96
99
|
this.registerShowLogsAction();
|
|
97
100
|
this.registerOpenLogFileAction();
|
|
98
101
|
}
|
|
@@ -242,11 +245,11 @@ let OutputContribution = class OutputContribution extends Disposable {
|
|
|
242
245
|
}
|
|
243
246
|
async run(accessor) {
|
|
244
247
|
const outputService = accessor.get(IOutputService);
|
|
245
|
-
const
|
|
248
|
+
const audioCueService = accessor.get(IAudioCueService);
|
|
246
249
|
const activeChannel = outputService.getActiveChannel();
|
|
247
250
|
if (activeChannel) {
|
|
248
251
|
activeChannel.clear();
|
|
249
|
-
|
|
252
|
+
audioCueService.playAudioCue(AudioCue.clear);
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
}));
|
|
@@ -290,53 +293,82 @@ let OutputContribution = class OutputContribution extends Disposable {
|
|
|
290
293
|
}
|
|
291
294
|
}));
|
|
292
295
|
}
|
|
293
|
-
|
|
296
|
+
registerOpenActiveOutputFileAction() {
|
|
297
|
+
const that = this;
|
|
294
298
|
this._register(registerAction2(class extends Action2 {
|
|
295
299
|
constructor() {
|
|
296
300
|
super({
|
|
297
301
|
id: `workbench.action.openActiveLogOutputFile`,
|
|
298
302
|
title: ( localize2WithPath(
|
|
299
303
|
'vs/workbench/contrib/output/browser/output.contribution',
|
|
300
|
-
'
|
|
301
|
-
"Open
|
|
304
|
+
'openActiveOutputFile',
|
|
305
|
+
"Open Output in Editor"
|
|
302
306
|
)),
|
|
303
307
|
menu: [{
|
|
304
308
|
id: MenuId.ViewTitle,
|
|
305
309
|
when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
|
|
306
310
|
group: 'navigation',
|
|
307
|
-
order: 4
|
|
311
|
+
order: 4,
|
|
312
|
+
isHiddenByDefault: true
|
|
308
313
|
}],
|
|
309
314
|
icon: Codicon.goToFile,
|
|
310
|
-
precondition:
|
|
315
|
+
precondition: CONTEXT_ACTIVE_FILE_OUTPUT
|
|
311
316
|
});
|
|
312
317
|
}
|
|
313
|
-
async run(
|
|
314
|
-
|
|
315
|
-
const editorService = accessor.get(IEditorService);
|
|
316
|
-
const fileConfigurationService = accessor.get(IFilesConfigurationService);
|
|
317
|
-
const logFileOutputChannelDescriptor = this.getLogFileOutputChannelDescriptor(outputService);
|
|
318
|
-
if (logFileOutputChannelDescriptor) {
|
|
319
|
-
await fileConfigurationService.updateReadonly(logFileOutputChannelDescriptor.file, true);
|
|
320
|
-
await editorService.openEditor({
|
|
321
|
-
resource: logFileOutputChannelDescriptor.file,
|
|
322
|
-
options: {
|
|
323
|
-
pinned: true,
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
}
|
|
318
|
+
async run() {
|
|
319
|
+
that.openActiveOutoutFile();
|
|
327
320
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
323
|
+
registerOpenActiveOutputFileInAuxWindowAction() {
|
|
324
|
+
const that = this;
|
|
325
|
+
this._register(registerAction2(class extends Action2 {
|
|
326
|
+
constructor() {
|
|
327
|
+
super({
|
|
328
|
+
id: `workbench.action.openActiveLogOutputFileInNewWindow`,
|
|
329
|
+
title: ( localize2WithPath(
|
|
330
|
+
'vs/workbench/contrib/output/browser/output.contribution',
|
|
331
|
+
'openActiveOutputFileInNewWindow',
|
|
332
|
+
"Open Output in New Window"
|
|
333
|
+
)),
|
|
334
|
+
menu: [{
|
|
335
|
+
id: MenuId.ViewTitle,
|
|
336
|
+
when: ( ContextKeyExpr.equals('view', OUTPUT_VIEW_ID)),
|
|
337
|
+
group: 'navigation',
|
|
338
|
+
order: 5,
|
|
339
|
+
isHiddenByDefault: true
|
|
340
|
+
}],
|
|
341
|
+
icon: Codicon.emptyWindow,
|
|
342
|
+
precondition: CONTEXT_ACTIVE_FILE_OUTPUT
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
async run() {
|
|
346
|
+
that.openActiveOutoutFile(AUX_WINDOW_GROUP);
|
|
337
347
|
}
|
|
338
348
|
}));
|
|
339
349
|
}
|
|
350
|
+
async openActiveOutoutFile(group) {
|
|
351
|
+
const fileOutputChannelDescriptor = this.getFileOutputChannelDescriptor();
|
|
352
|
+
if (fileOutputChannelDescriptor) {
|
|
353
|
+
await this.fileConfigurationService.updateReadonly(fileOutputChannelDescriptor.file, true);
|
|
354
|
+
await this.editorService.openEditor({
|
|
355
|
+
resource: fileOutputChannelDescriptor.file,
|
|
356
|
+
options: {
|
|
357
|
+
pinned: true,
|
|
358
|
+
},
|
|
359
|
+
}, group);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
getFileOutputChannelDescriptor() {
|
|
363
|
+
const channel = this.outputService.getActiveChannel();
|
|
364
|
+
if (channel) {
|
|
365
|
+
const descriptor = this.outputService.getChannelDescriptors().filter(c => c.id === channel.id)[0];
|
|
366
|
+
if (descriptor?.file) {
|
|
367
|
+
return descriptor;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
340
372
|
registerShowLogsAction() {
|
|
341
373
|
this._register(registerAction2(class extends Action2 {
|
|
342
374
|
constructor() {
|
|
@@ -456,8 +488,9 @@ let OutputContribution = class OutputContribution extends Disposable {
|
|
|
456
488
|
}
|
|
457
489
|
};
|
|
458
490
|
OutputContribution = ( __decorate([
|
|
459
|
-
( __param(0,
|
|
460
|
-
( __param(1,
|
|
491
|
+
( __param(0, IOutputService)),
|
|
492
|
+
( __param(1, IEditorService)),
|
|
493
|
+
( __param(2, IFilesConfigurationService))
|
|
461
494
|
], OutputContribution));
|
|
462
495
|
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(OutputContribution, 3 );
|
|
463
496
|
( Registry.as(Extensions$2.Configuration)).registerConfiguration({
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import n from '../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = ".monaco-workbench .part.panel>.content .pane-body.output-view .monaco-editor,.monaco-workbench .part.panel>.content .pane-body.output-view .monaco-editor .margin,.monaco-workbench .part.panel>.content .pane-body.output-view .monaco-editor .monaco-editor-background,.monaco-workbench .part.sidebar .output-view .monaco-editor,.monaco-workbench .part.sidebar .output-view .monaco-editor .margin,.monaco-workbench .part.sidebar .output-view .monaco-editor .monaco-editor-background{background-color:var(--vscode-outputView-background)}.monaco-workbench .part.panel>.content .pane-body.output-view .sticky-widget,.monaco-workbench .part.sidebar .output-view .sticky-widget{background-color:var(--vscode-outputViewStickyScroll-background,var(--vscode-panel-background))}";
|
|
4
|
+
n(css,{});
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|
|
@@ -5,12 +5,12 @@ import { Disposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
|
5
5
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
6
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
7
7
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
8
|
-
import { OUTPUT_SCHEME, LOG_MIME, OUTPUT_MIME, ACTIVE_OUTPUT_CHANNEL_CONTEXT,
|
|
8
|
+
import { OUTPUT_SCHEME, LOG_MIME, OUTPUT_MIME, ACTIVE_OUTPUT_CHANNEL_CONTEXT, CONTEXT_ACTIVE_FILE_OUTPUT, Extensions, OUTPUT_VIEW_ID } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
9
9
|
import { OutputLinkProvider } from './outputLinkProvider.js';
|
|
10
10
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
11
11
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
12
12
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
13
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/common/
|
|
13
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
14
14
|
import { IOutputChannelModelService } from 'vscode/vscode/vs/workbench/contrib/output/common/outputChannelModelService';
|
|
15
15
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
16
16
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
@@ -58,7 +58,7 @@ let OutputService = class OutputService extends Disposable {
|
|
|
58
58
|
this.activeOutputChannelContext = ACTIVE_OUTPUT_CHANNEL_CONTEXT.bindTo(contextKeyService);
|
|
59
59
|
this.activeOutputChannelContext.set(this.activeChannelIdInStorage);
|
|
60
60
|
this._register(this.onActiveOutputChannel(channel => this.activeOutputChannelContext.set(channel)));
|
|
61
|
-
this.
|
|
61
|
+
this.activeFileOutputChannelContext = CONTEXT_ACTIVE_FILE_OUTPUT.bindTo(contextKeyService);
|
|
62
62
|
textModelResolverService.registerTextModelContentProvider(OUTPUT_SCHEME, this);
|
|
63
63
|
instantiationService.createInstance(OutputLinkProvider);
|
|
64
64
|
const registry = ( Registry.as(Extensions.OutputChannels));
|
|
@@ -146,7 +146,7 @@ let OutputService = class OutputService extends Disposable {
|
|
|
146
146
|
}
|
|
147
147
|
setActiveChannel(channel) {
|
|
148
148
|
this.activeChannel = channel;
|
|
149
|
-
this.
|
|
149
|
+
this.activeFileOutputChannelContext.set(!!channel?.outputChannelDescriptor?.file);
|
|
150
150
|
if (this.activeChannel) {
|
|
151
151
|
this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, this.activeChannel.id, 1 , 1 );
|
|
152
152
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import './output.css.js';
|
|
2
3
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
4
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
4
5
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
@@ -7,7 +8,7 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
|
|
|
7
8
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
8
9
|
import { AbstractTextResourceEditor } from 'vscode/vscode/vs/workbench/browser/parts/editor/textResourceEditor';
|
|
9
10
|
import { CONTEXT_OUTPUT_SCROLL_LOCK, OUTPUT_VIEW_ID, CONTEXT_IN_OUTPUT } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
10
|
-
import {
|
|
11
|
+
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
11
12
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
12
13
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
13
14
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
@@ -17,8 +18,6 @@ import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/brows
|
|
|
17
18
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
18
19
|
import { TextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
|
|
19
20
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
20
|
-
import { SIDE_BAR_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
21
|
-
import { editorBackground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
22
21
|
import { Dimension } from 'vscode/vscode/vs/base/browser/dom';
|
|
23
22
|
import { createCancelablePromise } from 'vscode/vscode/vs/base/common/async';
|
|
24
23
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
@@ -220,17 +219,5 @@ OutputEditor = ( __decorate([
|
|
|
220
219
|
( __param(8, IFileService)),
|
|
221
220
|
( __param(9, IContextKeyService))
|
|
222
221
|
], OutputEditor));
|
|
223
|
-
registerThemingParticipant((theme, collector) => {
|
|
224
|
-
const sidebarBackground = theme.getColor(SIDE_BAR_BACKGROUND);
|
|
225
|
-
if (sidebarBackground && sidebarBackground !== theme.getColor(editorBackground)) {
|
|
226
|
-
collector.addRule(`
|
|
227
|
-
.monaco-workbench .part.sidebar .output-view .monaco-editor,
|
|
228
|
-
.monaco-workbench .part.sidebar .output-view .monaco-editor .margin,
|
|
229
|
-
.monaco-workbench .part.sidebar .output-view .monaco-editor .monaco-editor-background {
|
|
230
|
-
background-color: ${sidebarBackground};
|
|
231
|
-
}
|
|
232
|
-
`);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
222
|
|
|
236
223
|
export { OutputViewPane };
|