m-m-m / code

Library to parse, analyze, transform and generate code
Apache License 2.0
2 stars 3 forks source link

Ability to create child context with CodeContext.createChildContext() #16

Closed hohwille closed 5 years ago

hohwille commented 5 years ago

When reading existing code from any location it will be read-only. It is already possible to copy and even transform this code, create new code on the fly, etc. However, this new code exists loosly in the wild. It would be awesome to be able to create a child context with CodeContext.createChildContext() that could inherit from the current context (as well as createContext() a new and empty context). In both cases that new context would be mutable, have its own source and root package. All code that is added within this context can therefore be browsed and traversed (e.g. to save all files from a generation session).

Notice: It should also be evaluated if storing the new types in the CodeCopyMapper as illustrated by one of our JUnits would already solve most of this scenario what will impact the priority of this issue.

hohwille commented 5 years ago

Done.