Protected Regions for Codegeneration [message #1715212] |
Fri, 20 November 2015 09:36 |
Stephan Schaer Messages: 3 Registered: November 2015 |
Junior Member |
|
|
We like to modify the generated code which should not be overridden after an additional generation. For that we used https://github.com/danieldietrich/xtext-protected-regions.
For that we registered this mechanism with the following code inside RuntimeModule implementation:
@Provides
public JavaIoFileSystemAccess createJavaIoFileSystemAccess(ProtectedRegionJavaIoFileSystemAccess fsa, ParserFactory factory) {
fsa.support().addParser(factory.javaParser(), ".java");
fsa.support().addParser(factory.xmlParser(), ".xml", ".xsd");
// BidiJavaIoFileSystemAccess fsa2 = new BidiJavaIoFileSystemAccess(support);
return fsa;
}
With the newest Version this is not possible anymore. How can we do the same with the newest version? Which possibilities do we have? Is there an alternative?
[Updated on: Tue, 24 November 2015 08:06] Report message to a moderator
|
|
|
|
|
Re: Protected Regions for Codegeneration [message #1715519 is a reply to message #1715506] |
Tue, 24 November 2015 09:06 |
|
the api of the post process method has changed
=>
override postProcess(String fileName, String outputConfiguration, CharSequence content, String charset) {
logger.debug("postProcess('{}', '{}', <content>)", fileName, outputConfiguration)
val postProcessed = super.postProcess(fileName, outputConfiguration, content, charset)
val file = file(fileName, outputConfiguration)
support.merge(file, postProcessed, charsetProvider)
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03430 seconds