提交 b3b483a1 编写于 作者: M Matt Bierner

Don't retrigger empty code actions menu

Fixes #74649
上级 483e48d8
......@@ -27,12 +27,18 @@ export class CodeActionContextMenu {
private readonly _onApplyCodeAction: (action: CodeAction) => Promise<any>
) { }
async show(actionsToShow: Promise<CodeActionSet>, at?: { x: number; y: number } | Position): Promise<void> {
public async show(actionsToShow: Promise<CodeActionSet>, at?: { x: number; y: number } | Position): Promise<void> {
const codeActions = await actionsToShow;
if (!codeActions.actions.length) {
this._visible = false;
return;
}
if (!this._editor.getDomNode()) {
// cancel when editor went off-dom
this._visible = false;
return Promise.reject(canceled());
}
this._visible = true;
const actions = codeActions.actions.map(action => this.codeActionToAction(action));
this._contextMenuService.showContextMenu({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册