Menu

#314 Random operation of Formatter..

Closed
closed-fixed
Formatter (10)
5
2024-12-07
2023-03-09
Ian Branch
No

D11.3, Win 11, 32 bit Apps, Delphi opened DPIUnaware.
I have a ShowMessage at the start of the GX_CodeFormatterExpert.pas Execute method.

I am experiencing random non function of the Source Code Formatter.
If I start my Windows and immediately open Delphi and a Project, in most cases the Formatter is fine.
If I close the Project and open another, sometimes the Formatter does not work either via the HotKey or the menu option. Sometimes it does.
Closing and reopening the Project and Delphi sometimes restores functionality, sometimes not.
Closing the Project and Delphi and restarting Windows seems to always make it work the first time.
Sometimes, if I already have other Apps open and then open Delphi, the Formatter does not work immediately.
In all cases the ShowMessage appears, but randomly as described, the Formatter does NOT do its thing.
I have tried all sorts of permutations but nothing seems to be permanent.
I do NOT recall this happening in D11.2 but it may have. If it did, it wasn't as frequent/annoying.
This could be my overall Windows environment. I don't know.
It could be something specifi to D11.3. I don't know.
It may be something to do with the changed IDE in 11.3. I don't know.

If there is any value I am happy for you to remote into my PC and observe/test if you like.

Regards,
Ian

Related

Bugs: #314

Discussion

