kastree icon indicating copy to clipboard operation
kastree copied to clipboard

Location of node?

Open BugDiver opened this issue 4 years ago • 3 comments

How to get the location of the node? Ex:

  • Start Line no
  • End Line no
  • Start Char no of line
  • End Char no of line

BugDiver avatar Mar 14 '20 14:03 BugDiver

I don't actively develop this anymore, but you could populate the tag field on every node with positional information using a custom converter (i.e. extending kastree.ast.psi.Converter and overriding onNode).

cretz avatar Mar 14 '20 14:03 cretz

@cretz I figured that from #16. Thanks for the help.

I don't actively develop this anymore Do you suggest any other libraries which I can use for parsing manipulating kotlin code?

BugDiver avatar Mar 15 '20 05:03 BugDiver

In the readme I mention https://github.com/kotlinx/ast, but I have never used it so I can't exactly say how good it is.

cretz avatar Mar 15 '20 11:03 cretz