MemberList Triggers SE v3

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Justin Milly
Version: 4.0.0233
Avatar
I am trying to implement a member list for PHP
ie. $object->memberFunction();

I added to the language xml:
<Triggers>
<KeyPressTrigger Key="MemberListTrigger" Character=">">
<KeyPressTriggerValidStates>
<KeyPressTriggerValidState State="DefaultState" />
</KeyPressTriggerValidStates>
</KeyPressTrigger>
</Triggers>

Now this will cause a trigger nearly everytime a > is pressed.. I want to do it only in this situation:

"$" + anyword + "->"

can anyone help me out :)
or point me in the right direction?

Thanks,

JM

Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Justin,

In your Trigger handler code, when you see that trigger occur you need to get a TextStream via Document.GetTextStream at the caret's offset. Then start iterating back and look at the tokens. You should see an Identifier token before the "->" token. Then you should see a dollar sign token before that. I don't have the definition up in front of me now but the "->" and "$" tokens may share a token key with other tokens so you'll also want to check their text contents to ensure they actually are the "->" and "$" tokens.

In the TextStream class you can use methods like GoToPreviousToken to navigate backwards. The Token property tells you the current IToken and the TokenText property tells you the text contained by that token.

Hope that helps get you started!


Actipro Software Support

Posted 18 years ago by Justin Milly
Avatar
Thank you i will try that.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.