Skip to content

vscode.executeCodeActionProvider results seem to be missing their command property #45124

@DanTup

Description

@DanTup

I have a code action provider that returns code actions like this:

private convertResult(document: TextDocument, change: as.SourceChange): CodeAction {
	const title = change.message;
	return {
		command: {
			arguments: [document, change],
			command: "_dart.applySourceChange",
			title,
		},
		kind: CodeActionKind.Empty.append(change.id),
		title,
	};
}

In a contributed tree I call vscode.executeCodeActionProvider and filter to the CodeActions that have kinds:

const fixes = (await vs.commands.executeCommand(
	"vscode.executeCodeActionProvider",
	this.activeEditor.document.uri,
	range,
)) as Array<vs.Command | vs.CodeAction>;

However when I inspect the returned values, the (outer) command property is missing. I need this in order to invoke the code action.

(cc @mjbvz - not sure if maybe this is related to new CodeAction stuff?)

Metadata

Metadata

Assignees

Labels

apibugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions