When the OnGetParameterHint event returns a non-empty AParameterHint string and the parameter hint popup is visible, cursor movement inside parentheses becomes extremely slow (arrow keys, typing).
Steps to reproduce:
Set AutoHintParameterPosition = hpBelowCode
Implement OnGetParameterHint with Handled := True and return a valid hint string
Type a function call, e.g. MyFunction(param1, param2, param3)
Move the cursor inside the parentheses using arrow keys
Expected: Smooth cursor navigation, same as without hint popup
Actual: Noticeable lag on every keystroke/cursor move. The event fires on every single cursor position change, and each call triggers a full popup repaint.
Analysis:
Even with a trivially fast handler (single cached string comparison, no computation), the lag persists. Setting AParameterHint := '' (no popup shown) makes the editor fast again, confirming the popup rendering is the bottleneck — not the event handler itself.
Additional issue: The parameter hint popup disappears when the cursor is positioned after an opening parenthesis inside a string parameter.
Steps to reproduce:
Have a function with parameter hint: MyFunction(p1:string; p2:integer; p3:string)
Type: MyFunction('some text(', 123, 'other')
Move the cursor inside the string literal after the ( character
Expected: The parameter hint popup remains visible, since the ( is inside a string literal and not a function call Actual: The hint popup disappears because the component interprets the ( as a new function call context, without considering string literal boundaries
I could not see a speed problem here. I add 300 different functions to the HintParameter.Parameters list and see no influence on speed.
Code used:
var
i: integer;
s: string;
begin
for i := 1 to 300 do
begin
s := 'mytest' + i.Tostring+ 'function(vparam1: string; vP2: integer; vparam3: string): integer;';
advpascalmemostyler1.HintParameter.Parameters.Add(s);
end;
end;
We could see an issue with string parameters that contain a specific symbol and have applied a fix that will be included in the next release.
Crazy, on my side it doesn’t work…
Which screen recording tool are you using? I’d like to use the same one to create a video and show you the bug on our side.
but I can't help but thinking there are other things involved in your application that cause this slowness, so it might be better to try to isolate this and send a sample source project with which we can reproduce the problem here.
I will try to analize as much as possible. What I additional see is a connected tAdvPascalMemoStyler with Hintparameter.parameters containing a lot of elements.