Author Topic: C# format problem  (Read 3564 times)


  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
C# format problem
« on: October 03, 2007, 03:21:23 pm »
I've come across a problem with the C# formatting/completion.

Take this sample code:

Code: [Select]
public void SomeMethod() {
  List<int> lst = new List<int>();
  lst.Sort(delegate(int lhs, int rhs) {
    return 1;

When typing this out from the beginning, SE has a problem with the return statement.   If you type return <space> it automatically adds a semicolon after the return.   To get it to actually return something you have to go through several steps of manual spacing of the return text. 

It seems that the parser isn't picking up the fact that the anon delegate may return something even when the outer method does not, so it forces the return to be empty.

Any way to fix this?

Thanks -andy


  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: C# format problem
« Reply #1 on: October 04, 2007, 03:32:03 pm »
We'll have to log this as bug. It's not a quick fix. However, you can avoid the automatic insertion of the ; (or any autocompletion for that matter) by using Shift+Space, or whatever sequence the keyin-space command is bound to. (It's Shift+Space in most emulations)