diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index 67e9ba8669e219ce3634ed21b1d5c1ee698dce8a..f671ebd74bdd02c35df7320b97ddac095c020c48 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -86,7 +86,7 @@ const newCommands: ApiCommand[] = [ new ApiCommand( 'vscode.prepareCallHierarchy', '_executePrepareCallHierarchy', 'Prepare call hierarchy at a position inside a document', [ApiCommandArgument.Uri, ApiCommandArgument.Position], - new ApiCommandResult('A CallHierarchyItem or undefined', v => typeConverters.CallHierarchyItem.to(v)) + new ApiCommandResult('A CallHierarchyItem or undefined', v => v.map(typeConverters.CallHierarchyItem.to)) ), new ApiCommand( 'vscode.provideIncomingCalls', '_executeProvideIncomingCalls', 'Compute incoming calls for an item', diff --git a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.ts b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.ts index cad37346668acccf3f3c9f3d0678a70540bcb969..ccfe87251953ff33c4270ac932ab0622fe79b3b9 100644 --- a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.ts +++ b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.ts @@ -172,7 +172,7 @@ CommandsRegistry.registerCommand('_executePrepareCallHierarchy', async (accessor _models.delete(key); } }); - return model.root; + return [model.root]; } finally { dispose(textModelReference); 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 99d627ed5592d9329d786f778977ebdb03991d2a..f10a77afa63cfd54a1b688a42d8ad0f2f4de9831 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -885,16 +885,17 @@ suite('ExtHostLanguageFeatureCommands', function () { await rpcProtocol.sync(); - const root = await commands.executeCommand('vscode.prepareCallHierarchy', model.uri, new types.Position(0, 0)); + const root = await commands.executeCommand('vscode.prepareCallHierarchy', model.uri, new types.Position(0, 0)); - assert.ok(root); - assert.equal(root.name, 'ROOT'); + assert.ok(Array.isArray(root)); + assert.equal(root.length, 1); + assert.equal(root[0].name, 'ROOT'); - const incoming = await commands.executeCommand('vscode.provideIncomingCalls', root); + const incoming = await commands.executeCommand('vscode.provideIncomingCalls', root[0]); assert.equal(incoming.length, 1); assert.equal(incoming[0].from.name, 'INCOMING'); - const outgoing = await commands.executeCommand('vscode.provideOutgoingCalls', root); + const outgoing = await commands.executeCommand('vscode.provideOutgoingCalls', root[0]); assert.equal(outgoing.length, 1); assert.equal(outgoing[0].to.name, 'OUTGOING'); });