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
angular component directive refactor rename service

Rename Angular Component

Rename Angular components, directives, and services - including their filenames, class names and selectors all in one go

Works with these Angular features:

How to use

Right-click the Angular file or its associated sibling file (.html, .scss, .spec.ts).

Click 'Rename Angular Component' and then enter a new name.

The extension converts the text you enter into kebab case for the filename, capital case for the class name, the correct case for the type of selector, and then adds all the existing pre and postfixes back on.

Rename Angular Component in action

Features

Based on the same naming convention in the Angular Style Guide and following the file pattern created by the Angular CLI, this extension will:

Example - Changes to Component file after rename:

Changes to Component file after rename

Example - Changes to an element selector in a parent template:

Changes to Component file after rename

Extension Settings

This extension contributes the following settings:

Known Issues

  1. Feature request: Limit rename selector in templates to VSCode's current workspace multi-folder root
  2. Extension does not support WSL

Support

If you have a problem using the extension or you find a bug, please raise an issue

Thanks

Thanks to Max Mumford for help finding bugs after initial release.

Thanks to Aristeidis Bampakos for feature guidance.

Thanks to you for reading this.

Release Notes

Latest version: [3.0.0] - 2024-02-27