Implementing a VS Code feature: Introduction [0/2]

I recently switched from WebStorm to VS Code. Turns out VS Code doesn’t have a feature I relied on quite a bit: “Copy with Imports”.

In WebStorm, when you copy-paste a snippet the imports are pasted along with it. For example:

import fs from "fs";
import http from "http";

// If you copy the lines below to another file,
// the imports above will be automatically pasted
// along with it.
http.createServer((req, res) => {
  const data = fs.readFileSync("bla");
  res.write(data);
  res.end();
});

VS Code doesn’t support this yet. You have to manually run “Add imports” after pasting a snippet.

There’s a 4-year old feature request for this. Let’s see if we can get this implemented!