Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-03

Howto use Tooltip for function pos( for example?

10 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Landmesser John

sorry, couldn't google it  ...

if i type for example function  pos(   in Lazarus-Editor.

Tooltip windows appears and at the right end of the tooltip window there are buttons ... what for?

Thanks!

Reply by email

Landmesser John
to Landmesser John

got it: insert parameters!!

Didn't work correctly with first try:

snip:

       pos(
       Application.Minimize, v2);

v2 ist put to wrong position, if the line

Application.Minimize;

follows!

Landmesser John wrote 9 lines
sorry, couldn't google it  ... if i type for example function  pos(   in Lazarus-Editor. Tooltip windows appears and at the right end of the tooltip window there are buttons ... what for? Thanks!

Reply by email

Juha Manninen
to Landmesser John
Landmesser John wrote 5 lines
pos( Application.Minimize, v2); v2 ist put to wrong position, if the line Application.Minimize; follows!

Wow, you found a bug! Please report.
It happens if any function call is following the line where you try to insert parameters, not only with Application.Minimize call. You did not mention your Lazarus version. I can reproduce at least with Lazarus trunk.
Is it a regression? Did it work earlier? What revision broke it?

Juha

Reply by email

Juha Manninen
to Mattias Gaertner
Mattias Gaertner wrote
It does not check, if the parameter is compatible. It sees pos( something.something;

It changes:

  sl := TStringList.Create;

into:
pos(

  sl := TStringList.Create, v2);

which can never be right.
I think a newline should break searching for existing parameters in this case. When a user wants to insert template parameters, he typically has no existing parameters at that point.
If he has existing parameters, then he uses Ctrl-Space and Ctrl-Shift-Space to modify / verify them.

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Show quoted text 13 lines
On Thu, Mar 15, 2018 at 12:44 PM, Mattias Gaertner via Lazarus wrote: > It does not check, if the parameter is compatible. > It sees > pos( something.something; It changes: sl := TStringList.Create; into: pos( sl := TStringList.Create, v2); which can never be right.

True. Feel free to improve the heuristic.

I think a newline should break searching for existing parameters in this case.

Maybe better: "when the closing bracket is missing, a newline should break".

When a user wants to insert template parameters, he typically has no existing parameters at that point. If he has existing parameters, then he uses Ctrl-Space and Ctrl-Shift-Space to modify / verify them.

You can't use Ctrl-Space to add v2.

Mattias

Reply by email

Landmesser John
to Mattias Gaertner

Don't know if that feature ever worked!

Info:

Lazarus 1.9.0 trunk FPC 3.0.4 i386-win32-win32/win64

Should i write bug-report?

Mattias Gaertner wrote 28 lines
On Thu, 15 Mar 2018 13:15:43 +0200 Juha Manninen via Lazarus wrote: > On Thu, Mar 15, 2018 at 12:44 PM, Mattias Gaertner via Lazarus > wrote: >> It does not check, if the parameter is compatible. >> It sees >> pos( something.something; > It changes: > sl := TStringList.Create; > into: > pos( > sl := TStringList.Create, v2); > > which can never be right. True. Feel free to improve the heuristic. > I think a newline should break searching for existing parameters in this case. Maybe better: "when the closing bracket is missing, a newline should break". > When a user wants to insert template parameters, he typically has no > existing parameters at that point. > If he has existing parameters, then he uses Ctrl-Space and > Ctrl-Shift-Space to modify / verify them. You can't use Ctrl-Space to add v2. Mattias

Reply by email