Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DanTup opened this issue Mar 6, 2018 · 7 comments
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@DanTup
Copy link
Contributor

DanTup commented Mar 6, 2018

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?)

@vscodebot
Copy link

vscodebot bot commented Mar 6, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 6, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug api labels Mar 6, 2018
@jrieken jrieken added this to the March 2018 milestone Mar 6, 2018
@jrieken
Copy link
Member

jrieken commented Mar 6, 2018

Yeah, that's an oversight when receiving the result

@DanTup
Copy link
Contributor Author

DanTup commented Mar 6, 2018

@jrieken Can you think of any reasonable workaround I could use in the meantime?

@jrieken
Copy link
Member

jrieken commented Mar 6, 2018

Not really... But I'll push a fix in a minute

@jrieken jrieken closed this as completed in 18b94d0 Mar 6, 2018
@DanTup
Copy link
Contributor Author

DanTup commented Mar 6, 2018

@jrieken Is it too late for this in 1.21?

@jrieken
Copy link
Member

jrieken commented Mar 6, 2018

Yeah, I will cherry-pick the change to the release-branch. We have just release an 1.21 candidate as current insiders and this will likely go into an insiders-build this afternoon

jrieken added a commit that referenced this issue Mar 6, 2018
@jrieken jrieken modified the milestones: March 2018, February 2018 Mar 6, 2018
@DanTup
Copy link
Contributor Author

DanTup commented Mar 6, 2018

@jrieken Perfect - thanks very much!

DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 8, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 14, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 16, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 22, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 26, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 26, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 28, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Mar 29, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Apr 2, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Apr 2, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Apr 2, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
DanTup added a commit to Dart-Code/Dart-Code that referenced this issue Apr 16, 2018
Currently doesn't work because we're missing the commands
(microsoft/vscode#45124).

See #605.
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants