3
Vote

Biml syntax highlighting lost upon re-opening .biml file containing embedded C# code tags <# #>

description

When creating new .biml constructs, if you add C# code inside <# #> tags, save, close, then re-open, the syntax highlighting is lost. This is annoying, but I've found a workaround.
 
1) Open the .biml file (notice that the syntax highlighting is now gone, presenting a plain black/white text)
2) Comment out the C# header references at the top before the leading <Biml> tag (see below)
<!-- <#@ template language="C#" hostspecific="true"#> <#@ import namespace="System.Data" #> --> 3) Close and re-open the .biml file (enjoy the Biml markup highlighting)
4) Un-comment C# header(s) to perform package builds
5) Re-comment C# header(s) before saving so the next time you have the syntax highlighting

comments

lucazav wrote Jun 14, 2013 at 11:52 AM

This issue is really annoying. I hope it'll be fixed on the next release.
Your workaround is great! Simply you have to make sure the first tag is the <biml> one. In fact, I have a BimlScript file like this:
<#@ template language="C#" hostspecific="true"#>
<#@ import namespace="System.Data" #>
<# do some stuff #>
<biml>
...
</biml>
So, in order to have syntax highlighting I have to comment from the beginning to the <biml> tag:
<!--<#@ template language="C#" hostspecific="true"#>
<#@ import namespace="System.Data" #>
<#
... do some stuff...
#>-->
<biml>
...
</biml>

lucazav wrote Jun 14, 2013 at 12:05 PM

It'd really useful if template language syntax highlighting will be provided too in the next release...