I am working with Code-Generation
and trying to get the path
of the Annotated-File
.
I would need it inside the visitFieldElement
:
@override
dynamic visitFieldElement(FieldElement element) {
// Get path here
}
I tried couple of different things: element.source
, elenment.librarySource
, element.location
.
But non of them is giving me the exact path relativ from lib/
.
I know I can simply extract it from e.g the element.location
but I thought there must be a cleaner way to get this done.
It should be possible since the builder
itself is printing out the path
:
Any idea? Let me know if you need any more info!