Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File name setting for "Refactor -> move to a new file" #81835

Closed
ablomen opened this issue Oct 2, 2019 · 2 comments
Closed

File name setting for "Refactor -> move to a new file" #81835

ablomen opened this issue Oct 2, 2019 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@ablomen
Copy link

ablomen commented Oct 2, 2019

The "Move to a new file" refactor is a great tool, except that the generated file keeps the casing of whatever you are moving.
Example:

export interface UserSettings {
  language: string;
}

Using the refactor here creates a file named "UserSettings.ts" (PascalCase) while I would like it to be named "user-settings.ts" (kebab-case)
A setting to change this behavior with options like:

  • Keep case of class/interface/etc name (current behavior)
  • Convert to PascalCase
  • Convert to kebab-case
  • Convert to lower case
  • (plus snake_case and camelCase i guess)

would remove an extra step (renaming the generated files or creating files by hand and manually importing it) and would make me and at least one other person on stack overflow very happy.

@vscodebot
Copy link

vscodebot bot commented Oct 2, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@mjbvz
Copy link
Collaborator

mjbvz commented Oct 2, 2019

Letting users explicitly specify the file name (#50685) would address this. If we add an explicit set of options for the name, we could keep adding new options forever and never make everyone happy

@mjbvz mjbvz closed this as completed Oct 2, 2019
@mjbvz mjbvz added the *duplicate Issue identified as a duplicate of another issue(s) label Oct 2, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants