mirror of
https://github.com/Microsoft/vscode
synced 2024-09-14 06:08:12 +00:00
fix #45124
This commit is contained in:
parent
bde23fb906
commit
18b94d09a6
|
@ -418,6 +418,9 @@ export class ExtHostApiCommands {
|
||||||
if (codeAction.edit) {
|
if (codeAction.edit) {
|
||||||
ret.edit = typeConverters.WorkspaceEdit.to(codeAction.edit);
|
ret.edit = typeConverters.WorkspaceEdit.to(codeAction.edit);
|
||||||
}
|
}
|
||||||
|
if (codeAction.command) {
|
||||||
|
ret.command = this._commands.converter.fromInternal(codeAction.command);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -400,6 +400,35 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('vscode.executeCodeActionProvider results seem to be missing their `command` property #45124', function () {
|
||||||
|
disposables.push(extHost.registerCodeActionProvider(defaultSelector, {
|
||||||
|
provideCodeActions(document, range): vscode.CodeAction[] {
|
||||||
|
return [{
|
||||||
|
command: {
|
||||||
|
arguments: [document, range],
|
||||||
|
command: 'command',
|
||||||
|
title: 'command_title',
|
||||||
|
},
|
||||||
|
kind: types.CodeActionKind.Empty.append('foo'),
|
||||||
|
title: 'title',
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
return rpcProtocol.sync().then(() => {
|
||||||
|
return commands.executeCommand<vscode.CodeAction[]>('vscode.executeCodeActionProvider', model.uri, new types.Range(0, 0, 1, 1)).then(value => {
|
||||||
|
assert.equal(value.length, 1);
|
||||||
|
let [first] = value;
|
||||||
|
assert.ok(first.command);
|
||||||
|
assert.equal(first.command.command, 'command');
|
||||||
|
assert.equal(first.command.title, 'command_title');
|
||||||
|
assert.equal(first.kind.value, 'foo');
|
||||||
|
assert.equal(first.title, 'title');
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// --- code lens
|
// --- code lens
|
||||||
|
|
||||||
test('CodeLens, back and forth', function () {
|
test('CodeLens, back and forth', function () {
|
||||||
|
|
Loading…
Reference in a new issue