For those interested in writing scripts for Tabular Editor 2/3 from within Visual Studio Code; giving you the added benefit of source control for your Tabular Editor scripts as well as IntelliSense if you don't use Tabular Editor 3 π.
The below software needs to be installed. (Portable versions of Tabular Editor are not compatible.)
dotnet tool install -g dotnet-script --version 1.3.1
"csharp": "dotnet script --isolated-load-context"
from "csharp": "cscript"
To author C# scripts (and code) from Visual Studio Code, you need to install:
To run C# scripts from Visual Studio Code (the Management scripts in this case) you need to install:
If you get the "Tool 'dotnet-script' failed to install
" error when executing the install command from terminal, try updating the package source in your NuGet config file as per this post on Stack Overflow.
The scripts in the "Management" folder of this repo are designed to be run from within Visual Studio Code without Tabular Editor running.
These scripts are compatible with either Tabular Editor 3 or Tabular Editor 2. (With the exception of the 'TE2 Script Compiler Update.csx' script which applies to Tabular Editor 2 only.)
The default behaviour is to export/import into/from Tabular Editor 3 if it is detected, otherwise, Tabular Editor 2 will be used. This behaviour can be controlled by setting the variable 'TE3overTE2' to 'true' or 'false' in the export/import scripts. If the variable 'TE3overTE2' is set to 'false', then Tabular Editor 2 will be exported/imported into/from even if Tabular Editor 3 is installed.
If you intend to to use the native debugger to run the Macro Management Scripts then you will also need to execute the command dotnet script init
to reset the environemnt before running the debugger.
Use at your own risk! Although I put much care into ensuring these scripts work, I offer no support if the use of these scripts breaks either Tabular Editor or a model you are working on.