未验证 提交 c0028a2b 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #133335 from CGNonofr/monaco-resolve-code-action

Add resolveCodeAction to monaco registerCodeActionProvider
......@@ -467,7 +467,8 @@ export function registerCodeActionProvider(languageId: string, provider: CodeAct
return Range.areIntersectingOrTouching(m, range);
});
return provider.provideCodeActions(model, range, { markers, only: context.only }, token);
}
},
resolveCodeAction: provider.resolveCodeAction
});
}
......@@ -588,6 +589,11 @@ export interface CodeActionProvider {
* Provide commands for the given document and range.
*/
provideCodeActions(model: model.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): modes.ProviderResult<modes.CodeActionList>;
/**
* Given a code action fill in the edit. Will only invoked when missing.
*/
resolveCodeAction?(codeAction: modes.CodeAction, token: CancellationToken): modes.ProviderResult<modes.CodeAction>;
}
......
......@@ -5477,6 +5477,10 @@ declare namespace monaco.languages {
* Provide commands for the given document and range.
*/
provideCodeActions(model: editor.ITextModel, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<CodeActionList>;
/**
* Given a code action fill in the edit. Will only invoked when missing.
*/
resolveCodeAction?(codeAction: CodeAction, token: CancellationToken): ProviderResult<CodeAction>;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册