Author Topic: Code completion issue with C#  (Read 1056 times)

imtribble

  • Community Member
  • Posts: 43
  • Hero Points: 4
Code completion issue with C#
« on: August 01, 2023, 11:38:13 PM »
I have an ongoing issue with SlickEdit 2022 (v22.0.6 64bit Windows) when coding in C#. The issue happens when I'm creating a method inside a class that has other methods defined below (or any code for that matter). If say I enter

 
   if ( FI 


I correctly get the drop down for code completion. If I choose one of those items and hit the tab key, the following auto inserted ) along with a couple lines of code get delete...


I will try to get some screen shots, but I at least wanted to get this posted.


This was not an issue with SE 2021 but it is an issue with the 2022 as well as the beta of 2023


UPDATE: I've found that it isn't the tab key that's causing the issue. If the code completion drop down box appears and I used the down arrow key (on the keyboard) to select an item, each time I hit the down arrow, the editor eats a line of code. So if I hit it three times, three lines get eaten. If it wraps around back to the top, it continues to eat lines until I stop arrowing down.

« Last Edit: August 02, 2023, 12:47:21 PM by imtribble »

Dennis

  • Senior Community Member
  • Posts: 3989
  • Hero Points: 519
Re: Code completion issue with C#
« Reply #1 on: August 02, 2023, 01:10:21 PM »
That's dynamic surround.  Document > C# Options... > Editing > Syntax Expansion > |x| Dynamic Surround.  You can disable it by unchecking that option.  However, the keystrokes for the code completion drop down box should not be going through to dynamic surround.  When emulation are you using?

imtribble

  • Community Member
  • Posts: 43
  • Hero Points: 4
Re: Code completion issue with C#
« Reply #2 on: August 02, 2023, 01:14:56 PM »
I'm using the old school Brief emulation.

Dennis

  • Senior Community Member
  • Posts: 3989
  • Hero Points: 519
Re: Code completion issue with C#
« Reply #3 on: August 02, 2023, 02:53:25 PM »
Are you actually hitting cursor keys or do you have a another keyboard shortcut for cursor-down that you use?

imtribble

  • Community Member
  • Posts: 43
  • Hero Points: 4
Re: Code completion issue with C#
« Reply #4 on: August 02, 2023, 05:10:13 PM »
I was just using the normal cursor keys.  I unchecked the Dynamic surround in the settings, but it still eats the lines.


I did try a different emulation (cua) with the same results. It doesn't happen in C/C++ nor does it happen in Pascal. Just an odd thing.
« Last Edit: August 02, 2023, 05:15:31 PM by imtribble »

imtribble

  • Community Member
  • Posts: 43
  • Hero Points: 4
Re: Code completion issue with C#
« Reply #5 on: August 04, 2023, 08:59:36 AM »
I finally had a chance to make a little demo example. The code snip is as follows.

namespace BugTesting
{
   public class MyTest
   {
      private int FNoNumbers;
      private string FNoStrings;
      private float FNoFloat;


      public MyTest()
      {
         string strTest =
      }

   }
}


I've included a video of the bug.

imtribble

  • Community Member
  • Posts: 43
  • Hero Points: 4
Re: Code completion issue with C#
« Reply #6 on: August 25, 2023, 08:38:34 AM »
As a follow up to this item, I installed the beta on my old laptop and didn't have the issue whereas I did have it on my current one. My next step is to try to reset the installation on my current laptop.


imtribble

  • Community Member
  • Posts: 43
  • Hero Points: 4
Re: Code completion issue with C#
« Reply #7 on: August 25, 2023, 07:02:56 PM »
Deleting my config files resolved this issue for me.


Dennis

  • Senior Community Member
  • Posts: 3989
  • Hero Points: 519
Re: Code completion issue with C#
« Reply #8 on: September 01, 2023, 07:49:24 PM »
I was finally able to get back to this and reproduce the problem.  It traces back to the (OFF by default) option:  Document > C# Options... > Auto-Complete > Completion choice > "Insert current completion in file"

It looks like the code that is removing the current completion and replacing another when you hit cursor down is taking a few extra bytes.

I'll see if I can track down where the hungry hippo is hiding.

Thanks for your patience (and putting together that sample and video, would never have been able to reproduce this bug without it).