Implementing a VS Code feature: Research & Planning [1/2]

This is the first article in a series where we’ll implement “Copy with Imports” in VS Code’s TypeScript extension.

Previous article: Introduction

Next article: registerDocumentPasteEditProvider

To start with, some basic research:

The registerDocumentPasteEditProvider API takes three parameters:

Here’s how I plan to break this down:

  1. Call registerDocumentPasteEditProvider, but use a dummy implementation that just console.logs the arguments.
  2. Implement the prepareDocumentPaste function to copy the imports along with the copied text.
  3. Implement the provideDocumentPasteEdits function to insert the copied imports.