is it possible to hook the completion list show function?
I mainly want to create an extension that when a completion list is shown, get the first suggestion and store it in a file.
is it possible to hook the completion list show function?
I mainly want to create an extension that when a completion list is shown, get the first suggestion and store it in a file.
I found out, that it's possible to get the suggestion list using complex commands API.
The command name is: vscode.executeCompletionItemProvider
and we can can call it using vscode.commands.executeCommand
// the Position object gives you the line and character where the cursor is
const position = editor.selection.active;
// Get document Uri
const docUri = vscode.window.activeTextEditor.document.uri;
completionList = vscode.commands.executeCommand(
'vscode.executeCompletionItemProvider',
docUri,
position
)