Trying to Add Method or Text to Class Semantic data

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Mike Walker
Version: 4.0.0262
Avatar
Hi

I am trying to see whether we can using the semanticparsedata add a child node as I need to know and or put my caret in a specific position in the document window to insert a new method or property that I am creating.

Ideally would be nice to have an AddChildNode() style function or is there a way I can in code get to a place in the document that I can add a method IE not inside another method?

Thanks
Mike Walker

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Mike,

I'll add this request to the TODO list. But you can probably do this pretty easily right now. If you navigate down the AST to the type you want to insert the method in, maybe just get its EndOffset from the AstNode. Then subtract one and you are inside the curly brace (assuming the parse data is in sync with the document). Then insert the new method code at that offset via Document.InsertText.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.