soates / Auto-Import

vscode extension that will automatically finds, parses and provides code actions for all available imports. Only currently works with files in your folder and TypeScript.
MIT License
165 stars 62 forks source link

When moving folders around auto-import renames import paths across entire project incorrectly. #111

Open CieloVistaSoftware opened 4 years ago

CieloVistaSoftware commented 4 years ago

Describe the bug

Environment: Using ng-serve while making changes. A determination is made to refactor a component or two or more. Ultimately, one or more folders are moved.

This app will attempt to rename paths but very often cannot do it properly. This winds up with many import path statements being wrong.

To Reproduce

Steps to reproduce the behavior:

It should be able to track folder moves anywhere anytime.

Logs

Please attach two logs:

Next time I see it I will attach the log.

Screenshots

Next time I will attach screen shot.

Additional context

Sometimes when typing in a new import path it will pop up 4 or 5 possible selections. The text does not make it clear which one is the right one. This causes us to have to try multiple choices until the right one is found. In our environment the index.ts files are not updated until we specifically run the job, maybe this has something to do with it. In that case, there should be an option to ignore index.ts files because Angular requires all components to be put into the NgModule. Perhaps a NgModule only config option would be good.