1
votes

As the title, I want to get typescript language server's completion items in my own extension. How should I do?

If there is another way except running the language server by myself?

1

1 Answers

0
votes

You can use the vscode.executeCompletionItemProvider built-in command for this:

const list = await vscode.commands.executeCommand('vscode.executeCompletionItemProvider',
    vscode.Uri.file('/path/to/file.ts'),
    new vscode.Position(line, character))

Similar commands exist for other functionality, such as listing references.