0

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.

SegFault
  • 59
  • 4

1 Answers1

0

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
)
SegFault
  • 59
  • 4