-
I use langium 2.1.3
Not
-->
But
-->
How did I solve this: I determine the "end position" to be deleted by calling It works. Is this the way it is intended to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @goto40, since you want to delete all text from one AST node until the next node, it seems reasonable to use
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 actually belongs to the model. As the comment does not belong to it, it will stay right where it is. I would say that this is the expected behavior for this functionality. |
Beta Was this translation helpful? Give feedback.
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 usegetNextNode
for some custom CST validations in our own projects quite regularly.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…