Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions src/vs/sessions/contrib/logs/browser/logs.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@

import { Codicon } from '../../../../base/common/codicons.js';
import { localize, localize2 } from '../../../../nls.js';
import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js';
import { SessionsCategories } from '../../../common/categories.js';
import { IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
import { ViewPaneContainer } from '../../../../workbench/browser/parts/views/viewPaneContainer.js';
import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../../workbench/common/contributions.js';
import { IViewContainersRegistry, IViewsRegistry, ViewContainerLocation, Extensions as ViewContainerExtensions, WindowVisibility } from '../../../../workbench/common/views.js';
import { OutputViewPane } from '../../../../workbench/contrib/output/browser/outputView.js';
import { OUTPUT_VIEW_ID } from '../../../../workbench/services/output/common/output.js';
import { IViewsService } from '../../../../workbench/services/views/common/viewsService.js';

const SESSIONS_LOGS_CONTAINER_ID = 'workbench.sessions.panel.logsContainer';

const CONTEXT_SESSIONS_SHOW_LOGS = new RawContextKey<boolean>('sessionsShowLogs', false);

const logsViewIcon = registerIcon('sessions-logs-view-icon', Codicon.output, localize('sessionsLogsViewIcon', 'View icon of the logs view in the sessions window.'));

class RegisterLogsViewContainerContribution implements IWorkbenchContribution {
Expand All @@ -32,7 +26,6 @@ class RegisterLogsViewContainerContribution implements IWorkbenchContribution {
constructor(
@IContextKeyService contextKeyService: IContextKeyService,
) {
Comment on lines 8 to 28
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IContextKeyService is no longer used (the context key gating was removed), but the constructor still injects it. With noUnusedParameters enabled, this will cause a compile error. Remove the @IContextKeyService contextKeyService parameter (and the import) or actually use it.

Copilot uses AI. Check for mistakes.
CONTEXT_SESSIONS_SHOW_LOGS.bindTo(contextKeyService).set(true);
const viewContainerRegistry = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry);
const viewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry);

Expand Down Expand Up @@ -66,28 +59,9 @@ class RegisterLogsViewContainerContribution implements IWorkbenchContribution {
ctorDescriptor: new SyncDescriptor(OutputViewPane),
canToggleVisibility: true,
canMoveView: false,
when: CONTEXT_SESSIONS_SHOW_LOGS,
windowVisibility: WindowVisibility.Sessions,
}], logsViewContainer);
Comment on lines 59 to 63
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment just above this view registration says it is registered “with a when context”, but the when condition was removed in this change. Please update/remove that comment so it matches the current behavior.

Copilot uses AI. Check for mistakes.
}
}

registerWorkbenchContribution2(RegisterLogsViewContainerContribution.ID, RegisterLogsViewContainerContribution, WorkbenchPhase.BlockStartup);

// Command: Sessions: Show Logs
registerAction2(class extends Action2 {
constructor() {
super({
id: 'workbench.sessions.action.showLogs',
title: localize2('sessionsShowLogs', "Show Logs"),
category: SessionsCategories.Sessions,
f1: true,
});
}
async run(accessor: ServicesAccessor): Promise<void> {
const contextKeyService = accessor.get(IContextKeyService);
const viewsService = accessor.get(IViewsService);
CONTEXT_SESSIONS_SHOW_LOGS.bindTo(contextKeyService).set(true);
await viewsService.openView(OUTPUT_VIEW_ID, true);
}
});
Loading