Duplication of custom operations
See original GitHub issueFirst of all, neither CustomOperations
nor SpecialCustomOperations
are included in the json schema, which results in no Intellisense support in VS 2017, and makes them hard to work with.
We need to use conditional processing for XML content in various template files, but, while it works fine for our *proj files, it does not work for .config files out of the box. We had to add special operations for .config files to enable it as follows.
"SpecialCustomOperations": {
"**/*.config": {
"operations": [
{
"type": "conditional",
"configuration": {
"actionableIf": [ "<!--#if" ],
"actionableElse": [ "#else", "<!--#else" ],
"actionableElseif": [ "#elseif", "<!--#elseif", "#elif", "<!--#elif" ],
"endif": [ "#endif", "<!--#endif" ],
"trim": "true",
"wholeLine": "true",
"actions": [ "fixPseudoNestedComments" ]
}
},
{
"type": "balancednesting",
"configuration": {
"startToken": "<!--",
"realEndToken": "-->",
"pseudoEndToken": "-- >",
"id": "fixPseudoNestedComments",
"resetFlag": "_TestResetFlag_"
}
}
]
},...
However, we also have other files that contain XML with a different extension (*.xom
). So, to enable conditional processing for those as well, we had to repeat the same configuration for the **/*.xom
pattern, since I don’t know how to specify the glob to cover multiple extensions. This results in unnecessary duplication, and bloats the template configuration.
It would be great if the operations could be defined separately under a unique name, and then just referenced by the special custom operations under the respective globs. In this case we would just reference the standard operation to apply it to any additional extensions. Please let me know if there is a better way to define such conditional processing without duplicating configurations.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top GitHub Comments
As a possible solution, we discussed having shorter syntax for it as:
where key value pairs are:
@vlada-shubina I guess this approach should work. Thanks for looking into this.