Posted 14 years ago by Nassim Farhat
Version: 4.0.0283
Avatar
Hello,

I don't know how to make sense of this, how do you figure out if the present location of cursor is inside the round brackets and when it is outside round brackets. I use dynamiclanguage definition and definied my brackets explicitly just liek your C# language does:

<ExplicitPatternGroup Key="OpenParenthesisPatternGroup" TokenKey="OpenParenthesisToken" PatternValue="(" LookAhead="$|[^\*\.]" EndBracket="CloseParenthesisPatternGroup" />

<ExplicitPatternGroup Key="CloseParenthesisPatternGroup" TokenKey="CloseParenthesisToken" PatternValue=")" StartBracket="OpenParenthesisPatternGroup" />

I have the following options set to true:

syntaxEditor.BracketHighlightingInclusive = true;
syntaxEditor.BracketHighlightingVisible = true;

And i see that the dynamic paraser highlights the parenthesis for me, but how do i determine at all times anywhere in my code if i am inside or not of a perenthesis structure?

Regards

Comments (2)

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

You can get a TextStream at any time to scan text like this:
TextStream stream = editor.Document.GetTextStream(editor.Caret.Offset);

The stream lets you move forward/backward by character, token, etc. Use that to determine what you are around.


Actipro Software Support

Posted 14 years ago by Nassim Farhat
Avatar
Thank you ...that helped a lot! It just takes a while to get used to all the features of this tool.

Regards
Nassim
The latest build of this product (v23.1.2) was released 23 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.