In my VS Code Extension I would like the opening and closing parentheses to be inserted automatically after a function is selected from the list provided by the completion item provider.

After the parentheses are added, I would like the extension to trigger the signature help provider (note that VS Code triggers the signature help provider when you manually type the opening parenthesis `(`.

Here's a snippet of what I've added inside the `provideCompletionItems` method:

```js
myFunctions.forEach((func) => {
    const completion = new CompletionItem(func, CompletionItemKind.Function);
    completion.detail = func.signature;
    completion.documentation = func.description;
    completion.insertText = func + '(';
    ...
});

```

I am aware that I can execute a command after inserting a completion by adding something like

```js
completion.command = ...

```

The VS Code Extension API has [`vscode.executeSignatureHelpProvider`](https://code.visualstudio.com/api/references/commands) as a built-in command to execute the Signature Help Provider. Thus, I would run this command like this:

```js
vscode.commands.executeCommand('vscode.executeSignatureHelpProvider', document.uri, position)

```

However, I don't know how to run this command as part of the `command` variable, meaning that I can't do

```js
completion.command = vscode.commands.executeCommand('vscode.executeSignatureHelpProvider', document.uri, position)

```

because the `command` variable accepts only the type `Command`.

So, how would I be able to run a command after the completion is inserted into the editor?

---

SOLUTION:

Based on the answers below, I realized I was using the wrong command to trigger the parameter hints widget. Instead, I used the `editor.action.triggerParameterHints` command:

```js
completion.command = { command: 'editor.action.triggerParameterHints', title: '' };

```