EnergyPlus & Modelkit Language Support
Syntax highlighting with auto-completion of model objects and code snippets for EnergyPlus and Modelkit files.
This extension leverages snippets to auto-complete EnergyPlus objects with input fields set to default values. Input fields that do not have default values and require user input are auto-completed with "???".
This extension also leverages snippets to auto-complete typical code blocks used in Modelkit projects. Code block components that require user input are auto-completed with "???".
To use EnergyPlus snippets, type in the object class name, then select the appropriate object class name preceded by the box snippets icon by clicking on it or using arrow keys to highlight the desired object and then hit the Tab or Enter key.
At the right of the auto-complete window, you will be able to see a description of what that object represents in the building energy model. This description is taken from the EnergyPlus Input Data Dictionary (IDD) file. At the end of that description is a preview of the object and its input fields that will be added to the file. You can toggle this preview feature by clicking the
The gif below shows an example of using snippets to generate a
To use Modelkit snippets, type in the initial characters of the code black you want to insert. Select the appropriate snippet in the auto-complete window the same way you would for an EnergyPlus snippet. Note that there are different snippets whether you want to insert code already bound by Ruby brackets or insert code with new Ruby brackets.
This extension enables the Toggle Line Comment command in VS Code found under the Edit / Toggle Line Comment menu (keybinding:
Additionally, this extenion includes two commands for toggling comments: Toggle EnergyPlus Comments for adding and removing "!" from the beginning of lines in IDF, IMF, and PXT files, and Toggle Modelkit Comments for adding and removing "#" from the beginning of lines in IMF and PXT files. There are three options for accessing these commands:
These commands can be used for a single line or multiple selected lines. If multiple lines are selected, the extension will evaluate each line separately to know whether to add or remove the comment character. This is different behavior than the native Toggle Line Comment command in VS Code (if any selected line is NOT commented, adds comment character to ALL lines).
The keybindings are defined in
View Input Output Reference
This extension includes a View Input Output Reference command, which can open an internet browser window outside of VS Code for the selected object class. There are two options for accessing these commands:
See Change Log for release notes