polyglot-scala: Support more valid XML element name chars in dynamic Config #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The convenient dynamic apply of
Config
companion object has currently some technical limitations which result in mangled parameter names. When used without further processing (as it is currently the case), not all valid element names (in terms of XML element spec) can be specified, e.g. the minus ("-") is a valid character in XML element names, but not in Scala methods names.To get the following model (config of bundle-maven-plugin, XML notation):
I want to write:
But this currently doesn't work. It results in:
So, one has to fall back to the class constructor of the Config class.
This PR tries to fix that.
The list of possibly supportable characters is not complete yet, but it's a start for the most common cases. I added a TODO note linking the XML spec.
I need to figure out how to programmatically create test cases with specs2. Any hint is welcome.
EDIT: added better motivation