vscode_deno
vscode_deno copied to clipboard
Feat: Quick Fix: Extract to import map
Is your feature request related to a problem? Please describe.
I find myself often in the situation where I'm prototyping something and using npm:
or https://
imports for convenience. Once a dependency needs to be shared among files I typically want to move them to a single place to version them. So far I've always manually pasted and replaced the identifier, but I feel like it's something vscode should be able to do for me.
Describe the solution you'd like
A new quick fix command for npm:
or https://
import specifiers that extracts it to the import map.
// Before
import { render } from "npm:[email protected]";
// After
import { render } from "preact";
// deno.json
{
"imports": {
"preact": "npm:[email protected]",
}
}
I want this for a while! Also perhaps handle other files with the same import (or similar import with a different version) via some code-action. This could help make the whole codebase nicer quickly.