Recent

Author Topic: Likely bug  (Read 995 times)

440bx

  • Hero Member
  • *****
  • Posts: 4742
Likely bug
« on: April 24, 2024, 08:26:20 pm »
Lazarus v3.99 64 bit.

In the attached screenshot, the cursor was hovering over the "&type" field of the "low" statement on line 134.

I expected the little window showing the value of &type to be placed somewhere near the statement on line 134, instead the little window is on line 95 which is farther away than expected.

On a somewhat related note, on my system, usually the little window color is yellow but, this "far away" window color is grey.  Is there a good reason for that difference in color or should the different color be considered a bug ?

ETA:

Changed the thread's title
« Last Edit: April 25, 2024, 12:15:10 am by 440bx »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: FpDebug likely bug
« Reply #1 on: April 24, 2024, 09:10:31 pm »
First of all, it would be an editor bug.

The debugger (any of them) only delivers the content of the window (as text), but nothing else.

The yellow hint is created using IpTurboProDsg package => so if uninstalled, the grey hint is used. Yet, then all hints would be grey.

Probably not applying to your case either (as it looks like the source editor has focus / the very editor to which the hint belongs). On Windows, if you have more than one screen, and they have different DPI settings, and a window on one screen is focused, but the mouse hovers over a window on another screen, the wrong dpi is used to calculate the hint offset. => Btw, such DPI mixes even affect apps like the windows explorer, to have incorrect display in some cases...)

As for the position, I have no idea, but maybe it is a side effect of the below (if the below applies....)

The yellow hint is a html hint. I am not aware of any issue like the following, but it would not be impossible.... The content of the hint, might be such that it breaks the processing into html. If such breakage could happen (which I don't know), then I don't know if there would be a fallback to the grey hint....
For starters the "&" may have suddenly meaning or side effect...



Actually, after typing the above, I just made the test.
Code: Pascal  [Select][+][-]
  1. program Project1;
  2. var
  3. &a:integer;
  4. begin
  5.   &a := 123;
  6.   a := 123
  7. end.

Hovering the "a" is fine. but the "&a" is not.

Further this may even be a codetool bug => explaining why the hint has no other content (e.g. no position of declaration).
In the above code example, while NOT debugging, I can hover the "a" and get some info, but not on the "&a" (neither of the two).

And the same goes for ctrl click jump attempts.

So, at this time, I say this is primarily a codetools bug, but there may be additional issues in the hint handling code...

440bx

  • Hero Member
  • *****
  • Posts: 4742
Likely bug
« Reply #2 on: April 24, 2024, 09:30:18 pm »
First of all, it would be an editor bug.

The debugger (any of them) only delivers the content of the window (as text), but nothing else.
I stand corrected.  I thought it might be FpDebug related because I was debugging and the value being shown had to come from the debugger but, I can see how the debugger may not have anything to do with the location and color of the window.

The yellow hint is created using IpTurboProDsg package => so if uninstalled, the grey hint is used. Yet, then all hints would be grey.
There are no "user-installed" packages in this installation.  IOW, this installation is as-is "out of the box".  I've seen the color difference other times, I don't know if in this case the "&" had something to do with it but, I've had other occasions where the window was unexpectedly grey instead of yellow and there were no variables nor fields involving an "&".  Should the occasional difference in color be reported as a bug ?

On Windows, if you have more than one screen, and they have different DPI settings, and a window on one screen is focused, but the mouse hovers over a window on another screen, the wrong dpi is used to calculate the hint offset. => Btw, such DPI mixes even affect apps like the windows explorer, to have incorrect display in some cases...)
This installation is in a VM with a single monitor.  IOW, I don't think different DPIs have something to do with the location of the window.

So, at this time, I say this is primarily a codetools bug, but there may be additional issues in the hint handling code...
Ultimately that's what matters, should any of this be reported as a bug, what part should be considered a bug and, lastly against what ?

I'll create a ticket if one is warranted.
« Last Edit: April 25, 2024, 12:15:41 am by 440bx »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: FpDebug likely bug
« Reply #3 on: April 24, 2024, 09:48:34 pm »
Yes, TurboPowerIpProDsgn is installed by default, but you can uninstall it. Hence, you can build an IDE with grey hints. But that is not the issue here.

Yes, it should be reported as a bug. It should be reported as a bug against codetools. (as the & breaks more than just the hint).

"Codetool breaks on "&" in front of identifier (hint, source link, completion)"



I would say, there is a 2nd bug (though I am not 100% sure, could be missing feature).

If you go to Tools > Options > Editor > Completion and Hints: "Show declaration hints" and switch this off (this switches off the codetool hint).
But leave the "Show value hints while debugging" on.

Then the debug hint will always be grey.

It can be reported as "Source Editor hints not using yellow TurboPowerIPro hint for non-codetool hint"


Both can be reported using my example source, and the latter with reference to the settings above.

440bx

  • Hero Member
  • *****
  • Posts: 4742
« Last Edit: April 25, 2024, 12:15:59 am by 440bx »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018