tomwhite007 / rename-angular-component

VS Code Extension: Rename Angular Component
https://marketplace.visualstudio.com/items?itemName=tomwhite007.rename-angular-component
Other
30 stars 2 forks source link

Naming Convention Problem #29

Closed hablix closed 2 years ago

hablix commented 2 years ago

Describe the bug Cannot rename Componet. Always getting Error: "The component class file must use the same file naming convention as 'controlarea.component.ts' for this process to run." But component class file IS already using the same file naming convention.

It doesn't matter what the new name should be. Always getting the same error mesage.

All files are already following the angular style guide: https://angular.io/guide/styleguide#style-02-01

controlarea.component.ts controlarea.component.html controlarea.component.css and selector: app-controlarea and class name: ControlareaComponent

Screenshots or Demo Repo image

tomwhite007 commented 2 years ago

Thanks for your detailed issue comments. I'm going to try to recreate your scenario but I may need to request a few more details.

I'll comment again shortly.

Regards

Tom

tomwhite007 commented 2 years ago

Hello @hablix

I've recreated a component with the same name as yours in a test app/repo here: https://github.com/tomwhite007/test-issue29 - and renaming works fine on my component. This proves that there must be a difference in your configuration that we haven't noted yet. It'd be great if you could clone the repo and see if you can rename it too.

Here's some questions to try to get to the bottom of your issue. If you're willing, I'd be happy to receive any answers you have time to give. Don't feel you have to answer all of them unless you can.

  1. Have you successfully renamed other components within the same application or, have you tried in another app? I need to understand if your problem occurs on one component, one app or on your machine with every app.
  2. What's your OS and version?
  3. Are you using Windows WSL?
  4. Could you try enabling error logging for the Rename Angular Component extension? Set: "renameAngularComponent.debugLog": true and restart VS Code. This will create a log file called rename-angular-component-debug-log.txt (when you rename a component) in the root of your app. Then you can attach the file to this issue.
  5. If number 4 fails to turn up enough info, I may need to request you create a copy of your repo to share with me - with almost all files removed except for the TSconfig and package.json files and the ControlareaComponent file remaining. The app doesn't need to build; it just has to allow the extension to run and fail, for me to find the problem.
tomwhite007 commented 2 years ago

Hello @hablix Have you managed to try renaming other components successfully? I cannot recreate your problem without you providing further information to the questions in the comment above I would very much like to help if you can reply.

hablix commented 2 years ago

Hello Tom,

Thanks for the effort so far I can answer you the following questions: other questions I can only answer you next week BC I'm on vacation right now.

  1. I could not rename other components in the same app. Also other variations of names are not possible.

Haven't tried it on another app.

  1. Windows 10
  2. No

4 and 5. Thanks for the hint, I will do this by next week.

Best regards Hannes

Tom White @.***> schrieb am Di., 14. Juni 2022, 08:09:

Hello @hablix https://github.com/hablix Have you managed to try renaming other components successfully? I cannot recreate your problem without you providing further information to the questions in the comment above https://github.com/tomwhite007/rename-angular-component/issues/29#issuecomment-1145437070 I would very much like to help if you can reply.

— Reply to this email directly, view it on GitHub https://github.com/tomwhite007/rename-angular-component/issues/29#issuecomment-1154756443, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH2VDIXJDYFMVIQCFXV6YBLVPAO2LANCNFSM5XQMHSPQ . You are receiving this because you were mentioned.Message ID: @.***>

MohRaouf commented 2 years ago

same here

tomwhite007 commented 2 years ago

Hi @hablix and @MohRaouf

The current info provided by @hablix is very helpful but not enough for me to debug against. If either or both of you can provide info to questions 4 or 5 above, that could help a lot.

At the moment my suspicions relate to file access / rights on your machines. If it is something like that, I believe my current PR, Feat/use vscode workspace fs #31 could fix your issue. You could watch this PR and when its merged and released, try again.

If you are able to answer 4 or 5 in the meantime, that would help me confirm (or pivot) before release.

Regards

Tom

tomwhite007 commented 2 years ago

Hi. A quick update. I'm closing Feat/use vscode workspace fs #31 for performance reasons, so that won't help this issue. If either of you can answer 4 or 5 above, I can progress this issue. Hope to hear from you soon.

elmehdielhamdi commented 2 years ago

Hello ! I have the same issue and have done 4. rename-angular-component-debug-log.txt

tomwhite007 commented 2 years ago

Hi @elmehdielhamdi

That was really helpful. Thank you. Your log file highlighted a gap that I need more details from.

I've released a new version to add extra logging around the files it looks for after you enter the new name. Would you mind updating to v2.1.2 and running the same process again? Then if you send me the log file again, I'm hopeful I'll find the issue is related to Windows paths.

Thanks again

elmehdielhamdi commented 2 years ago

Hi @tomwhite007 !

I'm glad that it helped 😀. I installed the update and did the same process, here is the new log file: rename-angular-component-debug-log.txt

tomwhite007 commented 2 years ago

Hi @elmehdielhamdi , @MohRaouf , @hablix

Thanks to all of you for your comments, help and feedback.

I believe I now have a solution. PR #37 will close this issue today and the new version 2.1.3 will be deployed. If you still have the same problem after you recieve the update in VSCode, please comment on this issue thread, and I'll reopen it.

Regards

Tom White