Skip to main content

BimlScript Intellisense with BimlExpress

BimlExpress for Visual Studio Code gives colorizing and IntelliSense for Biml XML and for embedded C# and VB code nuggets, with Quick Info tooltips and signature help for Biml, C# and VB regions. Editing Biml describes them.

In the earlier BimlExpress add-in for Visual Studio, the intellisense for creating Biml and BimlScript files was limited to Biml only. There was no intellisense for C# or VB code in a BimlScript document with Visual Studio. In most cases, when the VS editor detected non-XML in the document all intellisense was lost. This post gives a few workarounds for that add-in.

note

The rest of this page describes the earlier BimlExpress add-in for Visual Studio, which is still offered as a download and is no longer developed. BimlExpress is now an extension for Visual Studio Code: see BimlExpress for Visual Studio Code.

1. Use the Editor at BimlScript.com​

The legacy BimlScript.com online editor (since retired) did not have intelliprompt for C# or VB, but did preserve intelliprompt for Biml. Code authored there could be copy and pasted to Visual Studio. Read the Overcoming BimlScript Copy and Paste Issues in Visual Studio article if you are having issues pasting code into Visual Studio.

2. Place directives after the closing Biml tag​

Directives are declared in the <#@ … #>. The most common directive is the template directive; <#@ template tier="2"#>. Place it and others in the line under the closing Biml tag.

3. Comment code blocks with XML comment tags​

The Biml compiler ignores the XML Comment tags while processing code blocks and directives. When the code blocks are placed inside {/* … */} , the code will function normally and the document will still look like XML to Visual Studio. You can place XML comments around include directives when writing BimlScript, but they might need to be removed before running the BimlScript.

Sample BimlScript​

Below is a sample BimlScript using suggestions 2 and 3 above. For the script to execute correctly, the XML comments inside the tag need to be removed before creating the SSIS package.

<!--<#@ include file="i_BimlScript_Ods_L2_PivotTable_Variables.biml" #> -->
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="MERGE Test" ConstraintMode="Linear">
<Tasks>
<!--
<# foreach(var table in RootNode.Tables.Where(item => item.SchemaName == "metaapmods" && item.Name == "APM_LoanStrucs" )) {#>
-->
<ExecuteSQL Name="MERGE <#=table.Name #>" ConnectionName="<#=table.Connection#>" >
<DirectInput>
<!--
<#@ include file="i_BimlScript_Ods_L1_Table_Annotations_SourceQuery_Merge2.biml" #>
-->
</DirectInput>
</ExecuteSQL>
<!-- <# } #> -->
</Tasks>
</Package>
</Packages>
</Biml>
<#@ template tier="2"#>
<#@ include file="i-Tables-MERGE-SCDType-Functions.biml" #>