rename-angular-component icon indicating copy to clipboard operation
rename-angular-component copied to clipboard

Removes slahes (/) from import

Open DarkDynamite opened this issue 4 months ago • 3 comments

After renaming the import of the angular components are missing the slash in path.

Before: import { Component, Inject } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser';

After: import { Component, Inject } from '@angularcore'; import { DomSanitizer } from '@angularplatform-browser';

I have always to add them.

Use Local Direct Paths is enabled and works great for other imports.

We are now an Angular 19.2

DarkDynamite avatar Jul 25 '25 06:07 DarkDynamite

Oh dear. Sorry to hear that.

I've not heard of this one yet, but I'll try to reproduce it. Thanks for taking the time to report it.

In the meantime, you could help me by doing one of 2 things if you have a moment:

  1. Create a dummy repo I can access where you still experience the problem.
  2. Switch on the Rename Angular Component extension Debug Log option and restart your IDE. Then re-trigger the problem. The log might have something useful that you could send me.

tomwhite007 avatar Jul 25 '25 07:07 tomwhite007

First, thanks for your help.

I uploaded the (anymized) debug log but could not find any hint for the problem.

rename-angular-component-debug-log.txt

The repo is private and not on github. I am not sure if I can provide a dummy repo with this error.

Btw I'm using MacOS

DarkDynamite avatar Jul 28 '25 06:07 DarkDynamite

Hi @DarkDynamite

I've created a new Angular project at v19.2 https://github.com/tomwhite007/ng19-2-test-rename

I cannot reproduce your problem. Could you clone the example repo and test as well? Alternatively, you can create your own new project and try the same test.

I suspect the issue is coming from something unusual in your working project repo. Would you be willing to duplicate your repo files and then remove almost everything except a dummy app-component and a test-component, (prove the problem still exists) and then share the new test repo with me privately on GitHub? Then I'd be happy to debug the issue.

tomwhite007 avatar Aug 12 '25 07:08 tomwhite007