I'm using the Pascal styler, how can I params hints to be invoked when you type "(". I notice that the autocompletion event rather than paramhints when AutoHintParameters is set hpManual. How to invoke param hints from code?
To get the behavior that I'm looking for, which is the same as the Delphi IDE, I have to do this:
- In OnGetCompletionList, check if the token contians a "("
- if it does, then send a SHFT+CTRL+SPACE to the memo to manually invoke param hints
- exit OnGetCompletionList
Now when I type a "(" after a function or SHFT+CTRL+SPACE it will invoke param hints. Which is the same behavior as the Delphi IDE.
Can I get this behavior without having to do this?
You define this under AdvPascalMemoStyler.HintParameter.Parameters
For example, in the default TAdvPascalMemoStyler, you can see:
ShowMessage(const Msg: string);
MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer);
and when ShowMessage( is typed, it recognizes what is typed in this Parameters list and will show the parameter hint.
If what you want to do is dynamically define parameter hints, this is done via the event AdvMemo.OnGetParameterHint().
This passes the token found before the '(' character and you can return the parameter list via the var param AParameterHint of this event.
Hi, everything is done dynamically. I use a pascal parser to generate a AST that I use to get the info needed for the completion list as well as param. OnGetParameterHint and OnGetCompletionList are defined. What I am saying is that when you type "(", OnGetCompletionList is fired. I think that is an error. The only way I could make it work property is inside OnGetCompletionList I check the token to see if it has a "(" if so, I send a CTRL+SHIFT+SPACE to the control and exit, which will then fire paramhints and it then works property.
With the modification I made above, here is what I have working so far:
Can you change
AdvMemo.AutoCompletion.StartToken to '.'