diff --git a/src/vs/workbench/contrib/output/browser/output.contribution.ts b/src/vs/workbench/contrib/output/browser/output.contribution.ts index 722776ae86f..58d802b533d 100644 --- a/src/vs/workbench/contrib/output/browser/output.contribution.ts +++ b/src/vs/workbench/contrib/output/browser/output.contribution.ts @@ -10,7 +10,7 @@ import { Registry } from '../../../../platform/registry/common/platform.js'; import { MenuId, registerAction2, Action2, MenuRegistry } from '../../../../platform/actions/common/actions.js'; import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; import { OutputService } from './outputServices.js'; -import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_MODE_ID, LOG_MIME, CONTEXT_ACTIVE_FILE_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, IOutputChannelDescriptor, IFileOutputChannelDescriptor, ACTIVE_OUTPUT_CHANNEL_CONTEXT, CONTEXT_ACTIVE_OUTPUT_LEVEL_SETTABLE, IOutputChannelRegistry, Extensions, CONTEXT_ACTIVE_OUTPUT_LEVEL, CONTEXT_ACTIVE_OUTPUT_LEVEL_IS_DEFAULT, SHOW_INFO_FILTER_CONTEXT, SHOW_TRACE_FILTER_CONTEXT, SHOW_DEBUG_FILTER_CONTEXT, SHOW_ERROR_FILTER_CONTEXT, SHOW_WARNING_FILTER_CONTEXT, OUTPUT_FILTER_FOCUS_CONTEXT, CONTEXT_ACTIVE_LOG_FILE_OUTPUT } from '../../../services/output/common/output.js'; +import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_VIEW_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_MODE_ID, LOG_MIME, CONTEXT_OUTPUT_SCROLL_LOCK, IOutputChannelDescriptor, IFileOutputChannelDescriptor, ACTIVE_OUTPUT_CHANNEL_CONTEXT, CONTEXT_ACTIVE_OUTPUT_LEVEL_SETTABLE, IOutputChannelRegistry, Extensions, CONTEXT_ACTIVE_OUTPUT_LEVEL, CONTEXT_ACTIVE_OUTPUT_LEVEL_IS_DEFAULT, SHOW_INFO_FILTER_CONTEXT, SHOW_TRACE_FILTER_CONTEXT, SHOW_DEBUG_FILTER_CONTEXT, SHOW_ERROR_FILTER_CONTEXT, SHOW_WARNING_FILTER_CONTEXT, OUTPUT_FILTER_FOCUS_CONTEXT, CONTEXT_ACTIVE_LOG_FILE_OUTPUT } from '../../../services/output/common/output.js'; import { OutputViewPane } from './outputView.js'; import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from '../../../common/contributions.js'; @@ -99,7 +99,6 @@ class OutputContribution extends Disposable implements IWorkbenchContribution { constructor( @IOutputService private readonly outputService: IOutputService, @IEditorService private readonly editorService: IEditorService, - @IFilesConfigurationService private readonly fileConfigurationService: IFilesConfigurationService, ) { super(); this.registerActions(); @@ -368,11 +367,10 @@ class OutputContribution extends Disposable implements IWorkbenchContribution { isHiddenByDefault: true }], icon: Codicon.goToFile, - precondition: CONTEXT_ACTIVE_FILE_OUTPUT }); } async run(): Promise { - that.openActiveOutputFile(); + that.openActiveOutput(); } })); } @@ -392,11 +390,10 @@ class OutputContribution extends Disposable implements IWorkbenchContribution { isHiddenByDefault: true }], icon: Codicon.emptyWindow, - precondition: CONTEXT_ACTIVE_FILE_OUTPUT }); } async run(): Promise { - that.openActiveOutputFile(AUX_WINDOW_GROUP); + that.openActiveOutput(AUX_WINDOW_GROUP); } })); } @@ -426,12 +423,11 @@ class OutputContribution extends Disposable implements IWorkbenchContribution { })); } - private async openActiveOutputFile(group?: AUX_WINDOW_GROUP_TYPE): Promise { - const fileOutputChannelDescriptor = this.getFileOutputChannelDescriptor(); - if (fileOutputChannelDescriptor) { - await this.fileConfigurationService.updateReadonly(fileOutputChannelDescriptor.files[0], true); + private async openActiveOutput(group?: AUX_WINDOW_GROUP_TYPE): Promise { + const channel = this.outputService.getActiveChannel(); + if (channel) { await this.editorService.openEditor({ - resource: fileOutputChannelDescriptor.files[0], + resource: channel.uri, options: { pinned: true, }, diff --git a/src/vs/workbench/contrib/output/electron-sandbox/output.contribution.ts b/src/vs/workbench/contrib/output/electron-sandbox/output.contribution.ts deleted file mode 100644 index 9790ff104b9..00000000000 --- a/src/vs/workbench/contrib/output/electron-sandbox/output.contribution.ts +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Codicon } from '../../../../base/common/codicons.js'; -import { Schemas } from '../../../../base/common/network.js'; -import { ServicesAccessor } from '../../../../editor/browser/editorExtensions.js'; -import { localize2 } from '../../../../nls.js'; -import { registerAction2, Action2, MenuId } from '../../../../platform/actions/common/actions.js'; -import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; -import { IsMacNativeContext } from '../../../../platform/contextkey/common/contextkeys.js'; -import { INativeHostService } from '../../../../platform/native/common/native.js'; -import { OUTPUT_VIEW_ID, CONTEXT_ACTIVE_FILE_OUTPUT, IOutputService } from '../../../services/output/common/output.js'; - - -registerAction2(class OpenInConsoleAction extends Action2 { - constructor() { - super({ - id: `workbench.action.openActiveLogOutputFileNative`, - title: localize2('openActiveOutputFileNative', "Open Output in Console"), - menu: [{ - id: MenuId.ViewTitle, - when: ContextKeyExpr.and(ContextKeyExpr.equals('view', OUTPUT_VIEW_ID), IsMacNativeContext), - group: 'navigation', - order: 6, - isHiddenByDefault: true - }], - icon: Codicon.goToFile, - precondition: ContextKeyExpr.and(CONTEXT_ACTIVE_FILE_OUTPUT, IsMacNativeContext) - }); - } - - async run(accessor: ServicesAccessor): Promise { - const outputService = accessor.get(IOutputService); - const hostService = accessor.get(INativeHostService); - const channel = outputService.getActiveChannel(); - if (!channel) { - return; - } - const descriptor = outputService.getChannelDescriptors().find(c => c.id === channel.id); - if (descriptor?.files?.length === 1 && descriptor.files[0].scheme === Schemas.file) { - hostService.openExternal(descriptor.files[0].toString(true), 'open'); - } - } -}); diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index 755d3c95beb..6cb01c72874 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -127,9 +127,6 @@ import './contrib/remote/electron-sandbox/remote.contribution.js'; // Configuration Exporter import './contrib/configExporter/electron-sandbox/configurationExportHelper.contribution.js'; -// Output View -import './contrib/output/electron-sandbox/output.contribution.js'; - // Terminal import './contrib/terminal/electron-sandbox/terminal.contribution.js';