Skip to content
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

fix: in web ide menu does not display; in web ide shortcut keys are not available #4160

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions packages/core-browser/src/common/common.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export class ClientCommonContribution

constructor() {
const overridePropertiesDefault = {
'application.supportsOpenFolder': !!this.appConfig.isElectronRenderer && !this.appConfig.isRemote,
'application.supportsOpenWorkspace': !!this.appConfig.isElectronRenderer && !this.appConfig.isRemote,
'application.supportsOpenFolder': !this.appConfig.isRemote,
Copy link
Member

Choose a reason for hiding this comment

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

在 Web 环境下这两个功能的表现是什么样的,贴张图

'application.supportsOpenWorkspace': !this.appConfig.isRemote,
'debug.toolbar.top': this.appConfig.isElectronRenderer ? 0 : this.layoutViewSize.menubarHeight,
};
const keys = Object.keys(this.schema.properties);
Expand Down
8 changes: 8 additions & 0 deletions packages/core-browser/src/keybinding/keybinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ContextKeyExpression } from '@opensumi/monaco-editor-core/esm/vs/platfo
import { IContextKeyService } from '../context-key';
import { KeyboardLayoutService } from '../keyboard/keyboard-layout-service';
import { Key, KeyCode, KeySequence, SpecialCases } from '../keyboard/keys';
import { AppConfig } from '../react-providers/config-provider';
import { IStatusBarService, StatusBarAlignment } from '../services';

export enum KeybindingScope {
Expand Down Expand Up @@ -230,6 +231,9 @@ export class KeybindingRegistryImpl implements KeybindingRegistry, KeybindingSer
@Autowired(IStatusBarService)
protected readonly statusBar: IStatusBarService;

@Autowired(AppConfig)
private readonly appConfig: AppConfig;

public async initialize(): Promise<void> {
await this.keyboardLayoutService.initialize();
this.keyboardLayoutService.onKeyboardLayoutChanged(() => {
Expand Down Expand Up @@ -883,6 +887,10 @@ export class KeybindingRegistryImpl implements KeybindingRegistry, KeybindingSer
return false;
}
for (const binding of bindings) {
// 在web下electron绑定的浏览器基础快捷键无法使用,这里跳过,直接使用浏览器的快捷键
if (!this.appConfig.isElectronRenderer && binding.command.startsWith('electron.')) {
continue;
}
if (this.isEnabled(binding, event)) {
if (this.isPseudoCommand(binding.command)) {
// 让事件冒泡
Expand Down
Loading