How to control else auto brackets?

I can't find a setting to turn off the automatic insert of brackets when I enter an else keyword. The C# editor doesn't auto insert brackets for if keywords, just for else. I would like to be able to control this.

5 comments

Hello Paul,

Could you please monitor the situation and check which item is selected in
IntelliSense when you're typing 'else': the 'else' keyword or the 'else'
live template? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I can't find a setting to turn off the automatic insert of brackets
when I enter an else keyword. The C# editor doesn't auto insert
brackets for if keywords, just for else. I would like to be able
to control this.

---
Original message URL:
http://devnet.jetbrains.net/message/5318820#5318820



0

Intellisense is visible as I type, and the last item in the list is selected "else". The item icon has a square containing a circle. Is this a live template?

I unchecked "Include keywords in completion list" but it was still appearing and the auto brackets were still created.

I have turned off resharper intellisense to fix this unwanted behavior but I would like to be able to run the resharper version.

0

Hello Paul,

Please open ReSharper | Live Templates... window and uncheck the Predefined
Templates | C# | Imported Visual C# Snippets | else template. Let me know
if this helps. Thank you!


Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

circle



0

Unchecking the else template worked. I haven't looked at the live template system before.
There is still a glitch, I have to type Enter twice to start a new line below the else, but this is easier to live with than the auto brackets. I wonder what is causing this?

0

Hello Paul,

I believe that this happens because you now have 'else' keyword selected
in completion list: when you press Enter for the first time, 'else' keyword
gets completed and only when you press Enter for the second time - a new
line gets inserted. In order to avoid this behavior you can play around with
'Include keywords in completion list' and 'Only those that are at least'
options under ReSharper | Options | IntelliSense | Completion Behavior. Thank
you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Unchecking the else template worked. I haven't looked at the live
template system before.

There is still a glitch, I have to type Enter twice to start a new
line below the else, but this is easier to live with than the auto
brackets. I wonder what is causing this?

---
Original message URL:
http://devnet.jetbrains.net/message/5319400#5319400



0

Please sign in to leave a comment.