-
Notifications
You must be signed in to change notification settings - Fork 38.2k
show logs by default #298916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1
−27
Merged
show logs by default #298916
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 { | ||
|
|
@@ -32,7 +26,6 @@ class RegisterLogsViewContainerContribution implements IWorkbenchContribution { | |
| constructor( | ||
| @IContextKeyService contextKeyService: IContextKeyService, | ||
| ) { | ||
| CONTEXT_SESSIONS_SHOW_LOGS.bindTo(contextKeyService).set(true); | ||
| const viewContainerRegistry = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry); | ||
| const viewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry); | ||
|
|
||
|
|
@@ -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
|
||
| } | ||
| } | ||
|
|
||
| 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); | ||
| } | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IContextKeyServiceis no longer used (the context key gating was removed), but the constructor still injects it. WithnoUnusedParametersenabled, this will cause a compile error. Remove the@IContextKeyService contextKeyServiceparameter (and the import) or actually use it.