
Is it possible to use the parser, or other methods, to find the matching brackets when using a temporary editor or document. (one that is not attached to the UI.)
I tried to use the SelectedView.Selection to set the start/end offsets to point to a '(' and then tried using Selection.MoveToMatchingBracket() but it doesn't seem to move.
It works fine when I do the same thing with my real [visible] editor.
I also tried to use SelectedView.BracketHighlighting but both BracketToken and MatchingBracketToken remain null.
(Note that this is a Dynamic language - not sure if the BracketHighlighting property is supported for Dynamic languages.)
For performance reasons I am doing everything in temporary objects, or in a StringBuilder, but I dont seem to be able to determine the text range for a block within parens. I can find the "(" no problem but I cant find the matching ")" so that I can indent the block.
(Simpley finding the 'next' ")" is no good - I need the matching one.)
Is this possible?
Thanks, Mike