We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我使用示例仓库 增加了几个菜单
import {Autowired} from '@opensumi/di'; import {CommandContribution, CommandRegistry, CommandService, Domain} from '@opensumi/ide-core-browser'; import {IMenuRegistry, MenuContribution} from '@opensumi/ide-core-browser/lib/menu/next';
const TESTCOMMAND = { id: 'ttttttt', }
@Domain(CommandContribution, MenuContribution) export class RegisterMenuContribution implements CommandContribution, MenuContribution {
@Autowired(CommandService) private readonly commandService: CommandService; registerMenus(registry: IMenuRegistry): void { // 在 Menubar 区域注册一个新的菜单 registry.registerMenubarItem("TestMenuBarId", { label: 'OpenSumi', order: 0 }); // 注册二级菜单 const SubMenuId = 'test/next'; registry.registerMenuItem("TestMenuBarId", { submenu: SubMenuId, label: 'Hover Me', group: '1_second', }); } registerCommands(commands: CommandRegistry): void { commands.registerCommand( {id: TESTCOMMAND.id}, { execute: () => { console.log('test command') }, }) // 解绑 重命名命令 commands.unregisterCommand('terminal.split') commands.registerCommand({id: 'terminal.split'}) this.commandService.executeCommand(TESTCOMMAND.id) }
}
引入
@Injectable() export class StartupModule extends BrowserModule { providers: Provider[] = [AlexAppContribution, RegisterMenuContribution]; }
npm run code 无法 展开第二个菜单
The text was updated successfully, but these errors were encountered:
貌似需要加上label: 'Test Command' 这个属性才可以 示例仓库里的registerMenu.ts 是不是有点问题
Sorry, something went wrong.
No branches or pull requests
我使用示例仓库 增加了几个菜单
import {Autowired} from '@opensumi/di';
import {CommandContribution, CommandRegistry, CommandService, Domain} from '@opensumi/ide-core-browser';
import {IMenuRegistry, MenuContribution} from '@opensumi/ide-core-browser/lib/menu/next';
const TESTCOMMAND = {
id: 'ttttttt',
}
@Domain(CommandContribution, MenuContribution)
export class RegisterMenuContribution implements CommandContribution, MenuContribution {
}
引入
@Injectable()
export class StartupModule extends BrowserModule {
providers: Provider[] = [AlexAppContribution, RegisterMenuContribution];
}
npm run code
无法 展开第二个菜单
The text was updated successfully, but these errors were encountered: