简体   繁体   English

在摩纳哥注册语言命令

[英]Register Language Commands in Monaco

In the Monaco documentation, exact: in CompletionItem , there is a property called command (Description: A command that should be run upon acceptance of this item.). 在摩纳哥文档中,确切的是:在CompletionItem中 ,有一个称为command的属性(描述:接受此项目后应运行的命令。)。 My question: where do i register these commands, if possible with a handler? 我的问题:如果可以的话,我应该在哪里注册这些命令?

Regards. 问候。

After asking through a github issue, this is the solution, see: #1025 在通过github问题询问之后,这是解决方案,请参阅: #1025

(editor as any)._commandService.addCommand({ 
    id: "command-id", 
    handler: (_: any, ...args: any[]) => {
                    //DO WHAT NEEDED
        return null;
    },
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM