在摩纳哥注册语言命令
Register Language Commands in Monaco
在 Monaco 文档中,确切地说:在 CompletionItem, there is a property called command 中(描述:接受此项目后应为 运行 的命令。)。
我的问题:如果可能的话,我应该在哪里注册这些命令?
此致。
通过 github 问题询问后,这是解决方案,请参阅:#1025
(editor as any)._commandService.addCommand({
id: "command-id",
handler: (_: any, ...args: any[]) => {
//DO WHAT NEEDED
return null;
},
});
在 Monaco 文档中,确切地说:在 CompletionItem, there is a property called command 中(描述:接受此项目后应为 运行 的命令。)。 我的问题:如果可能的话,我应该在哪里注册这些命令?
此致。
通过 github 问题询问后,这是解决方案,请参阅:#1025
(editor as any)._commandService.addCommand({
id: "command-id",
handler: (_: any, ...args: any[]) => {
//DO WHAT NEEDED
return null;
},
});