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

Configurable naming conventions for quick-actions #2332

Closed
tomasaschan opened this issue May 22, 2018 · 1 comment
Closed

Configurable naming conventions for quick-actions #2332

tomasaschan opened this issue May 22, 2018 · 1 comment

Comments

@tomasaschan
Copy link

Given the following code, with the code at the | symbol:

public class Foo
{
     public Foo(IBar bar|) // <- cursor at bar here
     {
     }
}

I have a quick-action available to create a property or private field and assign the argument to it. Is there any way I can configure the naming conventions for those?

The current convention for the field results in

public class Foo
{
     private readonly IBar bar;
     public Foo(IBar bar)
     {
         this.bar = bar;
     }
}

but I would prefer

public class Foo
{
     private readonly IBar _bar;
     public Foo(IBar bar)
     {
         _bar = bar;
     }
}

Since I realize this is a matter of preference, I don't expect you to change this for everybody, but it would be nice if it was configurable. (And once there is a configuration system for it, I bet there are other places as well where it would make sense to expose options...)

@DustinCampbell
Copy link
Member

Thanks for the request! I agree that we need a way to configure this. The configuration system we intend to use for this is .editorconfig, which is what we're using in Visual Studio as well. We're tracking support for editorconfig with #1726. That issue only mentions formatting options, but the editorconfig support will include naming options as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants