Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Rieken <johannes.rieken@gmail.com>2018-03-06 13:39:16 +0300
committerJohannes Rieken <johannes.rieken@gmail.com>2018-03-06 13:49:42 +0300
commita903bd38fbe9006c076d218ff69fe1ee0160f815 (patch)
treeb946410bd3c5982268e197cf0b3e2b5ae25becd2
parent1035348c4f9128ca9b982ba722913e81e52f2d42 (diff)
fix #45124
-rw-r--r--src/vs/workbench/api/node/extHostApiCommands.ts3
-rw-r--r--src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts29
2 files changed, 32 insertions, 0 deletions
diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts
index 010286e9672..2b00ff6d9f6 100644
--- a/src/vs/workbench/api/node/extHostApiCommands.ts
+++ b/src/vs/workbench/api/node/extHostApiCommands.ts
@@ -418,6 +418,9 @@ export class ExtHostApiCommands {
if (codeAction.edit) {
ret.edit = typeConverters.WorkspaceEdit.to(codeAction.edit);
}
+ if (codeAction.command) {
+ ret.command = this._commands.converter.fromInternal(codeAction.command);
+ }
return ret;
}
});
diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
index b11c79a035a..90ac6be2310 100644
--- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
+++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts
@@ -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
test('CodeLens, back and forth', function () {