EnergyPlus & Modelkit Language SupportSyntax highlighting with auto-completion of model objects and code snippets for EnergyPlus and Modelkit files. FeaturesSnippetsThis extension leverages snippets to do various processes related to EnergyPlus objects. First, select the EnergyPlus version that you would like to work with under File / Preferences / Settings / Extensions / EnergyPlus Version. Once selected, you should see a notification window appear when viewing EnergyPlus files. Now, you will be able to auto-complete EnergyPlus objects from your selected version with input fields set to default values. Input fields that do not have default values and 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 Before auto-completing an object, at the right of the auto-complete window you will be able to see an extended preview of:
You can toggle this extended preview feature by clicking the After auto-completing an object, you can use the The gif below shows an example of:
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 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. Finally, you can use both EnergyPlus and Modelkit snippets within Modelkit files. Toggle CommentsThis 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 ReferenceThis extension includes a View Input Output Reference command, which can open an internet browser window outside of VS Code for the selected text of the object class and corresponding EnergyPlus Version setting. There are two options for accessing these commands:
This feature is also available in the extended preview of the snippet for each object class by clicking on Input Output Reference. See Change Log for release notes |