Skip to content
Discussion options

You must be logged in to vote

Hey @goto40,

since you want to delete all text from one AST node until the next node, it seems reasonable to use getNextNode. You shouldn't run into any issues with that such as unintentionally deleting more code than intended. We use getNextNode for some custom CST validations in our own projects quite regularly.

If I delete the text from range: diagnostic.range.start .. diagnostic.range.end I do not delete the model text as expected, because I want to delete the model text until the next model element starts.

What is "expected" in this regard would be up for discussion. Since the diagnostic is only applied to the actual model text (but not the whole line), it will only delete what act…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@goto40
Comment options

Answer selected by goto40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants