Intelliprompt for any letter

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by ayala
Version: 4.0.0285
Avatar
Hi,
I'm downloaded the evaluation of the syntax editor and I'm now testing it for my application.
I created a xml for my language. What I want is the same behavior as in VS: when I start typing any letter- I get the intelliprompt with all the available words(I will create that). But I can't configure how to do that. Is there a way to set KeyPressTrigger to be any char that is a letter?
And more that that- after the intelliprompt shows- I want it to select automaticly the matching word, lets say if I typed "f" the intelliprompt should show, and be set on the "false" member in the list(if "false" is the first word in f).
Thanks, Ayala.

Comments (3)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ayala,

We don't have a built-in way to do that right now however you could handle the SyntaxEditor's KeyTyped event and if it is a letter, go scan the text with a TextStream (from Document.GetTextStream()) to see if it started a word. If so then show the member list.

As long as when you request the member list you pass the offset range that contains the letter, it will auto-select the appropriate item for you.


Actipro Software Support

Posted 14 years ago by ayala
Avatar
Thanks. I did that but I still have a problem: When I type the first letter, the intelliprompt pops fine- with the appropriate auto-select. But when I type the second letter- it pops up again- it does not recognize that it's the same word, and it acts like a new word.(again-auto-selects but for the second letter).
My code is:
if (stream.IsAtTokenStart)
{
if (stream.Offset > 0)
{
stream.GoToPreviousToken();
targetTextRange = stream.Token.TextRange;
}
}
else
{
stream.GoToCurrentTokenStart();
targetTextRange = stream.Token.TextRange;
}
But "IsAtTokenStart" is always true!
Am I missing anything, or is that a bug?
Thanks, Ayala.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ayala,

Two things could cause that... First would be if you didn't define something like an Identifier token for your language. In that case plain text could just be consumed as a token for each character, which is bad performance-wise and will cause what you see. Either that or you didn't pass the correct offset when creating the TextStream.


Actipro Software Support

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.