denofevil / AureliaStorm

This plugin brings support for Aurelia framework to the IntelliJ platform
MIT License
35 stars 6 forks source link

refactoring: renaming TS file should change the TS class name #17

Closed atsu85 closed 6 years ago

atsu85 commented 8 years ago

... Some examples: my-login-form.ts (containing export class MyLoginForm) -> my-change-password.ts (export class MyChangePassword).

I'm using kebab-case convention with (project-specific) prefix for custom elements

login.ts (containing export class Login) -> changePassword.ts (export class ChangePassword)

I'm using lowerCamelCase.ts convention for views (components with URL/route)

denofevil commented 8 years ago

@atsu85 I think this one is mostly covered by WEB-13397, what do you think? I can add info there about Camel/Dash/Snake convention

atsu85 commented 7 years ago

@denofevil

I think this one is mostly covered by WEB-13397

It seems that it covers renaming TypeScript classes/files, such as UserService.ts (containing export class UserService) -> ClientService.ts (containing export class ClientService)

and improving the suggestion with case conventions might do the trick for my previous examples as well:

my-login-form.ts (containing export class MyLoginForm) -> my-change-password.ts (export class MyChangePassword). login.ts (containing export class Login) -> changePassword.ts (export class ChangePassword)

but I Aurelia plugin should also need to take into account that html template files accompanying Aurelia viewModel files have the same file basename by default (unless using decorator that points to different html file, but this could be left out initially). So when renaming either login.ts or login.html to changePassword.ts or changePassword.html, then the other file should also be renamed (in addition to TypeScript class name). The same should work with renaming my-login-form.* to my-change-password.*