Open
Description
Suggestion
π Search Terms
- drop
- dnd
- import
- require
β Suggestion
When I drag and drop a file from VS Code's explorer into the top of my TypeScript code, it should insert an import statement
For example if I have the workspace:
index.ts
sub/
other.ts
And I drop other.ts
into index.ts
, it should insert:
import $1 from './sub/other'; // here $1 is where the cursor should be after the drop
Other cases
-
I should be able to drag and drop multiple files to create multiple imports
-
Possible: If I drop the file into somewhere else in the file, we should instead insert an import expression
-
The added import path should take into account TypeScript's path resolution logic
-
This also should apply when copy and pasting a file into the editor