提交 49f6e513 编写于 作者: B Benjamin Pasero

debt - add some logging for #79460

上级 0a9ef2ad
...@@ -13,7 +13,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; ...@@ -13,7 +13,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IUpdateService, StateType } from 'vs/platform/update/common/update'; import { IUpdateService, StateType } from 'vs/platform/update/common/update';
import product from 'vs/platform/product/node/product'; import product from 'vs/platform/product/node/product';
import { RunOnceScheduler } from 'vs/base/common/async'; import { RunOnceScheduler } from 'vs/base/common/async';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log';
import { mnemonicMenuLabel as baseMnemonicLabel } from 'vs/base/common/labels'; import { mnemonicMenuLabel as baseMnemonicLabel } from 'vs/base/common/labels';
import { IWindowsMainService, IWindowsCountChangedEvent } from 'vs/platform/windows/electron-main/windows'; import { IWindowsMainService, IWindowsCountChangedEvent } from 'vs/platform/windows/electron-main/windows';
import { IHistoryMainService } from 'vs/platform/history/common/history'; import { IHistoryMainService } from 'vs/platform/history/common/history';
...@@ -62,14 +62,14 @@ export class Menubar { ...@@ -62,14 +62,14 @@ export class Menubar {
constructor( constructor(
@IUpdateService private readonly updateService: IUpdateService, @IUpdateService private readonly updateService: IUpdateService,
@IInstantiationService instantiationService: IInstantiationService,
@IConfigurationService private readonly configurationService: IConfigurationService, @IConfigurationService private readonly configurationService: IConfigurationService,
@IWindowsMainService private readonly windowsMainService: IWindowsMainService, @IWindowsMainService private readonly windowsMainService: IWindowsMainService,
@IEnvironmentService private readonly environmentService: IEnvironmentService, @IEnvironmentService private readonly environmentService: IEnvironmentService,
@ITelemetryService private readonly telemetryService: ITelemetryService, @ITelemetryService private readonly telemetryService: ITelemetryService,
@IHistoryMainService private readonly historyMainService: IHistoryMainService, @IHistoryMainService private readonly historyMainService: IHistoryMainService,
@IStateService private readonly stateService: IStateService, @IStateService private readonly stateService: IStateService,
@ILifecycleService private readonly lifecycleService: ILifecycleService @ILifecycleService private readonly lifecycleService: ILifecycleService,
@ILogService private readonly logService: ILogService
) { ) {
this.menuUpdater = new RunOnceScheduler(() => this.doUpdateMenu(), 0); this.menuUpdater = new RunOnceScheduler(() => this.doUpdateMenu(), 0);
...@@ -714,6 +714,8 @@ export class Menubar { ...@@ -714,6 +714,8 @@ export class Menubar {
} }
if (activeWindow) { if (activeWindow) {
this.logService.trace('menubar#runActionInRenderer', invocation);
if (isMacintosh && !this.environmentService.isBuilt && !activeWindow.isReady) { if (isMacintosh && !this.environmentService.isBuilt && !activeWindow.isReady) {
if ((invocation.type === 'commandId' && invocation.commandId === 'workbench.action.toggleDevTools') || (invocation.type !== 'commandId' && invocation.userSettingsLabel === 'alt+cmd+i')) { if ((invocation.type === 'commandId' && invocation.commandId === 'workbench.action.toggleDevTools') || (invocation.type !== 'commandId' && invocation.userSettingsLabel === 'alt+cmd+i')) {
// prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719) // prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719)
...@@ -724,10 +726,12 @@ export class Menubar { ...@@ -724,10 +726,12 @@ export class Menubar {
} }
if (invocation.type === 'commandId') { if (invocation.type === 'commandId') {
this.windowsMainService.sendToFocused('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest); activeWindow.sendWhenReady('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest);
} else { } else {
this.windowsMainService.sendToFocused('vscode:runKeybinding', { userSettingsLabel: invocation.userSettingsLabel } as IRunKeybindingInWindowRequest); activeWindow.sendWhenReady('vscode:runKeybinding', { userSettingsLabel: invocation.userSettingsLabel } as IRunKeybindingInWindowRequest);
} }
} else {
this.logService.trace('menubar#runActionInRenderer: no active window found', invocation);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册