Skip to content

Commit 16ad3d4

Browse files
authored
1 parent c767250 commit 16ad3d4

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

src/vs/workbench/contrib/output/browser/output.contribution.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { ViewContainer, IViewContainersRegistry, ViewContainerLocation, Extensio
2020
import { IViewsService } from 'vs/workbench/services/views/common/viewsService';
2121
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
2222
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
23-
import { IQuickPickItem, IQuickInputService, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
23+
import { IQuickPickItem, IQuickInputService, IQuickPickSeparator, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';
2424
import { AUX_WINDOW_GROUP, AUX_WINDOW_GROUP_TYPE, IEditorService } from 'vs/workbench/services/editor/common/editorService';
2525
import { assertIsDefined } from 'vs/base/common/types';
2626
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
@@ -408,16 +408,30 @@ class OutputContribution extends Disposable implements IWorkbenchContribution {
408408
const editorService = accessor.get(IEditorService);
409409
const fileConfigurationService = accessor.get(IFilesConfigurationService);
410410

411-
const entries: IOutputChannelQuickPickItem[] = outputService.getChannelDescriptors().filter(c => c.file && c.log)
412-
.map(channel => (<IOutputChannelQuickPickItem>{ id: channel.id, label: channel.label, channel }));
413-
414-
const argName = args && typeof args === 'string' ? args : undefined;
415411
let entry: IOutputChannelQuickPickItem | undefined;
416-
if (argName) {
417-
entry = entries.find(e => e.id === argName);
412+
const argName = args && typeof args === 'string' ? args : undefined;
413+
const extensionChannels: IOutputChannelQuickPickItem[] = [];
414+
const coreChannels: IOutputChannelQuickPickItem[] = [];
415+
for (const c of outputService.getChannelDescriptors()) {
416+
if (c.file && c.log) {
417+
const e = { id: c.id, label: c.label, channel: c };
418+
if (c.extensionId) {
419+
extensionChannels.push(e);
420+
} else {
421+
coreChannels.push(e);
422+
}
423+
if (e.id === argName) {
424+
entry = e;
425+
}
426+
}
418427
}
419428
if (!entry) {
420-
entry = await quickInputService.pick(entries, { placeHolder: nls.localize('selectlogFile', "Select Log File") });
429+
const entries: QuickPickInput[] = [...extensionChannels.sort((a, b) => a.label.localeCompare(b.label))];
430+
if (entries.length && coreChannels.length) {
431+
entries.push({ type: 'separator' });
432+
entries.push(...coreChannels.sort((a, b) => a.label.localeCompare(b.label)));
433+
}
434+
entry = <IOutputChannelQuickPickItem | undefined>await quickInputService.pick(entries, { placeHolder: nls.localize('selectlogFile', "Select Log File") });
421435
}
422436
if (entry) {
423437
const resource = assertIsDefined(entry.channel.file);

0 commit comments

Comments
 (0)