1 2 > >> (Page 1 of 2)
  • Thomas Mueller

    Thomas Mueller - 2023-03-11
    • assigned_to: Tommi Prami
     
  • Thomas Mueller

    Thomas Mueller - 2023-03-11

    I have just committed revision #3989 containing additional debug messages that should help tracking down the reason for the failure. Please update your sources and compile a new DLL in debug mode(!). Then, the next time formatting failed, check the topmost entries in the GExperts debug window (in the icon tray). And copy them here. Please start with the line saying
    TeCodeFormatterExpert.Execute
    and include all lines above that start with the string "GXFormatter:".
    A successful format call should look something like this:


    2 GXFormatter: TCodeFormatterExpert.Execute:Cleanup 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Force repaints 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Restore breakpoints and bookmarks 11:29:14
    2 EditorViewModified(D:\source_sourceforge\GExperts\source\Formatter\GX_CodeFormatterExpert.pas) 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Replace selection only 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Executing formatter 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Prepare to format selection 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Format selection ? 11:29:14
    2 GXFormatter: Use default settings 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Determine settings 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute:Save Breakpoints and bookmarks 11:29:14
    2 GXFormatter: Formatting requested for "D:\source_sourceforge\GExperts\source\Formatter\GX_CodeFormatterExpert.pas" 11:29:14
    2 GXFormatter: TCodeFormatterExpert.Execute 11:29:14
    2 TeCodeFormatterExpert.Execute 11:29:14


     
  • Ian Branch

    Ian Branch - 2023-03-11

    Hi Thomas,
    Build of 3990 failed..See attached screen shot.

     
    • Thomas Mueller

      Thomas Mueller - 2023-03-12

      That looks like you had merge conflicts.

       
  • Ian Branch

    Ian Branch - 2023-03-11

    I deleted the GExperts directory and redownloaded the source. Now the errors look like the attached..

     
    • Thomas Mueller

      Thomas Mueller - 2023-03-12

      You did not build it with the debug configuration. (It's a bug nonetheless, but it does compile with the debug config).

       
  • Ian Branch

    Ian Branch - 2023-03-12

    OH! My apologies. I missunderstood.
    Whilst I will take it as a compliment, I'm afraid I don't have the level of expertise you assumed/expected me to have. - Apologies.
    I have downloaded rev 3997 & built the .dll in debug mode.
    I then built GExpertsDebugWindows.exe and ran it. Not quite sure when/where it is supposed to show.
    Anyway, after 30 minutes of testing so far the Formatter hasn't failed.
    I will return here and advise if it does.

     
  • Ian Branch

    Ian Branch - 2023-03-12

    I am missing something.. :-(
    I have GExpertDebugWindows running. I can see it in Windows Task Manager.
    I added dbugintf to my uses clause..
    I added " SendDebug('Debug note');" into the FormShow.
    When I run the App, no debug window appears so I don't see any message.
    What have I missed??

    Ian

     
  • Ian Branch

    Ian Branch - 2023-03-12

    Nor does any Debug window appear when I call the Formatter.

     
  • Ian Branch

    Ian Branch - 2023-03-13

    I have spent the day in and out of Delphi and multiple mixtures of other Apps.
    Not once has Formatter failed me. :-) Nor have I seen the GExperts Debug Window.
    Tomorrow morning I will build GExperts via the normal way and test it for the day.
    Will advise.

    Ian

     
    • Tommi Prami

      Tommi Prami - 2023-03-13

      I think the GExpers debug window will sit on SystemTray (Or what it is
      called), don't remember if you need to specifically to open it from the
      Tray icon to see it.

      -Tee-

      On Mon, Mar 13, 2023 at 6:16 AM Ian Branch ijbranch@users.sourceforge.net
      wrote:

      I have spent the day in and out of Delphi and multiple mixtures of other
      Apps.
      Not once has Formatter failed me. :-) Nor have I seen the GExperts Debug
      Window.
      Tomorrow morning I will build GExperts via the normal way and test it for
      the day.
      Will advise.

      Ian

      Status: open
      Group: New
      Labels: Formatter
      Created: Thu Mar 09, 2023 08:07 AM UTC by Ian Branch
      Last Updated: Sun Mar 12, 2023 09:17 PM UTC
      Owner: Tommi Prami

      D11.3, Win 11, 32 bit Apps, Delphi opened DPIUnaware.
      I have a ShowMessage at the start of the GX_CodeFormatterExpert.pas
      Execute method.

      I am experiencing random non function of the Source Code Formatter.
      If I start my Windows and immediately open Delphi and a Project, in most
      cases the Formatter is fine.
      If I close the Project and open another, sometimes the Formatter does not
      work either via the HotKey or the menu option. Sometimes it does.
      Closing and reopening the Project and Delphi sometimes restores
      functionality, sometimes not.
      Closing the Project and Delphi and restarting Windows seems to always make
      it work the first time.
      Sometimes, if I already have other Apps open and then open Delphi, the
      Formatter does not work immediately.
      In all cases the ShowMessage appears, but randomly as described, the
      Formatter does NOT do its thing.
      I have tried all sorts of permutations but nothing seems to be permanent.
      I do NOT recall this happening in D11.2 but it may have. If it did, it
      wasn't as frequent/annoying.
      This could be my overall Windows environment. I don't know.
      It could be something specifi to D11.3. I don't know.
      It may be something to do with the changed IDE in 11.3. I don't know.

      If there is any value I am happy for you to remote into my PC and
      observe/test if you like.

      Regards,
      Ian


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gexperts/bugs/314/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #314

  • Ian Branch

    Ian Branch - 2023-03-13

    Ah Ha! got it. Tks Tee.

     
    • Tommi Prami

      Tommi Prami - 2023-03-13

      Glad to see that my memory serves someone :)

      -Tee-

      On Mon, Mar 13, 2023 at 8:14 AM Ian Branch ijbranch@users.sourceforge.net
      wrote:

      Ah Ha! got it. Tks Tee.

      Status: open
      Group: New
      Labels: Formatter
      Created: Thu Mar 09, 2023 08:07 AM UTC by Ian Branch
      Last Updated: Mon Mar 13, 2023 04:16 AM UTC
      Owner: Tommi Prami

      D11.3, Win 11, 32 bit Apps, Delphi opened DPIUnaware.
      I have a ShowMessage at the start of the GX_CodeFormatterExpert.pas
      Execute method.

      I am experiencing random non function of the Source Code Formatter.
      If I start my Windows and immediately open Delphi and a Project, in most
      cases the Formatter is fine.
      If I close the Project and open another, sometimes the Formatter does not
      work either via the HotKey or the menu option. Sometimes it does.
      Closing and reopening the Project and Delphi sometimes restores
      functionality, sometimes not.
      Closing the Project and Delphi and restarting Windows seems to always make
      it work the first time.
      Sometimes, if I already have other Apps open and then open Delphi, the
      Formatter does not work immediately.
      In all cases the ShowMessage appears, but randomly as described, the
      Formatter does NOT do its thing.
      I have tried all sorts of permutations but nothing seems to be permanent.
      I do NOT recall this happening in D11.2 but it may have. If it did, it
      wasn't as frequent/annoying.
      This could be my overall Windows environment. I don't know.
      It could be something specifi to D11.3. I don't know.
      It may be something to do with the changed IDE in 11.3. I don't know.

      If there is any value I am happy for you to remote into my PC and
      observe/test if you like.

      Regards,
      Ian


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/gexperts/bugs/314/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #314

  • Ian Branch

    Ian Branch - 2023-03-13

    Hi Thomas,
    Results of a lot of back and forth testing..

    1. Built in Debug mode - No issue. Correct entries in the Debug Window every time.
    2. Built in Release mode - Usually shows Issue immediately. Sometimes on the loading of the second project.

    Regards,
    Ian

     
  • Ian Branch

    Ian Branch - 2023-03-15

    Aside from when I was testing, I have used GExperts built in Debug mode most of yesterday and all of today without any issuse or hiccups withthe Formatter.

     
  • Thomas Mueller

    Thomas Mueller - 2023-03-18

    Hm, that's odd. Maybe disabling debug everywhere but keeping the messages might help. I'll try to produce some more testing code today.

     
  • Thomas Mueller

    Thomas Mueller - 2023-03-18

    Interesting: I can reproduce the problem now on my computer. That might be good news.

    This is, what the log looks like, when formatting fails:

    2   Leaving TCodeFormatterExpert.Execute    14:38:19
    2       TCodeFormatterExpert.Execute:Cleanup    14:38:19
    2       TCodeFormatterExpert.Execute:Executing formatter    14:38:19
    2       TCodeFormatterExpert.Execute:Format selection ? 14:38:18
    2       Use default settings    14:38:18
    2       TCodeFormatterExpert.Execute:Determine settings 14:38:18
    2       TCodeFormatterExpert.Execute:Save Breakpoints and bookmarks 14:38:18
    2       Formatting requested for "D:\source\_sourceforge\GExperts\source\Formatter\GX_CodeFormatterExpert.pas"  14:38:18
    2   Entering TCodeFormatterExpert.Execute   14:38:18
    

    (Note: The EditorViewModified might be missing only because debugging was disabled and therefore no message was sent to the debug window. Or it might be missing because it was never called.)

     

    Last edit: Thomas Mueller 2023-03-18
  • Thomas Mueller

    Thomas Mueller - 2023-03-18

    Here is the reason:

    1 Formatter: EListError: List index out of bounds (-1). TList object range is 0..-1 15:26:42

    This results in TCodeFormatterEngine.Execute to return False.
    But why that doesn't happen in debug mode is still a mystery.

     
  • Thomas Mueller

    Thomas Mueller - 2023-03-18

    @ijbranch : I have just committed some changes that logs any exceptions that happen in TCodeFormatterEngine.Execute, regardless whether compiled in debug mode or not.
    Please use that to verify that an exception there is the cause for the code formatter failing on your computer. (And of course, please report that exception here).

     
  • Ian Branch

    Ian Branch - 2023-03-18

    Hi Thomas,
    Build of rev 4002 failed when built via the __build_project.. See attached.
    It also fails if built directly in Release mode. I commented out the offending lines and it builds.

    //<<<<<<< .mine
      {$IFDEF  DEBUG}
        Result := SVersion + ' ' + Result+' - Debug';
      {$ELSE}
      Result := SVersion + ' ' + Result+' - Release';
      {$ENDIF}
    //||||||| .r3998
      Result := SVersion + ' ' + Result;
    //=======
    {$IFOPT D+}
      Result := SVersion + ' ' + Result + ' - Debug';
    {$ELSE}
      Result := SVersion + ' ' + Result;
    //>>>>>>> .r4002
    {$ENDIF}
    

    I will test both modes today and advise.

    Ian

     
    • Thomas Mueller

      Thomas Mueller - 2023-03-19

      A merge conflict again.

       
  • Ian Branch

    Ian Branch - 2023-03-18

    The about dialog may need some adjustment. :-)

    Edit - Sorted after I did a clean download.

     

    Last edit: Ian Branch 2023-03-18
  • Ian Branch

    Ian Branch - 2023-03-18

    I got one...

    2 Formatter: Leaving TCodeFormatterEngine.Execute 08:15:25
    1 Formatter: EListError: List index out of bounds (-1). TList object range is 0..-1 08:15:25
    2 Formatter: Entering TCodeFormatterEngine.Execute(3006) 08:15:25
    2 TGxNTAEditServiceNotifier: DockFormUpdated(E:\DBiWorkflow Development\DBiSupportFiles\dmCurrent.pas, Exploring dmCurrent.pas) 08:15:11

    This is with GExperts built in Release mode.

     
  • Ian Branch

    Ian Branch - 2023-03-18

    Hmmm..

    Edit - Sorted after I did a clean download.

     

    Last edit: Ian Branch 2023-03-18
  • Ian Branch

    Ian Branch - 2023-03-18

    Did you change something already??
    I did a clean download of GExperts.
    I no longer get the 'Release' or 'Debug' during startup or in the About box.

    Edit - S'OK - I figured out what you have done.

     

    Last edit: Ian Branch 2023-03-18
1 2 > >> (Page 1 of 2)

Log in to post a comment.

MongoDB Logo MongoDB