question

Ivanich avatar image
0 Votes"
Ivanich asked DylanZhu-MSFT answered

Can I change Intellisense code completion templates?

For example, I define a class implementing some interface, press Ctrl + Dot => Implement Interface, and Intellisense generates following code:

 public SomeType PropertyName
 {
     get
     {
         throw new NotImplementedException();
     }
    
     set
     {
         throw new NotImplementedException();
     }
 }

This is very annoying because I have to delete almost everything it generates and manually write

 public SomeType PropertyName { get; set; }

Surely there are some templates that can be edited to fix this behavior, but I can't find them. I found information about snippets, but they are not related to Intellisense.

Does anybody know where they could be located?





vs-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Just found that there is an option Tools -> Options -> Text Editor -> C# -> Advanced -> When generating properties -> prefer auto properties, but anyway, it would be good to know how to edit templates in general.

0 Votes 0 ·

1 Answer

DylanZhu-MSFT avatar image
1 Vote"
DylanZhu-MSFT answered

Hi Ivanich,

As far I know, it is included in intellisense feature, and we cannot customize it currently.

Best Regards,
Dylan


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.