stringham / move-ts

A Visual Studio Code plugin for updating relative imports when moving typescript files and folders in your workspace.
MIT License
52 stars 15 forks source link

Issue when moving folder with subfolders #11

Closed marcgrabow closed 6 years ago

marcgrabow commented 7 years ago

When using the move command on a folder that itself contains subfolders, the plugin will:

Example (before command):

* myfile.ts // has reference to myfolder/my subfolder/mysecondfile.ts
* myfolder
  * my subfolder
    * mysecondfile.ts
* another folder

executing the move command to move "myfolder" into "another folder"

Example (after command):

* myfile.ts // has updated reference to anotherfolder/myfolder/my subfolder/mysecondfile.ts
* myfolder
  * my subfolder
    * mysecondfile.ts
* another folder

Which results in a state that fails on compiling.

Thanks for the plugin, really helpful!

stringham commented 6 years ago

I tried following your reproduction steps, but things seemed to work. Is there something I'm missing?

File structure:

* myfile.ts
* myfolder
  * my subfolder
    * mysecondfile.ts
* another folder
//myfile.ts
import {Foo} from './myfolder/my subfolder/secondfile';
//secondfile.ts
export const Foo = 4;

Move myfolder into another folder

File structure is now:

* myfile.ts
* another folder
  * myfolder
    * my subfolder
      * mysecondfile.ts

and myfile.ts looks like:

//myfile.ts
import {Foo} from './another folder/myfolder/my subfolder/secondfile';
stringham commented 6 years ago

Since I am not able to reproduce and have not heard back, I am going to close this issue for now.