Auto-completing of block ending: Sub - End Sub.

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Sergey Kaminskiy
Avatar
I am evaluating SyntaxEditor for use as a VB.NET editor. One feature I would like to see is auto-completing of block endings (Class – End Class, Sub – End Sub etc.) after user presses enter at the end of the first line of the block. Is there such feature in SyntaxEditor + VB.NET language add-on? If not, how this can be done?

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Sergey,

That currently isn't automatically done. However you could override your language's OnSyntaxEditorKeyTyped method and if it is an enter key then look at the tokens before the current caret offset (via a Document.GetTextStream) and if it appears to be a Sub declaration then insert the End Sub. You'd also want to ensure that the tokens after the caret wouldn't indicate any sort of statement, etc.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 8 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.